aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/avoid.el
diff options
context:
space:
mode:
authorSam Steingold2000-08-11 17:05:44 +0000
committerSam Steingold2000-08-11 17:05:44 +0000
commit187bd11cd3543eeb0fbe4524b69576bfba30afc2 (patch)
tree20e82dfd16c1b8efb67bce9eb76311a1f6ec6014 /lisp/avoid.el
parent218c2cc7ca54a91e4c522a8868cbbbc791b74992 (diff)
downloademacs-187bd11cd3543eeb0fbe4524b69576bfba30afc2.tar.gz
emacs-187bd11cd3543eeb0fbe4524b69576bfba30afc2.zip
punctuation fixes in doc strings
Diffstat (limited to 'lisp/avoid.el')
-rw-r--r--lisp/avoid.el46
1 files changed, 23 insertions, 23 deletions
diff --git a/lisp/avoid.el b/lisp/avoid.el
index f5712427964..1f01eced204 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -26,9 +26,9 @@
26 26
27;; For those who are annoyed by the mouse pointer obscuring text, 27;; For those who are annoyed by the mouse pointer obscuring text,
28;; this mode moves the mouse pointer - either just a little out of 28;; this mode moves the mouse pointer - either just a little out of
29;; the way, or all the way to the corner of the frame. 29;; the way, or all the way to the corner of the frame.
30;; To use, load or evaluate this file and type M-x mouse-avoidance-mode . 30;; To use, load or evaluate this file and type M-x mouse-avoidance-mode .
31;; To set up permanently, put the following in your .emacs: 31;; To set up permanently, put the following in your .emacs:
32;; 32;;
33;; (if (display-mouse-p) (mouse-avoidance-mode 'animate)) 33;; (if (display-mouse-p) (mouse-avoidance-mode 'animate))
34;; 34;;
@@ -49,7 +49,7 @@
49;; 49;;
50;; For completely random pointer shape, replace the setq above with: 50;; For completely random pointer shape, replace the setq above with:
51;; (setq x-pointer-shape (mouse-avoidance-random-shape)) 51;; (setq x-pointer-shape (mouse-avoidance-random-shape))
52;; 52;;
53;; Bugs / Warnings / To-Do: 53;; Bugs / Warnings / To-Do:
54;; 54;;
55;; - Using this code does slow emacs down. "banish" mode shouldn't 55;; - Using this code does slow emacs down. "banish" mode shouldn't
@@ -59,7 +59,7 @@
59;; rather than always raising the frame. 59;; rather than always raising the frame.
60 60
61;; Credits: 61;; Credits:
62;; This code was helped by all those who contributed suggestions, 62;; This code was helped by all those who contributed suggestions,
63;; fixes, and additions 63;; fixes, and additions
64;; Joe Harrington (and his advisor), for the original inspiration. 64;; Joe Harrington (and his advisor), for the original inspiration.
65;; Ken Manheimer, for dreaming up the Protean mode. 65;; Ken Manheimer, for dreaming up the Protean mode.
@@ -78,15 +78,15 @@
78 78
79;;;###autoload 79;;;###autoload
80(defcustom mouse-avoidance-mode nil 80(defcustom mouse-avoidance-mode nil
81 "Activate mouse avoidance mode. 81 "Activate mouse avoidance mode.
82See function `mouse-avoidance-mode' for possible values. 82See function `mouse-avoidance-mode' for possible values.
83Setting this variable directly does not take effect; 83Setting this variable directly does not take effect;
84use either \\[customize] or the function `mouse-avoidance-mode'." 84use either \\[customize] or the function `mouse-avoidance-mode'."
85 :set (lambda (symbol value) 85 :set (lambda (symbol value)
86 ;; 'none below prevents toggling when value is nil. 86 ;; 'none below prevents toggling when value is nil.
87 (mouse-avoidance-mode (or value 'none))) 87 (mouse-avoidance-mode (or value 'none)))
88 :initialize 'custom-initialize-default 88 :initialize 'custom-initialize-default
89 :type '(choice (const :tag "none" nil) (const banish) (const jump) 89 :type '(choice (const :tag "none" nil) (const banish) (const jump)
90 (const animate) (const exile) (const proteus) 90 (const animate) (const exile) (const proteus)
91 ) 91 )
92 :group 'avoid 92 :group 'avoid
@@ -139,10 +139,10 @@ Only applies in mouse-avoidance-modes `animate' and `jump'."
139Analogous to mouse-position." 139Analogous to mouse-position."
140 (let* ((w (selected-window)) 140 (let* ((w (selected-window))
141 (edges (window-edges w)) 141 (edges (window-edges w))
142 (list 142 (list
143 (compute-motion (max (window-start w) (point-min)) ; start pos 143 (compute-motion (max (window-start w) (point-min)) ; start pos
144 ;; window-start can be < point-min if the 144 ;; window-start can be < point-min if the
145 ;; latter has changed since the last redisplay 145 ;; latter has changed since the last redisplay
146 '(0 . 0) ; start XY 146 '(0 . 0) ; start XY
147 (point) ; stop pos 147 (point) ; stop pos
148 (cons (window-width) (window-height)); stop XY: none 148 (cons (window-width) (window-height)); stop XY: none
@@ -157,7 +157,7 @@ Analogous to mouse-position."
157 157
158;(defun mouse-avoidance-point-position-test () 158;(defun mouse-avoidance-point-position-test ()
159; (interactive) 159; (interactive)
160; (message (format "point=%s mouse=%s" 160; (message (format "point=%s mouse=%s"
161; (cdr (mouse-avoidance-point-position)) 161; (cdr (mouse-avoidance-point-position))
162; (cdr (mouse-position))))) 162; (cdr (mouse-position)))))
163 163
@@ -171,7 +171,7 @@ Analogous to mouse-position."
171 (raise-frame f) 171 (raise-frame f)
172 (set-mouse-position f (car pos) (cdr pos)) 172 (set-mouse-position f (car pos) (cdr pos))
173 t)) 173 t))
174 174
175(defun mouse-avoidance-too-close-p (mouse) 175(defun mouse-avoidance-too-close-p (mouse)
176 ;; Return t if mouse pointer and point cursor are too close. 176 ;; Return t if mouse pointer and point cursor are too close.
177 ;; Acceptable distance is defined by mouse-avoidance-threshold. 177 ;; Acceptable distance is defined by mouse-avoidance-threshold.
@@ -214,19 +214,19 @@ You can redefine this if you want the mouse banished to a different corner."
214 ((or R1 L2)) 214 ((or R1 L2))
215 (t 0)))) 215 (t 0))))
216 216
217(defun mouse-avoidance-nudge-mouse () 217(defun mouse-avoidance-nudge-mouse ()
218 ;; Push the mouse a little way away, possibly animating the move 218 ;; Push the mouse a little way away, possibly animating the move
219 ;; For these modes, state keeps track of the total offset that we've 219 ;; For these modes, state keeps track of the total offset that we've
220 ;; accumulated, and tries to keep it close to zero. 220 ;; accumulated, and tries to keep it close to zero.
221 (let* ((cur (mouse-position)) 221 (let* ((cur (mouse-position))
222 (cur-frame (car cur)) 222 (cur-frame (car cur))
223 (cur-pos (cdr cur)) 223 (cur-pos (cdr cur))
224 (deltax (mouse-avoidance-delta 224 (deltax (mouse-avoidance-delta
225 (car cur-pos) (- (random mouse-avoidance-nudge-var) 225 (car cur-pos) (- (random mouse-avoidance-nudge-var)
226 (car mouse-avoidance-state)) 226 (car mouse-avoidance-state))
227 mouse-avoidance-nudge-dist mouse-avoidance-nudge-var 227 mouse-avoidance-nudge-dist mouse-avoidance-nudge-var
228 0 (frame-width))) 228 0 (frame-width)))
229 (deltay (mouse-avoidance-delta 229 (deltay (mouse-avoidance-delta
230 (cdr cur-pos) (- (random mouse-avoidance-nudge-var) 230 (cdr cur-pos) (- (random mouse-avoidance-nudge-var)
231 (cdr mouse-avoidance-state)) 231 (cdr mouse-avoidance-state))
232 mouse-avoidance-nudge-dist mouse-avoidance-nudge-var 232 mouse-avoidance-nudge-dist mouse-avoidance-nudge-var
@@ -234,16 +234,16 @@ You can redefine this if you want the mouse banished to a different corner."
234 (setq mouse-avoidance-state 234 (setq mouse-avoidance-state
235 (cons (+ (car mouse-avoidance-state) deltax) 235 (cons (+ (car mouse-avoidance-state) deltax)
236 (+ (cdr mouse-avoidance-state) deltay))) 236 (+ (cdr mouse-avoidance-state) deltay)))
237 (if (or (eq mouse-avoidance-mode 'animate) 237 (if (or (eq mouse-avoidance-mode 'animate)
238 (eq mouse-avoidance-mode 'proteus)) 238 (eq mouse-avoidance-mode 'proteus))
239 (let ((i 0.0)) 239 (let ((i 0.0))
240 (while (<= i 1) 240 (while (<= i 1)
241 (mouse-avoidance-set-mouse-position 241 (mouse-avoidance-set-mouse-position
242 (cons (+ (car cur-pos) (round (* i deltax))) 242 (cons (+ (car cur-pos) (round (* i deltax)))
243 (+ (cdr cur-pos) (round (* i deltay))))) 243 (+ (cdr cur-pos) (round (* i deltay)))))
244 (setq i (+ i (max .1 (/ 1.0 mouse-avoidance-nudge-dist)))) 244 (setq i (+ i (max .1 (/ 1.0 mouse-avoidance-nudge-dist))))
245 (if (eq mouse-avoidance-mode 'proteus) 245 (if (eq mouse-avoidance-mode 'proteus)
246 (mouse-avoidance-set-pointer-shape 246 (mouse-avoidance-set-pointer-shape
247 (mouse-avoidance-random-shape))) 247 (mouse-avoidance-random-shape)))
248 (sit-for mouse-avoidance-animation-delay))) 248 (sit-for mouse-avoidance-animation-delay)))
249 (mouse-avoidance-set-mouse-position (cons (+ (car (cdr cur)) deltax) 249 (mouse-avoidance-set-mouse-position (cons (+ (car (cdr cur)) deltax)
@@ -259,10 +259,10 @@ redefine this function to suit your own tastes."
259 (setq mouse-avoidance-pointer-shapes 259 (setq mouse-avoidance-pointer-shapes
260 (mapcar (lambda (x) (symbol-value (intern x))) 260 (mapcar (lambda (x) (symbol-value (intern x)))
261 (all-completions "x-pointer-" obarray 261 (all-completions "x-pointer-" obarray
262 (lambda (x) 262 (lambda (x)
263 (and (boundp x) 263 (and (boundp x)
264 (integerp (symbol-value x))))))) 264 (integerp (symbol-value x)))))))
265 (setq mouse-avoidance-n-pointer-shapes 265 (setq mouse-avoidance-n-pointer-shapes
266 (length mouse-avoidance-pointer-shapes)))) 266 (length mouse-avoidance-pointer-shapes))))
267 (nth (random mouse-avoidance-n-pointer-shapes) 267 (nth (random mouse-avoidance-n-pointer-shapes)
268 mouse-avoidance-pointer-shapes)) 268 mouse-avoidance-pointer-shapes))
@@ -334,11 +334,11 @@ redefine this function to suit your own tastes."
334MODE should be one of the symbols `banish', `exile', `jump', `animate', 334MODE should be one of the symbols `banish', `exile', `jump', `animate',
335`cat-and-mouse', `proteus', or `none'. 335`cat-and-mouse', `proteus', or `none'.
336 336
337If MODE is nil, toggle mouse avoidance between `none` and `banish' 337If MODE is nil, toggle mouse avoidance between `none' and `banish'
338modes. Positive numbers and symbols other than the above are treated 338modes. Positive numbers and symbols other than the above are treated
339as equivalent to `banish'; negative numbers and `-' are equivalent to `none'. 339as equivalent to `banish'; negative numbers and `-' are equivalent to `none'.
340 340
341Effects of the different modes: 341Effects of the different modes:
342 * banish: Move the mouse to the upper-right corner on any keypress. 342 * banish: Move the mouse to the upper-right corner on any keypress.
343 * exile: Move the mouse to the corner only if the cursor gets too close, 343 * exile: Move the mouse to the corner only if the cursor gets too close,
344 and allow it to return once the cursor is out of the way. 344 and allow it to return once the cursor is out of the way.
@@ -385,7 +385,7 @@ definition of \"random distance\".)"
385 (run-with-idle-timer 0.1 t 'mouse-avoidance-exile-hook)) 385 (run-with-idle-timer 0.1 t 'mouse-avoidance-exile-hook))
386 (setq mouse-avoidance-mode mode 386 (setq mouse-avoidance-mode mode
387 mouse-avoidance-state nil)) 387 mouse-avoidance-state nil))
388 ((or (eq mode 'banish) 388 ((or (eq mode 'banish)
389 (eq mode t) 389 (eq mode t)
390 (and (null mode) (null mouse-avoidance-mode)) 390 (and (null mode) (null mouse-avoidance-mode))
391 (and mode (> (prefix-numeric-value mode) 0))) 391 (and mode (> (prefix-numeric-value mode) 0)))
@@ -402,7 +402,7 @@ definition of \"random distance\".)"
402;; minor-mode-alist))) 402;; minor-mode-alist)))
403 403
404;; Needed for custom. 404;; Needed for custom.
405(if mouse-avoidance-mode 405(if mouse-avoidance-mode
406 (mouse-avoidance-mode mouse-avoidance-mode)) 406 (mouse-avoidance-mode mouse-avoidance-mode))
407 407
408;;; avoid.el ends here 408;;; avoid.el ends here