;ELC   
;;; compiled by rms@mole.gnu.ai.mit.edu on Wed Nov 15 13:03:32 1995
;;; from file /home/fsf/rms/e19/lisp/mouse-sel.el
;;; emacs version 19.29.91.3.
;;; 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.29")))
    (error "`mouse-sel.el' was compiled for Emacs 19.29 or later"))


(byte-code "!!!" [provide mouse-sel require mouse thingatpt] 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 (#$ . -550))
#@70 *If non-nil, \[mouse-select] cycles the click-counts after 4 clicks.
(defvar mouse-sel-cycle-clicks t (#$ . -846))
#@74 Set to nil before loading `mouse-sel' to prevent default mouse bindings.
(defvar mouse-sel-default-bindings t (#$ . 967))
#@46 Type of PRIMARY selection in current buffer.
(defvar mouse-sel-primary-thing nil (#$ . 1095))
(make-variable-buffer-local (quote mouse-sel-primary-thing))
#@48 Type of SECONDARY selection in current buffer.
(defvar mouse-sel-secondary-thing nil (#$ . 1256))
(byte-code "!! ŉ\"#" [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))) (#$ . 1542))
#@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) (#$ . 2108))
#@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) (#$ . 2365))
#@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 (#$ . 2594)])
#@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 (#$ . 3425)])
#@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 (#$ . 3645)])
#@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 (#$ . 3847)])
#@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 (#$ . 4091)])
#@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 (#$ . 4336)])
#@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 \fbM 	!M \fC =C b\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 (#$ . 4901)])
#@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DEBBB" [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 (#$ . 5522)]))
(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 (#$ . 6363) "@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 (#$ . 6926) "e"])
#@32 Set SELECTION using the mouse.
(defalias 'mouse-select-internal #[(selection event) "8:  8) !- @)!- !ɉ\n D @)! \n A@:^ A@@b A@) A@:y A@@} A@)bώ!!8 8 )!LJ! @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 (#$ . 7471)])
#@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 (#$ . 8258) "e"])
#@45 Extend secondary selection using the mouse.
(defalias 'mouse-extend-secondary #[(event) "" [((byte-code "\n\"" [mouse-extend-internal SECONDARY event] 3))] 1 (#$ . 8584) "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 \fA@:^ A@@b A@) \fA@:y A@@} A@)bЎ !\"A֎!! \f\f!\f!A@\f!8!\"$%&'!p= !%!& `%&L!  \" !!*)*=)*{\"02!=0)*\"  {2!>Z2!>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)!=@)=  AA o W Z$  m Y ZT$)A@: A@@ A@)= $A@: A@@ A@)b$=$`\\ƥWڂI=8`X8I=I`YI	u=\\m\\u`=kmbݏ)=`=`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 goal (byte-code "	`Z_V \f\"  `\f[\"	`Z_V( ) `b)" [direction goal 0 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 (#$ . 8773)])
#@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 (#$ . 11347) "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 (#$ . 11600) "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 (#$ . 11857)])
#@42 Remove the overlay for a lost selection.
(defalias 'mouse-sel-lost-selection-hook #[(selection) "	!\n!)" [mouse-sel-selection-overlay selection overlay delete-overlay] 2 (#$ . 12202)])
(byte-code "\"K !!!\"\"!!!\"\"=F \"\"Bׇ" [add-hook x-lost-selection-hooks mouse-sel-lost-selection-hook 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ѯ	#" [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-yank-at-point] 12 (#$ . 13067) nil])
