;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Thu Apr 20 16:31:24 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/mouse-sel.el ;;; emacs version 19.28.90.31. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/gd/gnu/emacs/19.0/lisp/mouse-sel.el' was compiled for Emacs 19")) (byte-code "!!!!" [provide mouse-sel require mouse thingatpt backquote] 2) #@235 *Leave point near last mouse position. If non-nil, \[mouse-select] and \[mouse-extend] will leave point at the end of the region nearest to where the mouse last was. If nil, point will always be placed at the beginning of the region. (defvar mouse-sel-leave-point-near-mouse t (#$ . -575)) #@70 *If non-nil, \[mouse-select] cycles the click-counts after 4 clicks. (defvar mouse-sel-cycle-clicks t (#$ . -871)) #@74 Set to nil before loading `mouse-sel' to prevent default mouse bindings. (defvar mouse-sel-default-bindings t (#$ . 992)) #@46 Type of PRIMARY selection in current buffer. (defvar mouse-sel-primary-thing nil (#$ . 1120)) (make-variable-buffer-local (quote mouse-sel-primary-thing)) #@48 Type of SECONDARY selection in current buffer. (defvar mouse-sel-secondary-thing nil (#$ . 1281)) (byte-code "! !ʼn\" #" [make-variable-buffer-local mouse-sel-secondary-thing overlayp mouse-secondary-overlay make-overlay 1 overlay-put face secondary-selection] 4) #@386 Alist associating selections with variables. Each element is of the form: (SELECTION-NAME OVERLAY-SYMBOL SELECTION-THING-SYMBOL) where SELECTION-NAME = name of selection OVERLAY-SYMBOL = name of variable containing overlay to use SELECTION-THING-SYMBOL = name of variable where the current selection type for this selection should be stored. (defconst mouse-sel-selection-alist (quote ((PRIMARY mouse-drag-overlay mouse-sel-primary-thing) (SECONDARY mouse-secondary-overlay mouse-sel-secondary-thing))) (#$ . 1567)) #@146 Function to call to set selection. Called with two arguments: SELECTION, the name of the selection concerned, and VALUE, the text to store. (defvar mouse-sel-set-selection-function (byte-code "!" [fboundp x-set-selection] 2) (#$ . 2133)) #@118 Function to call to get the selection. Called with one argument: SELECTION: the name of the selection concerned. (defvar mouse-sel-get-selection-function (byte-code "!" [fboundp x-get-selection] 2) (#$ . 2390)) #@137 Function to check whether Emacs still owns the selection. Called with one argument: SELECTION: the name of the selection concerned. (defvar mouse-sel-selection-owner-p-function (byte-code "!" [fboundp x-selection-owner-p] 2) (#$ . 2619)) #@519 Determine what `thing' `mouse-sel' should operate on. The first argument is NCLICKS, is the number of consecutive mouse clicks at the same position. Double-clicking on word constituents selects words. Double-clicking on symbol constituents selects symbols. Double-clicking on quotes or parentheses selects sexps. Double-clicking on whitespace selects whitespace. Triple-clicking selects lines. Quad-clicking selects paragraphs. Feel free to re-define this function to support your own desired multi-click semantics. (defalias 'mouse-sel-determine-selection-thing #[(nclicks) "`f z\n SĦT UƂW U(ȂW Y2ɂW ><˂W>F͂W =PςW =W*" [next-char char-syntax mouse-sel-cycle-clicks nclicks 4 1 nil 3 line paragraph (40 41 34 39) sexp (32 9 10) whitespace 95 symbol 119 word] 3 (#$ . 2875)]) #@39 Set the specified SELECTION to VALUE. (defalias 'mouse-sel-set-selection #[(selection value) "  \n\" \n#" [mouse-sel-set-selection-function selection value put mouse-sel-internal-selection] 4 (#$ . 3706)]) #@43 Get the value of the specified SELECTION. (defalias 'mouse-sel-get-selection #[(selection) " ! N" [mouse-sel-get-selection-function selection mouse-sel-internal-selection] 2 (#$ . 3926)]) #@55 Determine whether Emacs owns the specified SELECTION. (defalias 'mouse-sel-selection-owner-p #[(selection) " !‡" [mouse-sel-selection-owner-p-function selection t] 2 (#$ . 4128)]) #@44 Return overlay corresponding to SELECTION. (defalias 'mouse-sel-selection-overlay #[(selection) " \n\"A@ \" J)" [assoc selection mouse-sel-selection-alist symbol error "No overlay corresponding to %s selection"] 4 (#$ . 4321)]) #@44 Return overlay corresponding to SELECTION. (defalias 'mouse-sel-selection-thing #[(selection) "\n \"8\n\"\f)" [2 assoc selection mouse-sel-selection-alist symbol error "No symbol corresponding to %s selection"] 5 (#$ . 4565)]) #@225 Convert region to PRIMARY overlay and deactivate region. Argument ORIG-WINDOW specifies the window the cursor was in when the originating command was issued, and is used to determine whether the region was visible or not. (defalias 'mouse-sel-region-to-primary #[(orig-window) ">!\f$  =$ p$: =6 ``p$: !̉)" [transient-mark-mode mouse-sel-selection-overlay PRIMARY overlay mark-active highlight-nonselected-windows orig-window selected-window move-overlay region-beginning region-end delete-overlay nil] 5 (#$ . 4810)]) #@205 Convert PRIMARY overlay to region. Optional argument DIRECTION specifies the mouse drag direction: a value of 1 indicates that the mouse was dragged left-to-right, otherwise it was dragged right-to-left. (defalias 'mouse-sel-primary-to-region #[(&optional direction) "!\n!\n!\f=*\f\fbM !M\fC =Cb\f#M\fb#U\n!+" [mouse-sel-selection-overlay PRIMARY overlay overlay-start start overlay-end end transient-mark-mode nil mark-active run-hooks deactivate-mark-hook mouse-sel-leave-point-near-mouse direction 1 push-mark nomsg active delete-overlay] 4 (#$ . 5375)]) #@124 Evaluate forms at mouse position. Move to the end position of EVENT, execute FORMS, and restore original point and window. (defalias 'mouse-sel-eval-at-event-end '(macro . #[(event &rest forms) " DDC DEBBB" [let posn event-end event if mouse-minibuffer-check (if (and posn (not (windowp (posn-window posn)))) (error "Cursor not in text area of window")) (orig-window orig-point-marker) (setq orig-window (selected-window)) (if posn (select-window (posn-window posn))) (setq orig-point-marker (point-marker)) (if (and posn (numberp (posn-point posn))) (goto-char (posn-point posn))) unwind-protect progn forms ((goto-char (marker-position orig-point-marker)) (move-marker orig-point-marker nil) (select-window orig-window))] 13 (#$ . 5996)])) (put (quote mouse-sel-eval-at-event-end) (quote lisp-indent-hook) 1) #@392 Set region/selection using the mouse. Click sets point & mark to click position. Dragging extends region/selection. Multi-clicking selects word/lines/paragraphs, as determined by 'mouse-sel-determine-selection-thing. Clicking mouse-2 while selecting copies selected text to the kill-ring. Clicking mouse-1 or mouse-3 kills the selected text. This should be bound to a down-mouse event. (defalias 'mouse-select #[(event) "Ž \"*" [nil direction ((mouse-sel-primary-to-region direction)) mouse-select-internal PRIMARY event] 3 (#$ . 6837) "@e"]) #@426 Set secondary selection using the mouse. Click sets the start of the secondary selection to click position. Dragging extends the secondary selection. Multi-clicking selects word/lines/paragraphs, as determined by 'mouse-sel-determine-selection-thing. Clicking mouse-2 while selecting copies selected text to the kill-ring. Clicking mouse-1 or mouse-3 kills the selected text. This should be bound to a down-mouse event. (defalias 'mouse-select-secondary #[(event) "\n\"" [mouse-select-internal SECONDARY event] 3 (#$ . 7400) "e"]) #@32 Set SELECTION using the mouse. (defalias 'mouse-select-internal #[(selection event) "8: 8)! - @)!-!ɉ\n  D @)! \n A@:^A@@bA@) A@:yA@@}A@)bώ!!88)!LJ!@Ap$``p$+!," [event 2 1 posn mouse-minibuffer-check windowp position error "Cursor not in text area of window" nil orig-point-marker orig-window selected-window select-window point-marker ((byte-code " !b ‰\f!" [marker-position orig-point-marker nil select-window orig-window] 3)) mouse-sel-selection-thing selection mouse-sel-selection-overlay overlay thing-symbol mouse-sel-determine-selection-thing bounds-of-thing-at-point object-bounds move-overlay mouse-extend-internal] 6 (#$ . 7945)]) #@42 Extend region/selection using the mouse. (defalias 'mouse-extend #[(event) "   8:Ƃ 8)@)!Ɏ ! \"+" [selected-window nil direction orig-window select-window event 2 1 position ((mouse-sel-primary-to-region direction)) mouse-sel-region-to-primary mouse-extend-internal PRIMARY] 4 (#$ . 8732) "e"]) #@45 Extend secondary selection using the mouse. (defalias 'mouse-extend-secondary #[(event) "" [((byte-code "\n\"" [mouse-extend-internal SECONDARY event] 3))] 1 (#$ . 9058) "e"]) #@258 Extend specified SELECTION using the mouse. Track mouse-motion events, adjusting the SELECTION appropriately. Optional argument INITIAL-EVENT specifies an initial down-mouse event to process. See documentation for mouse-select-internal for more details. (defalias 'mouse-extend-internal #[(selection &optional initial-event) " 8: ‚ 8)!\f-\f@)!-!ʉ \f \f\fD\f@)!  \f\fA@:^A@@bA@)\fA@:yA@@}A@)bЎ !\"A֎!! \f\f!\f!A@\f!8!\"$%&'!p=!%!&`%&L! \" !!*)*=)*{\"02!=0)*\" {2!>Z2!>Z)*\")# {2!={2!>{)*\")#+'." [initial-event event 2 1 posn mouse-minibuffer-check windowp position error "Cursor not in text area of window" nil orig-point-marker orig-window selected-window select-window point-marker ((byte-code " !b ‰\f!" [marker-position orig-point-marker nil select-window orig-window] 3)) assoc cursor-type frame-parameters selected-frame orig-cursor-type ((byte-code "! \fBC\"" [fboundp modify-frame-parameters selected-frame cursor-type orig-cursor-type] 4)) mouse-sel-selection-thing selection thing-symbol mouse-sel-selection-overlay overlay window-frame orig-window-frame window-edges top 3 bottom mark-active 0 echo-keystrokes min max direction overlay-buffer overlay-start overlay-end fboundp modify-frame-parameters ((cursor-type . bar)) (lambda nil (track-mouse (byte-code "\f : @> J  8:*Ƃ+ 8) = @)e @)\f\f!Z\f!\\\f)!= @)= AAoWZ$mYZT$) A@: A@@ A@)=$ A@: A@@ A@)b$=$`\\ƥWڂI=8`X8I=I`YI x=\\m\\u`=npbޏ*=`=`p$*" [initial-event event nil read-event (mouse-movement switch-frame) thing-symbol 2 1 end selection-thing switch-frame position posn-w windowp window-frame orig-window mouse-position end-row top mouse-scroll-subr overlay max bottom min mode-line direction -1 last goal (byte-code " `Z_V` \"` [\" `Z_V,- b)‡" [direction goal 0 last forward-thing selection-thing end] 3) ((error)) move-overlay] 6))) mouse-sel-set-selection this-command event-basic-type last-input-event mouse-2 copy-region-as-kill read-event (mouse-1 mouse-3) down event-modifiers kill-region move-overlay mouse-3 double] 5 (#$ . 9247)]) #@124 Insert the contents of the PRIMARY selection at mouse click. If `mouse-yank-at-point' is non-nil, insert at point instead. (defalias 'mouse-insert-selection #[(event) "\n\"" [mouse-insert-selection-internal PRIMARY event] 3 (#$ . 11836) "e"]) #@126 Insert the contents of the SECONDARY selection at mouse click. If `mouse-yank-at-point' is non-nil, insert at point instead. (defalias 'mouse-insert-secondary #[(event) "\n\"" [mouse-insert-selection-internal SECONDARY event] 3 (#$ . 12089) "e"]) #@122 Insert the contents of the named SELECTION at mouse click. If `mouse-yank-at-point' is non-nil, insert at point instead. (defalias 'mouse-insert-selection-internal #[(selection event) "\n! `\" !c" [mouse-yank-at-point mouse-set-point event mouse-sel-get-selection-function push-mark nomsg selection ""] 3 (#$ . 12346)]) #@147 Validate selections in mouse-sel-selection-alist. For each listed selection, remove the selection overlay if Emacs no longer owns the selection. (defalias 'mouse-sel-validate-selection #[nil " ‰, , @@ @A@J A\f! ! ," [mouse-sel-selection-owner-p-function mouse-sel-selection-alist nil overlay selection alist owner-p-function delete-overlay] 5 (#$ . 12692)]) (byte-code "\" K!!!\"\"!!!\"\" =F\"\"Bׇ" [add-hook pre-command-hook mouse-sel-validate-selection mouse-sel-default-bindings global-unset-key [mouse-1] [drag-mouse-1] [mouse-3] global-set-key [down-mouse-1] mouse-select [down-mouse-3] mouse-extend [M-mouse-1] [M-drag-mouse-1] [M-mouse-3] [M-down-mouse-1] mouse-select-secondary [M-down-mouse-3] mouse-extend-secondary interprogram-cut-paste [mouse-2] mouse-insert-selection nil interprogram-cut-function interprogram-paste-function [M-mouse-2] mouse-insert-secondary "mikew@gopher.dosli.govt.nz" mouse-sel-maintainer-address current-load-list] 3) #@47 Submit a bug report on mouse-sel.el via mail. (defalias 'mouse-sel-submit-bug-report #[nil "! ǏPү\n#" [require reporter reporter-submit-bug-report mouse-sel-maintainer-address "mouse-sel.el " nil mouse-sel-version ((error)) "(distributed with Emacs)" transient-mark-mode delete-selection-mode mouse-sel-default-bindings mouse-sel-leave-point-near-mouse mouse-sel-cycle-clicks mouse-sel-selection-alist mouse-sel-set-selection-function mouse-sel-get-selection-function mouse-sel-selection-owner-p-function mouse-yank-at-point] 13 (#$ . 13745) nil])