;ELC ;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:36:44 2003 ;;; from file /home/pot/gnu/emacs-pretest.new/lisp/avoid.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 "`avoid.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\302\301\303\304\305\306\307\310&\207" [provide avoid custom-declare-group nil "Make mouse pointer stay out of the way of editing." :prefix "mouse-avoidance-" :group mouse] 8) #@206 Activate mouse avoidance mode. See function `mouse-avoidance-mode' for possible values. Setting this variable directly does not take effect; use either \[customize] or the function `mouse-avoidance-mode'. (custom-declare-variable 'mouse-avoidance-mode 'nil '(#$ . 815) :set (lambda (symbol value) (mouse-avoidance-mode (or value 'none))) :initialize 'custom-initialize-default :type '(choice (const :tag "none" nil) (const banish) (const jump) (const animate) (const exile) (const proteus)) :group 'avoid :require 'avoid :version "20.3") #@204 *Average distance that mouse will be moved when approached by cursor. Only applies in mouse-avoidance-mode `jump' and its derivatives. For best results make this larger than `mouse-avoidance-threshold'. (custom-declare-variable 'mouse-avoidance-nudge-dist '15 '(#$ . -1360) :type 'integer :group 'avoid) #@59 *Variability of `mouse-avoidance-nudge-dist' (which see). (custom-declare-variable 'mouse-avoidance-nudge-var '10 '(#$ . -1670) :type 'integer :group 'avoid) #@44 Delay between animation steps, in seconds. (custom-declare-variable 'mouse-avoidance-animation-delay '0.01 '(#$ . 1834) :type 'number :group 'avoid) #@166 *Mouse-pointer's flight distance. If the cursor gets closer than this, the mouse pointer will move away. Only applies in mouse-avoidance-modes `animate' and `jump'. (custom-declare-variable 'mouse-avoidance-threshold '5 '(#$ . -1990) :type 'integer :group 'avoid) (byte-code "\301B\306\301!\204\f\307\302B\306\302!\204\307\303B\306\303!\204$\310\304B\306\304!\2040\307\305B\306\305!\204<\307\307\207" [current-load-list mouse-avoidance-state mouse-avoidance-pointer-shapes mouse-avoidance-n-pointer-shapes mouse-avoidance-old-pointer-shape mouse-avoidance-timer boundp nil 0] 2) #@46 Set the shape of the mouse pointer to SHAPE. (defalias 'mouse-avoidance-set-pointer-shape #[(shape) "\302\301!\205 \303\304!\207" [shape x-pointer-shape boundp set-mouse-color nil] 2 (#$ . 2596)]) (put 'mouse-avoidance-set-pointer-shape 'byte-optimizer 'byte-compile-inline-expand) #@77 Return the position of point as (FRAME X . Y). Analogous to mouse-position. (defalias 'mouse-avoidance-point-position #[nil "\303 \304!\305\306!e]\307`\310 \311 B\310 S\312!\313B\303 &\314 @\nA@\\ A@\nAA@\\+BB\207" [w edges list selected-window window-edges compute-motion window-start (0 . 0) window-width window-height window-hscroll 0 selected-frame] 8 (#$ . 2887)]) (defalias 'mouse-avoidance-set-mouse-position #[(pos) "\302 \303!\210\304 @ A#\210)\305\207" [f pos selected-frame raise-frame set-mouse-position t] 4]) #@191 Return t if mouse pointer and point cursor are too close. MOUSE is the current mouse position as returned by `mouse-position'. Acceptable distance is defined by `mouse-avoidance-threshold'. (defalias 'mouse-avoidance-too-close-p #[(mouse) "@AA\306\307\303\"\211\204\310\n\205\n W?\205I\311 A@ @=\205H\f??\205H\312\f A@Z! W\205H\312\n AAZ! W*+\207" [mouse frame mouse-y tool-bar-lines mouse-x point frame-parameter nil 0 mouse-avoidance-point-position abs mouse-avoidance-threshold] 4 (#$ . 3428)]) #@146 The position to which mouse-avoidance-mode `banish' moves the mouse. You can redefine this if you want the mouse banished to a different corner. (defalias 'mouse-avoidance-banish-destination #[nil "\300 S\301B\207" [frame-width 0] 2 (#$ . 3953)]) (defalias 'mouse-avoidance-banish-mouse #[nil "\300\301 !\207" [mouse-avoidance-set-mouse-position mouse-avoidance-banish-destination] 2]) (defalias 'mouse-avoidance-delta #[(cur delta dist var min max) " Z\n[ [\\]\n[ \\\n [\\\f Z\n \\^ \n  ZW\203.\306\n\306 \f ZV\203<\306\306\n\203N \nW\203N\n\202\242 \203`  W\203` \202\242 \203q \307W\203q \202\242\203\203 W\203\203\202\242 \203\223 W\203\223 \202\242 \206\242 \206\242\206\242\307,\207" [min cur dist var max R2 nil 0 L2 R1 L1 delta] 6]) (put 'mouse-avoidance-delta 'byte-optimizer 'byte-compile-inline-expand) (defalias 'mouse-avoidance-nudge-mouse #[nil "\306 \211@A\211@\307 !\f@Z \310\311 Z[[\\][\\[\\Z\\^ ! ZW\203[\312!\312 ZV\203k\312\312!\203}!W\203}!\202\324 \203\217 W\203\217\202\324 \203\240\310W\203\240 \202\324\203\262W\203\262\202\324\203\304W\203\304\202\324\206\324 \206\324\206\324\310.\n\"\nA\307 !\fAZ \310\313 Z[[\\][\\[\\Z\\^ ! ZW\203*\312!\312 ZV\203:\312\312!\203L!W\203L!\202\243 \203^ W\203^\202\243 \203o\310W\203o \202\243\203\201W\203\201\202\243\203\223W\203\223\202\243\206\243 \206\243\206\243\310.\n#\f@\"\\\fA#\\B$\314=\204\301$\315=\203\316%%\317X\205\320\n@\321%\"_!\\\nA\321%#_!\\B!\210%\322\323 \245]\\%$\315=\203\324 &\325\326!\203&\327\312!\210)\330'!\210\202\304)\202\"\320A@\"\\AA#\\B!-\207" [cur cur-frame cur-pos mouse-avoidance-nudge-var mouse-avoidance-state mouse-avoidance-nudge-dist mouse-position random 0 frame-width nil frame-height animate proteus 0.0 1 mouse-avoidance-set-mouse-position round 0.1 1.0 mouse-avoidance-random-shape boundp x-pointer-shape set-mouse-color sit-for max min var dist delta R2 L2 R1 L1 deltax deltay mouse-avoidance-mode i shape mouse-avoidance-animation-delay] 7]) #@213 Return a random cursor shape. This assumes that any variable whose name begins with x-pointer- and has an integer value is a valid cursor shape. You might want to redefine this function to suit your own tastes. (defalias 'mouse-avoidance-random-shape #[nil "\204\303\304\305\306 \307#\"\211G\310\n!8\207" [mouse-avoidance-pointer-shapes obarray mouse-avoidance-n-pointer-shapes mapcar #[(x) "\301!J\207" [x intern] 2] all-completions "x-pointer-" #[(x) "\301!\205 J\250\207" [x boundp] 2] random] 7 (#$ . 6231)]) (defalias 'mouse-avoidance-banish-hook #[nil "?\205<\304 \211A@)\205<\n:\2056\n@9\2056\305\n@!\n@\306>\2065\307 >\2065\310 >\2065\311 >)?\205<\312 \207" [executing-kbd-macro x last-input-event modifiers mouse-position event-modifiers (mouse-movement scroll-bar-movement) click drag down mouse-avoidance-banish-mouse] 3]) (defalias 'mouse-avoidance-exile-hook #[nil "?\205h :\205, @9\205,\305 @! @\306>\206+\307\n>\206+\310\n>\206+\311\n>)?\205h\312 \f\204D\313 !\203D \314 \202g\f\205g\313\f!?\205g @\315 =\203d A\316 \232\203d\317\fA!\210\320\211)\207" [executing-kbd-macro last-input-event modifiers mp mouse-avoidance-state event-modifiers (mouse-movement scroll-bar-movement) click drag down mouse-position mouse-avoidance-too-close-p mouse-avoidance-banish-mouse selected-frame mouse-avoidance-banish-destination mouse-avoidance-set-mouse-position nil] 2]) (defalias 'mouse-avoidance-fancy-hook #[nil "?\205K :\205, @9\205,\304 @! @\305>\206+\306\n>\206+\307\n>\206+\310\n>)?\205K\311\312 !\205K\312 \313 \210\314 @=?\205J\315\316 \")\207" [executing-kbd-macro last-input-event modifiers old-pos event-modifiers (mouse-movement scroll-bar-movement) click drag down mouse-avoidance-too-close-p mouse-position mouse-avoidance-nudge-mouse selected-frame apply set-mouse-position] 3]) #@1121 Set cursor avoidance mode to MODE. MODE should be one of the symbols `banish', `exile', `jump', `animate', `cat-and-mouse', `proteus', or `none'. If MODE is nil, toggle mouse avoidance between `none' and `banish' modes. Positive numbers and symbols other than the above are treated as equivalent to `banish'; negative numbers and `-' are equivalent to `none'. Effects of the different modes: * banish: Move the mouse to the upper-right corner on any keypress. * exile: Move the mouse to the corner only if the cursor gets too close, and allow it to return once the cursor is out of the way. * jump: If the cursor gets too close to the mouse, displace the mouse a random distance & direction. * animate: As `jump', but shows steps along the way for illusion of motion. * cat-and-mouse: Same as `animate'. * proteus: As `animate', but changes the shape of the mouse pointer too. Whenever the mouse is moved, the frame is also raised. (see `mouse-avoidance-threshold' for definition of "too close", and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for definition of "random distance".) (defalias 'mouse-avoidance-mode #[(&optional mode) "\306=\203\307 \203\310 !\210\311\n\312=\203' \313\305!\203&\f\314\311!\210)\315=\2032\311\202\235\316=\204D\307=\204D\312=\203\\\317\320\321\322#\323\211B\313\305!\205X \202\235\324=\203p\317\325\321\326#\311\202\235\327=\204\220\321=\204\220\204\204\n\203\220\203\233\330!\323V\203\233\317\331\321\332#\327\202\235\311\333 \207" [mode mouse-avoidance-timer mouse-avoidance-mode mouse-avoidance-old-pointer-shape shape x-pointer-shape cat-and-mouse animate cancel-timer nil proteus boundp set-mouse-color none jump run-with-idle-timer 0.1 t mouse-avoidance-fancy-hook 0 exile 0.1 mouse-avoidance-exile-hook banish prefix-numeric-value 0.1 mouse-avoidance-banish-hook force-mode-line-update mouse-avoidance-state] 4 (#$ . 8092) (list (intern (completing-read "Select cursor avoidance technique (SPACE for list): " '(("banish") ("exile") ("jump") ("animate") ("cat-and-mouse") ("proteus") ("none")) nil t)))]) (byte-code "\203\300!\210\300\207" [mouse-avoidance-mode] 2)