;ELC ;;; compiled by rms@churchy.gnu.ai.mit.edu on Thu Apr 20 22:08:10 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/term/sun-mouse.el ;;; emacs version 19.28.90.4. ;;; 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/term/sun-mouse.el' was compiled for Emacs 19")) #@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 (#$ . -500)) #@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 (#$ . -661)) #@25 Returns a new mousemap. (defalias 'make-mousemap #[nil "ÀÁB‡" [mousemap nil] 2 (#$ . 969)]) #@28 Return a copy of mousemap. (defalias 'copy-mousemap #[(mousemap) "À !‡" [copy-alist mousemap] 2 (#$ . 1067)]) #@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) "ÀÁ\n! \f#‡" [mousemap-set mouse-list-to-mouse-code mouse-list mousemap def] 4 (#$ . 1184)]) #@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) "À \n #‡" [define-mouse current-global-mousemap mouse-list def] 4 (#$ . 2071) "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) "„Á  \f#‡" [current-local-mousemap make-mousemap define-mouse mouse-list def] 4 (#$ . 2495) "xMouse event: \nxDefinition: "]) #@42 Selects MOUSEMAP as the global mousemap. (defalias 'use-global-mousemap #[(mousemap) "‰‡" [mousemap current-global-mousemap] 2 (#$ . 2905)]) #@83 Selects MOUSEMAP as the local mousemap. nil for MOUSEMAP means no local mousemap. (defalias 'use-local-mousemap #[(mousemap) "‰‡" [mousemap current-local-mousemap] 2 (#$ . 3054)]) #@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) "À \n\"ÃU?‡" [logand x y 0] 3 (#$ . 3242)]) (byte-code "ÀÁ\nBÃÄ\nBÅÆ\nBÇÈ\nBÀ‡" [7 sm::ButtonBits current-load-list 56 sm::ShiftmaskBits 64 sm::DoubleBits 128 sm::UpBits] 2) (defalias 'sm::hit-code '(macro . #[(hit) "ÀÁ\nE‡" [nth 0 hit] 3])) (defalias 'sm::hit-button '(macro . #[(hit) "ÀÁÂÃ\fEE‡" [logand sm::ButtonBits nth 0 hit] 5])) (defalias 'sm::hit-shiftmask '(macro . #[(hit) "ÀÁÂÃ\fEE‡" [logand sm::ShiftmaskBits nth 0 hit] 5])) (defalias 'sm::hit-double '(macro . #[(hit) "ÀÁÂÃ\fEE‡" [logand sm::DoubleBits nth 0 hit] 5])) (defalias 'sm::hit-up '(macro . #[(hit) "ÀÁÂÃ\fEE‡" [logand sm::UpBits nth 0 hit] 5])) (defalias 'sm::hit-x '(macro . #[(hit) "ÀÁ\nE‡" [nth 1 hit] 3])) (defalias 'sm::hit-y '(macro . #[(hit) "ÀÁ\nE‡" [nth 2 hit] 3])) (defalias 'sm::hit-delta '(macro . #[(hit) "ÀÁ\nE‡" [nth 3 hit] 3])) (defalias 'sm::hit-up-p '(macro . #[(hit) "ÀÁ DDD‡" [not zerop sm::hit-up hit] 4])) (defalias 'sm::loc-w '(macro . #[(loc) "ÀÁ\nE‡" [nth 0 loc] 3])) (defalias 'sm::loc-x '(macro . #[(loc) "ÀÁ\nE‡" [nth 1 loc] 3])) (defalias 'sm::loc-y '(macro . #[(loc) "ÀÁ\nE‡" [nth 2 loc] 3])) #@75 Macro to switches to BUFFER, evaluates FORMS, returns to original buffer. (defalias 'eval-in-buffer '(macro . #[(buffer &rest forms) "ÀÁÂÃÄ DBBÇBBE‡" [let ((StartBuffer (current-buffer))) unwind-protect progn set-buffer buffer forms ((set-buffer StartBuffer))] 6 (#$ . 4482)])) (put (quote eval-in-buffer) (quote lisp-indent-function) 1) #@62 Switch to WINDOW, evaluate FORMS, return to original window. (defalias 'eval-in-window '(macro . #[(window &rest forms) "ÀÁÂÃÄ DBBÇBBE‡" [let ((OriginallySelectedWindow (selected-window))) unwind-protect progn select-window window forms ((select-window OriginallySelectedWindow))] 6 (#$ . 4828)])) (put (quote eval-in-window) (quote 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) "ÀÁÂÃÄ ÆÇÈÉÊË\fEDEDEDÍBBE‡" [let ((OriginallySelectedWindow (selected-window))) unwind-protect while progn form not eq OriginallySelectedWindow select-window next-window nil yesmini ((select-window OriginallySelectedWindow))] 13 (#$ . 5195)])) (put (quote eval-in-window) (quote 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) "À !ˆiÂà ÄUƒiÅ ÆZ^\\‚$à ŠS^È\\\\! \n \nZ*‡" [move-to-window-line y move-to-column window-hscroll 0 window-width 2 x -1 nc cc] 5 (#$ . 5739)]) #@37 True iff this WINDOW is minibuffer. (defalias 'minibuffer-window-p #[(window) "À Á !8U‡" [frame-height 3 window-edges window] 4 (#$ . 6026)]) #@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) "„Á ÂA@Ã8\"‰@\fA@Ã\f8Å\f\" p\nËŽÌ !qˆÍ!*‰„RÏ@\"ÑUƒ‚ÒÓÔÕ!!\"ˆ‚‚9ƒi #ˆ‚‚<ƒ|@×!ˆ‚‚ÒØ\"ˆ.Ù=ƒÛ‡" [hit sm::combined-hits sm::window-xy 2 loc mouse-event-code mouse-code *mouse-y* *mouse-x* *mouse-window* StartBuffer ((set-buffer StartBuffer)) window-buffer mouse-lookup form logand sm::UpBits 0 error "Undefined mouse event: %s" prin1-to-string mouse-code-to-mouse-list this-command eval "Mouse action must be symbol or list, but was: %s" sun-mouse-handler last-command nil] 7 (#$ . 6176) nil]) #@63 Read and return next mouse-hit, include possible double click (defalias 'sm::combined-hits #[nil "À  @\"ÄUƒ9Å!‰ƒ8 È @@ @\" @\"Uƒ4\n‚5Ä# ˆ) )‡" [mouse-hit-read hit1 logand sm::UpBits 0 mouse-second-hit extra-click-wait hit2 logior sm::ButtonBits sm::DoubleBits] 9 (#$ . 7264)]) #@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 "À‰à ‰‰\nBÄšƒÅÆÇ\nŸÈ#!*‡" [nil char char-list read-char 13 read mapconcat char-to-string ""] 5 (#$ . 7569)]) #@71 First char of mouse-prefix. Used to detect double clicks and chords. (defvar mouse-prefix1 24 (#$ . 7835)) #@72 Second char of mouse-prefix. Used to detect double clicks and chords. (defvar mouse-prefix2 0 (#$ . 7949)) #@68 Returns the next mouse hit occurring within HIT-WAIT milliseconds. (defalias 'mouse-second-hit #[(hit-wait) "À !?…T ‰\fšƒÀÅ!ƒ CÇ‚S ‰ š„4 CÊ ˆÇ‚RË \fÍ\f@\"ÏU„OÐ Å\f8Z!‚Q\f)))‡" [sit-for-millisecs hit-wait read-char pc1 mouse-prefix1 3 unread-command-events nil pc2 mouse-prefix2 ding mouse-hit-read new-hit logand sm::UpBits 0 mouse-second-hit] 5 (#$ . 8063)]) #@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) "ÀÁ†\n \fE‡" [found (byte-code "À ÂŽÃÀ !‰@\fA@Å\f8Æ\f8 \nË Uƒ*TÌ Uƒ7T \nYƒh Wƒh YƒhWƒhÏÐÀ  \nZ ZE\"ˆ- ÑÒÓÔ\"!=?…x‚*‡" [selected-window OriginallySelectedWindow ((select-window OriginallySelectedWindow)) window-edges we 2 3 be re te le frame-width frame-height x y throw found select-window next-window nil t] 7) nil x y] 3 (#$ . 8456)]) #@85 Parse LOC into a region symbol. Returns one of (text scrollbar modeline minibuffer) (defalias 'sm::window-region #[(loc) "@A@Á8Å\f!SÆ\f!SÉ\f!ƒ!Ê‚W\nYƒ,Ë‚W Yƒ7Ì‚W ƒV  ZYƒV Î\f \n#Á\\YƒVÌ‚WÏ-‡" [loc 2 y x w window-width window-height bottom right minibuffer-window-p minibuffer modeline scrollbar scrollbar-width window-line-end text] 5 (#$ . 8996)]) #@58 Return WINDOW column (ignore X) containing end of line Y (defalias 'window-line-end #[(w x y) "À ÂŽÃ\f!ˆŠÅÆ \"+‡" [selected-window OriginallySelectedWindow ((select-window OriginallySelectedWindow)) select-window w move-to-loc frame-width y] 3 (#$ . 9379)]) (byte-code "ÀÁ\nBÁ‡" [((left . 1) (middle . 2) (right . 4) (shift . 8) (control . 16) (meta . 32) (double . 64) (up . 128) (text . 256) (scrollbar . 512) (modeline . 1024) (minibuffer . 2048)) sm::keyword-alist current-load-list] 2) #@43 Maps MOUSE-HIT and LOC into a mouse-code. (defalias 'mouse-event-code #[(hit loc) "À @ÂÃ\f!!\"‡" [logior hit mouse-region-to-code sm::window-region loc] 5 (#$ . 9881)]) #@50 Returns partial mouse-code for specified REGION. (defalias 'mouse-region-to-code #[(region) " žA‡" [region sm::keyword-alist] 2 (#$ . 10056)]) #@35 Map a MOUSE-LIST to a mouse-code. (defalias 'mouse-list-to-mouse-code #[(mouse-list) "ÀÁÂÃ\f\"\"‡" [apply logior mapcar #[(x) " žA‡" [x sm::keyword-alist] 2] mouse-list] 5 (#$ . 10206)]) #@35 Map a MOUSE-CODE to a mouse-list. (defalias 'mouse-code-to-mouse-list #[(mouse-code) "ÀÁÂÃ\f\"\"‡" [apply nconc mapcar #[(x) "À \nA\"… \n@C‡" [logtest mouse-code x] 3] sm::keyword-alist] 5 (#$ . 10400)]) (defalias 'mousemap-set #[(code mousemap value) "A\n ž‰ƒ \f¡‚\n\fB B¡*‡" [mousemap alist code assq-result value] 4]) (defalias 'mousemap-get #[(code mousemap) " AžA‡" [code mousemap] 2]) #@69 Look up MOUSE-EVENT and return the definition. nil means undefined. (defalias 'mouse-lookup #[(mouse-code) "À \n\"† À \"‡" [mousemap-get mouse-code current-local-mousemap current-global-mousemap] 3 (#$ . 10807)]) #@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) "À\nƒÃ\f\n@@\"ƒ\n@ B\nA‰„ )‡" [nil result list logtest mask] 4 (#$ . 11029)]) #@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ƒ\n@‰@ ž„ B)\nA‰„ )‡" [l-unique result l code-form-pair] 3 (#$ . 11306)]) #@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) "À À\nÃ\"\"‡" [mouse-union l2 l1 nil] 5 (#$ . 11565)]) #@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) "À !ÃÄ\n A\"Ä\nA\"\")‡" [mouse-region-to-code region mask mouse-union-first-preferred mouse-mask-lookup current-local-mousemap current-global-mousemap] 5 (#$ . 11803)]) #@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) ":ƒ\f@‰‚Á!‰„Â\"ÄÅ\n\"ˆ\nƉ•O)‡" [function documentation doc "No documentation." string-match "^.*$" 0] 4 (#$ . 12130)]) (defalias 'print-mouse-format #[(binding) "À @!ˆÀÂ!ˆÃÄ A\"ˆÅ ˆÀÆ!ˆÀÇ @!!ˆÅ ‡" [princ binding ": " mapcar #[(mouse-list) "À !ˆÀÂ!‡" [princ mouse-list " "] 2] terpri " " one-line-doc-string] 3]) #@41 Prints mouse-event bindings for REGION. (defalias 'print-mouse-bindings #[(region) "ÀÁ !\"‡" [mapcar print-mouse-format sm::event-bindings region] 4 (#$ . 12648)]) #@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) "À !‰ƒ:\f@Æ A \"‰ƒ'È @!AB¡ˆ‚2 AÈ @!CB B*\fA‰„\n *‡" [mouse-code-function-pairs-of-region region nil result mouse-bindings code-function-pair assoc current-entry mouse-code-to-mouse-list] 4 (#$ . 12820)]) #@41 Lists all current mouse-event bindings. (defalias 'describe-mouse-bindings #[nil "ÀÁÂ!ˆÃ ˆÁÄ!ˆÃ ˆÅÆ!ˆÃ ˆÁÇ!ˆÃ ˆÁÈ!ˆÃ ˆÅÉ!ˆÃ ˆÁÊ!ˆÃ ˆÁË!ˆÃ ˆÅÌ!‘‡" ["*Help*" princ "Text Region" terpri "---- ------" print-mouse-bindings text "Modeline Region" "-------- ------" modeline "Scrollbar Region" "--------- ------" scrollbar] 3 (#$ . 13220) nil]) #@64 Print a short description of the function bound to MOUSE-LIST. (defalias 'describe-mouse-briefly #[(mouse-list) "ÀÁ\n!!‰ƒÄÅ\n #‚ÄÆ\n\")‡" [mouse-lookup mouse-list-to-mouse-code mouse-list function message "%s runs the command %s" "%s is undefined"] 5 (#$ . 13565) "xDescibe mouse list briefly: "]) (defalias 'mouse-help-menu #[(function-and-binding) "À @!Âà @!CÀ A!CD!B‡" [prin1-to-string function-and-binding 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) "†\nÁ\n \fE!ÅÆÇ!\"ÉÊ!CB! Ì\nÍ\f $ˆ+·" [region sm::window-region w x y mapcar mouse-help-menu sm::event-bindings mlist menu-create symbol-name menu sun-menu-evaluate 0 nil] 5 (#$ . 14023)]) #@106 Functional form for defmenu, given a list of ITEMS returns a menu. Each ITEM is a (STRING . VALUE) pair. (defalias 'menu-create #[(items) "ÀÁ\n\"‡" [apply vector items] 3 (#$ . 14347)]) #@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) "À  !E‡" [defconst menu menu-create itemlist] 4 (#$ . 14540)])) #@633 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 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ƒJÁ \f Æ%!‡" [menu eval sun-menu-internal *menu-window* *menu-x* *menu-y* 4] 7 (#$ . 14781)]) #@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 ) from "\E[n;;t". CODE values: 13 = Tool-Position, 14 = Size-in-Pixels, 18 = Size-in-Chars. (defalias 'sun-get-frame-data #[(code) "ÀÁ !ÄQ!ˆÅ‰‰‰ Ê ‰ Ëš„) B‚ÌÍŸÎ#ÏÐ\"ˆÑ”TÑ•OÑ•ÅOÏÐ\"ˆÑ”TÑ•OÒ!Ò!,B‡" [send-string-to-terminal "[" int-to-string code "t" nil y x str char read-char 116 mapconcat char-to-string "" string-match ";[0-9]*" 0 string-to-int] 4 (#$ . 15593)]) #@49 Returns font size in pixels: (cons Ysize Xsize) (defalias 'sm::font-size #[nil "ÀÁ!ÀÂ!‰@ @¥\fA A¥*B‡" [sun-get-frame-data 14 18 chr pix] 4 (#$ . 16178)]) #@53 Cached frame-to-window X-Offset for sm::menu-kludge (defvar sm::menu-kludge-x nil (#$ . 16340)) #@53 Cached frame-to-window Y-Offset for sm::menu-kludge (defvar sm::menu-kludge-y nil (#$ . 16442)) #@65 If sunfns.c uses this function must be here! (defalias 'sm::menu-kludge #[nil "„Á ‰@Ã\\Ä)ÆÇ!‰@\\A \\)B‡" [sm::menu-kludge-y sm::font-size fs 8 4 sm::menu-kludge-x sun-get-frame-data 13 wl] 4 (#$ . 16544)]) #@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 "ÀÁ!ˆÂà !‡" [set-mark-command nil insert-string sun-get-selection] 2 (#$ . 16787) "*"]) #@67 Set the sunwindows selection to the region in the current buffer. (defalias 'sun-select-region #[(beg end) "À \n{!‡" [sun-set-selection beg end] 3 (#$ . 17035) "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) "ÀÁ!ˆ\nƒ\fÃ\n!ˆÃÄ!ˆÀÅ!‡" [run-hooks suspend-hook stuffstring send-string-to-terminal "" suspend-resume-hook] 2 (#$ . 17208) nil]) (byte-code "ÀÁ!ˆÂÁÃ\"ˆÄÅ!„Æ ÅBÈÉ!‡" [make-variable-buffer-local current-local-mousemap set-default nil boundp current-global-mousemap make-mousemap current-load-list provide sun-mouse] 3)