;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301\302\303\304\305\306\307&\210\310\311\302\312\313\314\315\316\317\320\306\301\321\301\322\323&\210\310\324\325\326\317\327\306\301&\210\310\330\331\332\317\327\306\301&\210\310\333\334\335\317\336\306\301&\210\310\337\340\341\317\327\306\301&\210\310\342\343\344\306\301\322\345\317\346\347\350& \207" [custom-declare-group avoid nil "Make mouse pointer stay out of the way of editing." :prefix "mouse-avoidance-" :group mouse custom-declare-variable mouse-avoidance-mode "Activate Mouse Avoidance mode.\nSee function `mouse-avoidance-mode' for possible values.\nSetting this variable directly does not take effect;\nuse either \\[customize] or the function `mouse-avoidance-mode'." :set #[(_symbol value) "\301\206\302!\207" [value mouse-avoidance-mode none] 2] :initialize custom-initialize-default :type (choice (const :tag "none" nil) (const banish) (const jump) (const animate) (const exile) (const proteus)) :require :version "20.3" mouse-avoidance-nudge-dist 15 "Average distance that mouse will be moved when approached by cursor.\nOnly applies in Mouse Avoidance mode `jump' and its derivatives.\nFor best results make this larger than `mouse-avoidance-threshold'." integer mouse-avoidance-nudge-var 10 "Variability of `mouse-avoidance-nudge-dist' (which see)." mouse-avoidance-animation-delay 0.01 "Delay between animation steps, in seconds." number mouse-avoidance-threshold 5 "Mouse-pointer's flight distance.\nIf the cursor gets closer than this, the mouse pointer will move away.\nOnly applies in Mouse Avoidance modes `animate' and `jump'." mouse-avoidance-banish-position '((frame-or-window . frame) (side . right) (side-pos . 3) (top-or-bottom . top) (top-or-bottom-pos . 0)) "Position to which Mouse Avoidance mode `banish' moves the mouse.\nAn alist where keywords mean:\nFRAME-OR-WINDOW: banish the mouse to corner of frame or window.\nSIDE: banish the mouse on right or left corner of frame or window.\nSIDE-POS: Distance from right or left edge of frame or window.\nTOP-OR-BOTTOM: banish the mouse to top or bottom of frame or window.\nTOP-OR-BOTTOM-POS: Distance from top or bottom edge of frame or window." "24.3" (alist :key-type symbol :value-type (choice symbol integer)) :options ((frame-or-window symbol) (side symbol) (side-pos integer) (top-or-bottom symbol) (top-or-bottom-pos integer))] 16) (defvar mouse-avoidance-state nil) (defvar mouse-avoidance-pointer-shapes nil) (defvar mouse-avoidance-n-pointer-shapes 0) (defvar mouse-avoidance-old-pointer-shape nil) (defvar mouse-avoidance-animating-pointer nil) (defvar mouse-avoidance-timer nil) #@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 (#$ . 3013)]) (put 'mouse-avoidance-set-pointer-shape 'byte-optimizer 'byte-compile-inline-expand) #@79 Return the position of point as (FRAME X . Y). Analogous to `mouse-position'. (defalias 'mouse-avoidance-point-position #[nil "\303 \301 \211\205 \3048\262\211\205*\305 @\n@\306 \245\\A@\nA\307 \245\\BB+\207" [edges posn-at-point x-y window-inside-edges 2 selected-frame frame-char-width frame-char-height] 6 (#$ . 3304)]) (defalias 'mouse-avoidance-set-mouse-position #[(pos) "\302 \303 @ A#\210)\304\207" [f pos selected-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\"\307 \204\310\n\203\"\n W\203\"\307\202R\311 \211\205RA@ \f@=\205Q ??\205Q\312 \fA@Z! W\205Q\312\n\fAAZ! W),\207" [mouse frame mouse-y tool-bar-lines point mouse-x frame-parameter nil 0 mouse-avoidance-point-position abs mouse-avoidance-threshold] 3 (#$ . 3778)]) #@175 The position to which Mouse Avoidance mode `banish' moves the mouse. If you want the mouse banished to a different corner set `mouse-avoidance-banish-position' as you need. (defalias 'mouse-avoidance-banish-destination #[nil "\306\307\310#\211\311\267\202\312\211\313 \314 F\202\315 \202\316\211\316\317\316\211 :\203K @ :\203K @\211\fBB A A\202)\237-\306\320\310#\306\321\310#\306\322\310#\306\323\310#\324\267\202|\325\202}\326\202}\316\327\267\202\216\325\202\217\326\202\217\316\306\310#\"\306\310#\". B\207" [mouse-avoidance-banish-position fra-or-win list-values #1=#:--cl-var-- v #2=#:--cl-var-- assoc-default frame-or-window eq #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (frame 12 window 22)) 0 frame-width frame-height window-edges nil (left top right bottom) side side-pos top-or-bottom top-or-bottom-pos #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (left 116 right 120)) + - #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (top 134 bottom 138)) k #3=#:--cl-var-- alist side-dist top-or-bottom-dist side-fn top-or-bottom-fn] 7 (#$ . 4327)]) #@61 Put the mouse pointer to `mouse-avoidance-banish-position'. (defalias 'mouse-avoidance-banish-mouse #[nil "\300\301 !\207" [mouse-avoidance-set-mouse-position mouse-avoidance-banish-destination] 2 (#$ . 5578)]) (defalias 'mouse-avoidance-delta #[(cur delta dist var min max) " Z\n[ [\\]\n[ \\\n [\\\f Z\n \\^ \n  ZW\203.\306\211\n \f ZV\203<\306\211\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] 7]) (put 'mouse-avoidance-delta 'byte-optimizer 'byte-compile-inline-expand) (defalias 'mouse-avoidance-nudge-mouse #[nil "\306 \211A\307 \211\211A\242\n\211A\242\n\211A\242\n\211A\242 @\310!@Z S !Z [[\\] [\\ [\\Z \\^\"#$%$ZW\203x\311\211%$#ZV\203\210\311\211#\"%\203\232!%W\203\232%\202\361$\203\254!$W\203\254!\202\361$\203\275!\312W\203\275$\202\361#\203\317!#W\203\317#\202\361\"\203\341!\"W\203\341!\202\361\"\206\361$\206\361#\206\361\312.\n& A\310!AZ\fS !Z [[\\] [\\ [\\Z \\^\"#$%$ZW\203L\311\211%$#ZV\203\\\311\211#\"%\203n!%W\203n%\202\305$\203\200!$W\203\200!\202\305$\203\221!\312W\203\221$\202\305#\203\243!#W\203\243#\202\305\"\203\265!\"W\203\265!\202\305\"\206\305$\206\305#\206\305\312.\n'@&\\A'\\B(\313=\204\346(\314=\203D\315\316\317\245])*\320+*\321X\203<\322 @\323*&_!\\ A\323*'_!\\B!\210*)\\*(\314=\2034\324 ,\325\326!\2052,\327\311!)\210\330-!\210\202\364\311\211+*\202S\322A@&\\AA'\\B!. \207" [cur cur-pos pos wleft wtop wright mouse-position window-edges random nil 0 animate proteus 0.0 0.1 1.0 t 1 mouse-avoidance-set-mouse-position round mouse-avoidance-random-shape boundp x-pointer-shape set-mouse-color sit-for wbot mouse-avoidance-nudge-var mouse-avoidance-state mouse-avoidance-nudge-dist max min var dist delta R2 L2 R1 L1 deltax deltay mouse-avoidance-mode incr i mouse-avoidance-animating-pointer 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 (#$ . 7825)]) (defalias 'mouse-avoidance-ignore-p #[nil "\306 \307 ?\206 ?\206\n\206A@?\206@\310 =?\206 \311=\206\f:\205\f@9\205\312\f@!\f@\313>\206~\314 >\206~\315 >\206~\316 >\206~\317 >\206~\320 >\206~\321 >\206~\322 >\206~\323 >\206~\324 >\206~\325 >\206~\326 >))\207" [mp cursor-type executing-kbd-macro track-mouse last-input-event modifiers mouse-position frame-pointer-visible-p selected-frame dropping event-modifiers (mouse-movement scroll-bar-movement select-window focus-out) click double triple drag down meta control shift hyper super alt] 2]) (defalias 'mouse-avoidance-banish #[nil "\300 ?\205\301 \207" [mouse-avoidance-ignore-p mouse-avoidance-banish-mouse] 1]) (defalias 'mouse-avoidance-exile #[nil "\302 ?\205>\303  \204\304!\203\305 \202= \205=\304 !?\205=@\306 =\203:A\307 \232\203:\310 A!\210\311\211)\207" [mp mouse-avoidance-state mouse-avoidance-ignore-p 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 #[nil "?\205&\302 ?\205&\303\304 !\205&\304 \305 \210\306 @=?\205%\307\310 \")\207" [mouse-avoidance-animating-pointer old-pos mouse-avoidance-ignore-p mouse-avoidance-too-close-p mouse-position mouse-avoidance-nudge-mouse selected-frame apply set-mouse-position] 3]) #@1064 Set Mouse 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. (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!\205%\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 0 exile 0.1 mouse-avoidance-exile banish prefix-numeric-value 0.1 mouse-avoidance-banish force-mode-line-update mouse-avoidance-state] 4 (#$ . 9749) (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\301\302!\207" [mouse-avoidance-mode provide avoid] 2)