;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:52:17 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/term/sun-mouse.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; 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 "`sun-mouse.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#@113 *Number of milliseconds to wait for an extra click.
Set this to zero if you don't want chords or double clicks.
(defvar extra-click-wait 150 (#$ . -626))
#@264 *The character width of the scrollbar.
The cursor is deemed to be in the right edge scrollbar if it is this near the
right edge, and more than two chars past the end of the indicated line.
Setting to nil limits the scrollbar to the edge or vertical dividing bar.
(defvar scrollbar-width 5 (#$ . -787))
#@25 Returns a new mousemap.
(defalias 'make-mousemap #[nil "\300\301B\207" [mousemap nil] 2 (#$ . 1095)])
#@28 Return a copy of mousemap.
(defalias 'copy-mousemap #[(mousemap) "\301!\207" [mousemap copy-alist] 2 (#$ . 1203)])
#@736 Args MOUSEMAP, MOUSE-LIST, DEF.  Define MOUSE-LIST in MOUSEMAP as DEF.
MOUSE-LIST is a list of atoms specifying a mouse hit according to these rules:
  * One of these atoms specifies the active region of the definition.
	text, scrollbar, modeline, minibuffer
  * One or two or these atoms specify the button or button combination.
        left, middle, right, double
  * Any combination of these atoms specify the active shift keys.
        control, shift, meta
  * With a single unshifted button, you can add
	up
    to indicate an up-click.
The atom `double' is used with a button designator to denote a double click.
Two button chords are denoted by listing the two buttons.
See sun-mouse-handler for the treatment of the form DEF.
(defalias 'define-mouse #[(mousemap mouse-list def) "\303\304!	\n#\207" [mouse-list mousemap def mousemap-set mouse-list-to-mouse-code] 4 (#$ . 1326)])
#@259 Give MOUSE-EVENT-LIST a local definition of DEF.
See define-mouse for a description of MOUSE-EVENT-LIST and DEF.
Note that if MOUSE-EVENT-LIST has a local definition in the current buffer,
that local definition will continue to shadow any global definition.
(defalias 'global-set-mouse #[(mouse-list def) "\303	\n#\207" [current-global-mousemap mouse-list def define-mouse] 4 (#$ . 2221) "xMouse event: \nxDefinition: "])
#@227 Give MOUSE-EVENT-LIST a local definition of DEF.
See define-mouse for a description of the arguments.
The definition goes in the current buffer's local mousemap.
Normally buffers in the same major mode share a local mousemap.
(defalias 'local-set-mouse #[(mouse-list def) "\204 \303 \304	\n#\207" [current-local-mousemap mouse-list def make-mousemap define-mouse] 4 (#$ . 2651) "xMouse event: \nxDefinition: "])
#@42 Selects MOUSEMAP as the global mousemap.
(defalias 'use-global-mousemap #[(mousemap) "\211\207" [mousemap current-global-mousemap] 2 (#$ . 3073)])
#@83 Selects MOUSEMAP as the local mousemap.
nil for MOUSEMAP means no local mousemap.
(defalias 'use-local-mousemap #[(mousemap) "\211\207" [mousemap current-local-mousemap] 2 (#$ . 3228)])
#@99 True if any bits set in X are also set in Y.
Just like the Common Lisp function of the same name.
(defalias 'logtest #[(x y) "\302\303	\"!?\207" [x y zerop logand] 4 (#$ . 3422)])
(byte-code "\301B\305\302B\306\303B\307\304B\310\301\207" [current-load-list sm::ButtonBits sm::ShiftmaskBits sm::DoubleBits sm::UpBits 7 56 64 128] 2)
(defalias 'sm::hit-code '(macro . #[(hit) "\301\302E\207" [hit nth 0] 3]))
(defalias 'sm::hit-button '(macro . #[(hit) "\301\302\303\304EE\207" [hit logand sm::ButtonBits nth 0] 5]))
(defalias 'sm::hit-shiftmask '(macro . #[(hit) "\301\302\303\304EE\207" [hit logand sm::ShiftmaskBits nth 0] 5]))
(defalias 'sm::hit-double '(macro . #[(hit) "\301\302\303\304EE\207" [hit logand sm::DoubleBits nth 0] 5]))
(defalias 'sm::hit-up '(macro . #[(hit) "\301\302\303\304EE\207" [hit logand sm::UpBits nth 0] 5]))
(defalias 'sm::hit-x '(macro . #[(hit) "\301\302E\207" [hit nth 1] 3]))
(defalias 'sm::hit-y '(macro . #[(hit) "\301\302E\207" [hit nth 2] 3]))
(defalias 'sm::hit-delta '(macro . #[(hit) "\301\302E\207" [hit nth 3] 3]))
(defalias 'sm::hit-up-p '(macro . #[(hit) "\301\302\303DDD\207" [hit not zerop sm::hit-up] 4]))
(defalias 'sm::loc-w '(macro . #[(loc) "\301\302E\207" [loc nth 0] 3]))
(defalias 'sm::loc-x '(macro . #[(loc) "\301\302E\207" [loc nth 1] 3]))
(defalias 'sm::loc-y '(macro . #[(loc) "\301\302E\207" [loc nth 2] 3]))
#@75 Macro to switches to BUFFER, evaluates FORMS, returns to original buffer.
(defalias 'eval-in-buffer '(macro . #[(buffer &rest forms) "\302\303\304\305\306D	BB\307BBE\207" [buffer forms let ((StartBuffer (current-buffer))) unwind-protect progn set-buffer ((set-buffer StartBuffer))] 6 (#$ . 4822)]))
(put 'eval-in-buffer 'lisp-indent-function 1)
#@62 Switch to WINDOW, evaluate FORMS, return to original window.
(defalias 'eval-in-window '(macro . #[(window &rest forms) "\302\303\304\305\306D	BB\307BBE\207" [window forms let ((OriginallySelectedWindow (selected-window))) unwind-protect progn select-window ((select-window OriginallySelectedWindow))] 6 (#$ . 5174)]))
(put 'eval-in-window 'lisp-indent-function 1)
#@170 Switches to each window and evaluates FORM.  Optional argument
YESMINI says to include the minibuffer as a window.
This is a macro, and does not evaluate its arguments.
(defalias 'eval-in-windows '(macro . #[(form &optional yesmini) "\302\303\304\305\306\307\310\311\312\313\314	EDEDED\315BBE\207" [form yesmini let ((OriginallySelectedWindow (selected-window))) unwind-protect while progn not eq OriginallySelectedWindow select-window next-window nil ((select-window OriginallySelectedWindow))] 13 (#$ . 5547)]))
(put 'eval-in-window 'lisp-indent-function 0)
#@97 Move cursor to window location X, Y.
Handles wrapped and horizontally scrolled lines correctly.
(defalias 'move-to-loc #[(x y) "\304!\210i\305\306\307 !\203 i\310 \311Z	^\\\202\" \307 \310 S	^\\\312\\!\nZ*\207" [y x nc cc move-to-window-line move-to-column zerop window-hscroll window-width 2 -1] 5 (#$ . 6114)])
#@37 True iff this WINDOW is minibuffer.
(defalias 'minibuffer-window-p #[(window) "\301 \302\303!8U\207" [window frame-height 3 window-edges] 4 (#$ . 6438)])
#@482 Evaluates the function or list associated with a mouse hit.
Expecting to read a hit, which is a list: (button x y delta).  
A form bound to button by define-mouse is found by mouse-lookup. 
The variables: *mouse-window*, *mouse-x*, *mouse-y* are bound.  
If the form is a symbol (symbolp), it is funcall'ed with *mouse-window*,
*mouse-x*, and *mouse-y* as arguments; if the form is a list (listp),
the form is eval'ed; if the form is neither of these, it is an error.
Returns nil.
(defalias 'sun-mouse-handler #[(&optional hit) "\204 \306 \307A@\3108\"\211@	A@\310	8\311	\"p\312\216\313!q\210\314\n!*\211\204K \315\316@\"!\203x \317\320\321\322\n!!\"\210\202x 9\203_ \f#\210\202x <\203r @\323!\210\202x \317\324\"\210.\325=\203\205 \326\207" [hit loc mouse-code *mouse-y* *mouse-x* *mouse-window* sm::combined-hits sm::window-xy 2 mouse-event-code ((set-buffer StartBuffer)) window-buffer mouse-lookup zerop logand error "Undefined mouse event: %s" prin1-to-string mouse-code-to-mouse-list eval "Mouse action must be symbol or list, but was: %s" sun-mouse-handler nil StartBuffer form sm::UpBits this-command last-command] 7 (#$ . 6600) nil])
#@63 Read and return next mouse-hit, include possible double click
(defalias 'sm::combined-hits #[nil "\306 \307\310	@\"!\2032 \311\n!\211\2031 \312@@\310\f@\"\310\f@\"U\203- \202. \313#\240\210))\207" [hit1 sm::UpBits extra-click-wait hit2 sm::ButtonBits sm::DoubleBits mouse-hit-read zerop logand mouse-second-hit logior 0] 9 (#$ . 7795)])
#@114 Read mouse-hit list from keyboard.  Like (read 'read-char),
but that uses minibuffer, and mucks up last-command.
(defalias 'mouse-hit-read #[nil "\302\211\303 \211\211	B\304\232\203 \305\306\307	\237\310#!*\207" [char char-list nil read-char 13 read mapconcat char-to-string ""] 5 (#$ . 8149)])
#@71 First char of mouse-prefix.  Used to detect double clicks and chords.
(defvar mouse-prefix1 24 (#$ . 8455))
#@72 Second char of mouse-prefix.  Used to detect double clicks and chords.
(defvar mouse-prefix2 0 (#$ . 8569))
#@68 Returns the next mouse hit occurring within HIT-WAIT milliseconds.
(defalias 'mouse-second-hit #[(hit-wait) "\306!?\205P \307 \211\n\232\203 \306\310!\203 	C\311\202O \307 \211\232\2040 	C\312 \210\311\202N \313 \314\315@\"!\204K \316\3108Z!\202M )))\207" [hit-wait pc1 mouse-prefix1 unread-command-events pc2 mouse-prefix2 sit-for-millisecs read-char 3 nil ding mouse-hit-read zerop logand mouse-second-hit new-hit sm::UpBits] 5 (#$ . 8683)])
#@116 Find window containing screen coordinates X and Y.
Returns list (window x y) where x and y are relative to window.
(defalias 'sm::window-xy #[(x y) "\302\303\215\206\n \304	E\207" [x y found (byte-code "\306 \307\216\310\306 !\211@	A@\311	8\312	8\313 U\203# T\n\314 U\203- \nTY\203X W\203X \fY\203X \nW\203X \315\316\306 Z\fZE\"\210-\317\320\321\322\"!=?\205h \202 *\207" [OriginallySelectedWindow we be re te le selected-window ((select-window OriginallySelectedWindow)) window-edges 2 3 frame-width frame-height throw found select-window next-window nil t x y] 7) nil] 3 (#$ . 9153)])
#@85 Parse LOC into a region symbol.
Returns one of (text scrollbar modeline minibuffer)
(defalias 'sm::window-region #[(loc) "@A@\3068\307!S\310!S\311!\203 \312\202R 	\fY\203) \313\202R \nY\2033 \314\202R \203Q \nZY\203Q \n\315\n	#\306\\Y\203Q \314\202R \316-\207" [loc y x w bottom right 2 window-width window-height minibuffer-window-p minibuffer modeline scrollbar window-line-end text scrollbar-width] 5 (#$ . 9774)])
#@58 Return WINDOW column (ignore X) containing end of line Y
(defalias 'window-line-end #[(w x y) "\303 \304\216\305	!\210\212\306\307 \n\"+\207" [OriginallySelectedWindow w y selected-window ((select-window OriginallySelectedWindow)) select-window move-to-loc frame-width] 3 (#$ . 10217)])
(byte-code "\301B\302\301\207" [current-load-list sm::keyword-alist ((left . 1) (middle . 2) (right . 4) (shift . 8) (control . 16) (meta . 32) (double . 64) (up . 128) (text . 256) (scrollbar . 512) (modeline . 1024) (minibuffer . 2048))] 2)
#@43 Maps MOUSE-HIT and LOC into a mouse-code.
(defalias 'mouse-event-code #[(hit loc) "\302@\303\304	!!\"\207" [hit loc logior mouse-region-to-code sm::window-region] 5 (#$ . 10757)])
#@50 Returns partial mouse-code for specified REGION.
(defalias 'mouse-region-to-code #[(region) "	\236A\207" [region sm::keyword-alist] 2 (#$ . 10944)])
#@35 Map a MOUSE-LIST to a mouse-code.
(defalias 'mouse-list-to-mouse-code #[(mouse-list) "\301\302\303\304\"\"\207" [mouse-list apply logior mapcar #[(x) "	\236A\207" [x sm::keyword-alist] 2]] 5 (#$ . 11100)])
#@35 Map a MOUSE-CODE to a mouse-list.
(defalias 'mouse-code-to-mouse-list #[(mouse-code) "\301\302\303\304\"\"\207" [sm::keyword-alist apply nconc mapcar #[(x) "\302	A\"\205 	@C\207" [mouse-code x logtest] 3]] 5 (#$ . 11314)])
(defalias 'mousemap-set #[(code mousemap value) "A\n	\236\211\203 \f\241\202 \n\fB	B\241*\207" [mousemap alist code assq-result value] 4])
(defalias 'mousemap-get #[(code mousemap) "	A\236A\207" [code mousemap] 2])
#@69 Look up MOUSE-EVENT and return the definition. nil means undefined.
(defalias 'mouse-lookup #[(mouse-code) "\303	\"\206 \303\n\"\207" [mouse-code current-local-mousemap current-global-mousemap mousemap-get] 3 (#$ . 11769)])
#@141 Args MASK (a bit mask) and LIST (a list of (code . form) pairs).
Returns a list of elements of LIST whose code or'ed with MASK is non-zero.
(defalias 'mouse-mask-lookup #[(mask list) "\303	\203 \304\n	@@\"\203 	@B	A\211\204 )\207" [result list mask nil logtest] 4 (#$ . 12003)])
#@126 Return the union of list of mouse (code . form) pairs L and L-UNIQUE,
where L-UNIQUE is considered to be union'ized already.
(defalias 'mouse-union #[(l l-unique) "\n\203 \n@\211@	\236\204 	B)\nA\211\204 	)\207" [l-unique result l code-form-pair] 3 (#$ . 12297)])
#@129 Return the union of lists of mouse (code . form) pairs L1 and L2,
based on the code's, with preference going to elements in L1.
(defalias 'mouse-union-first-preferred #[(l1 l2) "\302\302	\303\"\"\207" [l2 l1 mouse-union nil] 5 (#$ . 12577)])
#@91 Return a list of (code . function) pairs, where each code is
currently set in the REGION.
(defalias 'mouse-code-function-pairs-of-region #[(region) "\304!\305\306	\nA\"\306	A\"\")\207" [region mask current-local-mousemap current-global-mousemap mouse-region-to-code mouse-union-first-preferred mouse-mask-lookup] 5 (#$ . 12826)])
#@143 Returns first line of documentation string for FUNCTION.
If there is no documentation string, then the string
"No documentation" is returned.
(defalias 'one-line-doc-string #[(function) ":\203\f @\211\202 \302!\211\204 \303\202\" \304\305	\"\210	\306\211\225O)\207" [function doc documentation "No documentation." string-match "^.*$" 0] 4 (#$ . 13166)])
(defalias 'print-mouse-format #[(binding) "\301@!\210\301\302!\210\303\304A\"\210\305 \210\301\306!\210\301\307@!!\210\305 \207" [binding princ ": " mapcar #[(mouse-list) "\301!\210\301\302!\207" [mouse-list princ " "] 2] terpri "  " one-line-doc-string] 3])
#@41 Prints mouse-event bindings for REGION.
(defalias 'print-mouse-bindings #[(region) "\301\302\303!\"\207" [region mapcar print-mouse-format sm::event-bindings] 4 (#$ . 13796)])
#@134 Returns an alist of (function . (mouse-list1 ... mouse-listN)) for REGION,
where each mouse-list is bound to the function in REGION.
(defalias 'sm::event-bindings #[(region) "\305!\306\211\2037 \n@\307A	\"\211\203$ \f\310@!\fAB\241\210\202/ A\310@!CB	B*\nA\211\204\n 	*\207" [region result mouse-bindings code-function-pair current-entry mouse-code-function-pairs-of-region nil assoc mouse-code-to-mouse-list] 4 (#$ . 13980)])
#@41 Lists all current mouse-event bindings.
(defalias 'describe-mouse-bindings #[nil "\300\220\301\302!\210\303 \210\301\304!\210\303 \210\305\306!\210\303 \210\301\307!\210\303 \210\301\310!\210\303 \210\305\311!\210\303 \210\301\312!\210\303 \210\301\313!\210\303 \210\305\314!\221\207" ["*Help*" princ "Text Region" terpri "---- ------" print-mouse-bindings text "Modeline Region" "-------- ------" modeline "Scrollbar Region" "--------- ------" scrollbar] 3 (#$ . 14424) nil])
#@64 Print a short description of the function bound to MOUSE-LIST.
(defalias 'describe-mouse-briefly #[(mouse-list) "\302\303!!\211\203 \304\305	#\202 \304\306\")\207" [mouse-list function mouse-lookup mouse-list-to-mouse-code message "%s runs the command %s" "%s is undefined"] 5 (#$ . 14907) "xDescribe mouse list briefly: "])
(defalias 'mouse-help-menu #[(function-and-binding) "\301@!\302\303@!C\301A!CD!B\207" [function-and-binding prin1-to-string menu-create one-line-doc-string] 5])
#@61 Displays a menu of mouse functions callable in this region.
(defalias 'mouse-help-region #[(w x y &optional region) "\206\n \306	\nE!\307\310\311!\"\312\313!C\fB!\314	\315$\210+\316\207" [region w x y mlist menu sm::window-region mapcar mouse-help-menu sm::event-bindings menu-create symbol-name sun-menu-evaluate 0 nil] 5 (#$ . 15408)])
#@106 Functional form for defmenu, given a list of ITEMS returns a menu.
Each ITEM is a (STRING . VALUE) pair.
(defalias 'menu-create #[(items) "\301\302\"\207" [items apply vector] 3 (#$ . 15762)])
#@117 Defines MENU to be a menu, the ITEMS are (STRING . VALUE) pairs.
See sun-menu-evaluate for interpretation of ITEMS.
(defalias 'defmenu '(macro . #[(menu &rest itemlist) "\302\303	!E\207" [menu itemlist defconst menu-create] 4 (#$ . 15963)]))
#@629 Display a pop-up menu in WINDOW at X Y and evaluate selected item
of MENU.  MENU (or its symbol-value) should be a menu defined by defmenu.
  A menu ITEM is a (STRING . FORM) pair;
the FORM associated with the selected STRING is evaluated,
and the resulting value is returned.  Generally these FORMs are
evaluated for their side-effects rather than their values.
  If the selected form is a menu or a symbol whose value is a menu, 
then it is displayed and evaluated as a pullright menu item.
  If the FORM of the first ITEM is nil, the STRING of the item is
used as a label for the menu, i.e. it's inverted and not selectable.
(defalias 'sun-menu-evaluate #[(*menu-window* *menu-x* *menu-y* menu) "9\203 J\304\305	\n\306%!\207" [menu *menu-window* *menu-x* *menu-y* eval sun-menu-internal 4] 7 (#$ . 16213)])
#@266 Sends the tty-sub-window escape sequence CODE to terminal,
and returns a cons of the two numbers in returned escape sequence.
That is it returns (cons <car> <cdr>) from "\E[n;<car>;<cdr>t". 
CODE values: 13 = Tool-Position, 14 = Size-in-Pixels, 18 = Size-in-Chars.
(defalias 'sun-get-frame-data #[(code) "\305\306\307!\310Q!\210\311\211\211\211\312 \211\313\232\204! \fB\202 \314\315\237\316#\317\320\"\210\321\224T\321\225O\321\225\311O\317\320\"\210\321\224T\321\225O\322	!\322\n!,B\207" [code y x str char send-string-to-terminal "[" int-to-string "t" nil read-char 116 mapconcat char-to-string "" string-match ";[0-9]*" 0 string-to-int] 4 (#$ . 17036)])
#@49 Returns font size in pixels: (cons Ysize Xsize)
(defalias 'sm::font-size #[nil "\302\303!\302\304!\211@@\245	AA\245*B\207" [chr pix sun-get-frame-data 14 18] 4 (#$ . 17720)])
#@53 Cached frame-to-window X-Offset for sm::menu-kludge
(defvar sm::menu-kludge-x nil (#$ . 17905))
#@53 Cached frame-to-window Y-Offset for sm::menu-kludge
(defvar sm::menu-kludge-y nil (#$ . 18007))
#@65 If sunfns.c uses <Menu_Base_Kludge> this function must be here!
(defalias 'sm::menu-kludge #[nil "\204 \304 \211@\305\\\306)\307\310!\211@\\A\n\\)B\207" [sm::menu-kludge-y fs sm::menu-kludge-x wl sm::font-size 8 4 sun-get-frame-data 13] 4 (#$ . 18109)])
#@119 Set mark and yank the contents of the current sunwindows selection.
Insert contents into the current buffer at point.
(defalias 'sun-yank-selection #[nil "\300\301!\210\302\303 !\207" [set-mark-command nil insert-string sun-get-selection] 2 (#$ . 18378) "*"])
#@67 Set the sunwindows selection to the region in the current buffer.
(defalias 'sun-select-region #[(beg end) "\302	{!\207" [beg end sun-set-selection] 3 (#$ . 18644) "r"])
#@174 Suspend emacstool.
If running under as a detached process emacstool,
you don't want to suspend  (there is no way to resume), 
just close the window, and wait for reopening.
(defalias 'suspend-emacstool #[(&optional stuffstring) "\301\302!\210\203\f \303!\210\303\304!\210\301\305!\207" [stuffstring run-hooks suspend-hook send-string-to-terminal "[2t" suspend-resume-hook] 2 (#$ . 18822) nil])
(byte-code "\302\303!\210\304\303\305\"\210\301B\306\301!\204 \307 \310\311!\210\310\312!\207" [current-load-list current-global-mousemap make-variable-buffer-local current-local-mousemap set-default nil boundp make-mousemap provide sun-mouse term/sun-mouse] 3)
