;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:20:59 2007 ;;; from file /home/cyd/emacs/lisp/mouse-copy.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`mouse-copy.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #@45 Internal to `mouse-drag-secondary-pasting'. (defvar mouse-copy-last-paste-start nil (#$ . 567)) #@45 Internal to `mouse-drag-secondary-pasting'. (defvar mouse-copy-last-paste-end nil (#$ . 669)) #@99 Set to enable mouse-copy-work-around-drag-bug. See `mouse-copy-work-around-drag-bug' for details. (defvar mouse-copy-have-drag-bug nil (#$ . 769)) #@628 Code to work around a bug in post-19.29 Emacs: it drops mouse-drag events. The problem occurs under XFree86-3.1.1 (X11R6pl11) but not under X11R5, and under post-19.29 but not early versions of Emacs. 19.29 and 19.30 seems to drop mouse drag events sometimes. (Reproducible under XFree86-3.1.1 (X11R6pl11) and XFree86-3.1.2 under Linux 1.2.x. Doesn't occur under X11R5 and SunOS 4.1.1.) To see if you have the problem: Disable this routine (with (setq mouse-copy-have-drag-bug nil)). Click and drag for a while. If highlighting stops tracking, you have the bug. If you have the bug (or the real fix :-), please let me know. (defalias 'mouse-copy-work-around-drag-bug #[(start-event end-event) "\212\211:\203\306 8\202\307 `\310\311F) \211:\203.\312 8:\203(\312\202)\306 8\2024\307 `\313\311F)\314\f\311 8)!\211q\210\315\n\316 8\206]\306 8:\203Z\306 8@\202]\306 8)\f\316 8\206w\306 8:\203t\306 8@\202w\306 8)\211:\203\214\312 8\250\203\214\312 8\202\215\306)S#\211@A@\203\255\317#\210\202\316\320\316 8\206\312\306 8:\203\307\306 8@\202\312\306 8)\"\321\322\323#\210q\210\324\325{\".\207" [start-event event start-posn end-event end-posn position 1 selected-window (0 . 0) 0 2 (0 . 0) window-buffer mouse-start-end 5 move-overlay make-overlay overlay-put face secondary-selection x-set-selection SECONDARY end-buffer range beg end mouse-secondary-overlay] 6 (#$ . 923)]) #@240 Drag out a secondary selection, then paste it at the current point. To test this function, evaluate: (global-set-key [M-down-mouse-1] 'mouse-drag-secondary-pasting) put the point at one place, then click and drag over some other region. (defalias 'mouse-drag-secondary-pasting #[(start-event) "\203# \211:\203\306\n8\250\203\306\n8\202\307)\306Y\203# |\210\310 !\203=\f\2032\311 \"\210`\312\313!c\210`\211\207\314\211\207" [mouse-copy-last-paste-start start-event event mouse-copy-last-paste-end mouse-copy-have-drag-bug last-input-event 2 1 mouse-drag-secondary mouse-copy-work-around-drag-bug x-get-selection SECONDARY nil] 4 (#$ . 2369) "e"]) #@352 Kill the text in the secondary selection, but leave the selection set. This command is like \[mouse-kill-secondary] (that is, the secondary selection is deleted and placed in the kill ring), except that it also leaves the secondary buffer active on exit. This command was derived from mouse-kill-secondary in emacs-19.28 by johnh@ficus.cs.ucla.edu. (defalias 'mouse-kill-preserving-secondary #[nil "\305 \211\211GS\234\306\n! <\203/\307 \211:\203\310 8\202%\311 `\312\313F)\313\f8)!\2020p=\2048\314\315!\210*\212\306\n!q\210\316\317\n!\320\n!\")\207" [keys click mouse-secondary-overlay event position this-command-keys overlay-buffer window-buffer 1 selected-window (0 . 0) 0 error "Select or click on the buffer where the secondary selection is" kill-region overlay-start overlay-end] 7 (#$ . 3041) nil]) #@69 Sweep out a secondary selection, then move it to the current point. (defalias 'mouse-drag-secondary-moving #[(start-event) "\301!\205 \302 \210\303\304!c\207" [start-event mouse-drag-secondary mouse-kill-preserving-secondary x-get-selection SECONDARY] 2 (#$ . 3866) "e"]) (provide 'mouse-copy)