home *** CD-ROM | disk | FTP | other *** search
Wrap
(provide (quote sun-mouse)) (defvar extra-click-wait 150 "\ *Number of milliseconds to wait for an extra click. Set this to zero if you don't want chords or double clicks.") (defvar scrollbar-width 5 "\ *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.") (defun make-mousemap nil "\ Returns a new mousemap." (byte-code "ÁÀB" [nil mousemap] 2)) (defun copy-mousemap (mousemap) "\ Return a copy of mousemap." (byte-code "Á!" [mousemap copy-alist] 2)) (defun define-mouse (mousemap mouse-list def) "\ Args MOUSEMAP, MOUSE-LIST, DEF. Define MOUSE-LIST in MOUSEMAP as DEF. MOUSE-LIST is a list of atoms specifing 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." (byte-code "ÃÄ! #" [mouse-list mousemap def mousemap-set mouse-list-to-mouse-code] 5)) (defun global-set-mouse (mouse-list def) "\ 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." (interactive "xMouse event: xDefinition: ") (byte-code "ÃÄ #" [current-global-mousemap mouse-list def nil define-mouse] 4)) (defun local-set-mouse (mouse-list def) "\ 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." (interactive "xMouse event: xDefinition: ") (byte-code "Ã?
Ä Å #" [current-local-mousemap mouse-list def nil make-mousemap define-mouse] 5)) (defun use-global-mousemap (mousemap) "\ Selects MOUSEMAP as the global mousemap." (byte-code " " [current-global-mousemap mousemap] 2)) (defun use-local-mousemap (mousemap) "\ Selects MOUSEMAP as the local mousemap. nil for MOUSEMAP means no local mousemap." (byte-code " " [current-local-mousemap mousemap] 2)) (defun logtest (x y) "\ True if any bits set in X are also set in Y. Just like the Common Lisp function of the same name." (byte-code "ÂÃ \"!?" [x y zerop logand] 4)) (defconst sm::ButtonBits 7) (defconst sm::ShiftmaskBits 56) (defconst sm::DoubleBits 64) (defconst sm::UpBits 128) (defmacro sm::hit-code (hit) (byte-code "ÁÂE" [hit nth 0] 3)) (defmacro sm::hit-button (hit) (byte-code "ÁÂÃÄEE" [hit logand sm::ButtonBits nth 0] 5)) (defmacro sm::hit-shiftmask (hit) (byte-code "ÁÂÃÄEE" [hit logand sm::ShiftmaskBits nth 0] 5)) (defmacro sm::hit-double (hit) (byte-code "ÁÂÃÄEE" [hit logand sm::DoubleBits nth 0] 5)) (defmacro sm::hit-up (hit) (byte-code "ÁÂÃÄEE" [hit logand sm::UpBits nth 0] 5)) (defmacro sm::hit-x (hit) (byte-code "ÁÂE" [hit nth 1] 3)) (defmacro sm::hit-y (hit) (byte-code "ÁÂE" [hit nth 2] 3)) (defmacro sm::hit-delta (hit) (byte-code "ÁÂE" [hit nth 3] 3)) (defmacro sm::hit-up-p (hit) (byte-code "ÁÂÃDDD" [hit not zerop sm::hit-up] 4)) (defmacro sm::loc-w (loc) (byte-code "ÁÂE" [loc nth 0] 3)) (defmacro sm::loc-x (loc) (byte-code "ÁÂE" [loc nth 1] 3)) (defmacro sm::loc-y (loc) (byte-code "ÁÂE" [loc nth 2] 3)) (defmacro eval-in-buffer (buffer &rest forms) "Macro to switches to BUFFER, evaluates FORMS, returns to original buffer." (byte-code "ÂÃÄÅÆÇDD \"ÈEE" [buffer forms let ((StartBuffer (current-buffer))) unwind-protect append progn set-buffer (set-buffer StartBuffer)] 7)) (put (quote eval-in-buffer) (quote lisp-indent-hook) 1) (defmacro eval-in-window (window &rest forms) "Switch to WINDOW, evaluate FORMS, return to original window." (byte-code "ÂÃÄÅÆÇDD \"ÈEE" [window forms let ((OriginallySelectedWindow (selected-window))) unwind-protect append progn select-window (if (window-point OriginallySelectedWindow) (select-window OriginallySelectedWindow))] 7)) (put (quote eval-in-window) (quote lisp-indent-hook) 1) (defmacro eval-in-windows (form &optional yesmini) "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." (byte-code "ÂÃÄÅÆÇÈÉÊËÌ EDEDEDÍEE" [form yesmini let ((OriginallySelectedWindow (selected-window))) unwind-protect while progn not eq OriginallySelectedWindow select-window next-window nil (select-window OriginallySelectedWindow)] 13)) (put (quote eval-in-window) (quote lisp-indent-hook) 0) (defun move-to-loc (x y) "\ Move cursor to window location X, Y. Handles wrapped and horizontally scrolled lines correctly." (byte-code "Ä!iÅÆÇ ! iÈ ÉZ^\\\" ÊÇ ËÈ S^#! Z*" [y cc nc x move-to-window-line move-to-column zerop window-hscroll window-width 2 + -1] 13)) (defun minibuffer-window-p (window) "\ True iff this WINDOW is minibuffer." (byte-code "Á ÂÃ!8U" [window screen-height 3 window-edges] 5)) (setq *mouse-help* nil) (defun sun-mouse-handler (&optional hit) "\ 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." (interactive) (byte-code "Í?
Î ÏÐ8Ñ8\"Ò 8Ð 8Ñ 8Ó \"pÔÕ !qÖ!))?V ×ØÒ8\"!??
S ÙÚÛÜ!!\"§ 9 u Ý F!Þ | ß $§ <¢ @ Ý!Þ à!§ Ùá\"),) â=
· Í" [hit loc *mouse-window* *mouse-x* *mouse-y* mouse-code form StartBuffer sm::UpBits this-command *mouse-help* t last-command nil sm::combined-hits sm::window-xy 1 2 0 mouse-event-code ((byte-code "q" [StartBuffer] 1)) window-buffer mouse-lookup zerop logand error "Undefined mouse event: %s" prin1-to-string mouse-code-to-mouse-list prin1 exit-recursive-edit funcall eval "Mouse action must be symbol or list, but was: %s" sun-mouse-handler] 19)) (defun mouse-help nil (interactive) (byte-code "ÂÁÃ )" [*mouse-help* t nil recursive-edit] 2)) (defun sm::combined-hits nil "\ Read and return next mouse-hit, include possible double click" (byte-code "Æ ÇÈ É8\"!??
9 Ê!
8 ËÌÉ8É 8ÈÉ8\"ÈÉ 8\"U5 6 É#\"))" [hit1 sm::UpBits hit2 extra-click-wait sm::ButtonBits sm::DoubleBits mouse-hit-read zerop logand 0 mouse-second-hit setcar logior] 15)) (defun mouse-hit-read nil "\ Read mouse-hit list from keyboard. Like (read 'read-char), but that uses minibuffer, and mucks up last-command." (byte-code "ÁÁÃÄr B\"?
Á ÅÆÇÈ!É#!*" [char-list nil char equal 13 read mapconcat char-to-string nreverse ""] 7)) (defvar mouse-prefix1 24 "\ First char of mouse-prefix. Used to detect double clicks and chords.") (defvar mouse-prefix2 0 "\ Second char of mouse-prefix. Used to detect double clicks and chords.") (defun mouse-second-hit (hit-wait) "\ Returns the next mouse hit occurring within HIT-WAIT milliseconds." (byte-code "É!