summaryrefslogtreecommitdiff
path: root/lisp/avoid.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-08-25 15:14:03 +0000
committerRichard M. Stallman <rms@gnu.org>1995-08-25 15:14:03 +0000
commitd6268ef501085d36aeeaa0f6c929e72082202b59 (patch)
treeb9988d5f41b8ff1500c0c3c659f8f76ddb77badd /lisp/avoid.el
parent174a7968620a7887c54b4e4a97c7b72da96693ce (diff)
downloademacs-d6268ef501085d36aeeaa0f6c929e72082202b59.tar.gz
(mouse-avoidance-mode): Use post-command-idle-hook. Use remove-hook.
Diffstat (limited to 'lisp/avoid.el')
-rw-r--r--lisp/avoid.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/lisp/avoid.el b/lisp/avoid.el
index c44cb9d0e6e..d93bc762e78 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -319,29 +319,26 @@ definition of \"random distance\".)"
nil t))))
(if (eq mode 'cat-and-mouse)
(setq mode 'animate))
- (setq post-command-hook
- (delete 'mouse-avoidance-banish-hook (append post-command-hook nil)))
- (setq post-command-hook
- (delete 'mouse-avoidance-exile-hook (append post-command-hook nil)))
- (setq post-command-hook
- (delete 'mouse-avoidance-fancy-hook (append post-command-hook nil)))
+ (remove-hook 'post-command-idle-hook 'mouse-avoidance-banish-hook)
+ (remove-hook 'post-command-idle-hook 'mouse-avoidance-exile-hook)
+ (remove-hook 'post-command-idle-hook 'mouse-avoidance-fancy-hook)
(cond ((eq mode 'none)
(setq mouse-avoidance-mode nil))
((or (eq mode 'jump)
(eq mode 'animate)
(eq mode 'proteus))
- (add-hook 'post-command-hook 'mouse-avoidance-fancy-hook)
+ (add-hook 'post-command-idle-hook 'mouse-avoidance-fancy-hook)
(setq mouse-avoidance-mode mode
mouse-avoidance-state (cons 0 0)))
((eq mode 'exile)
- (add-hook 'post-command-hook 'mouse-avoidance-exile-hook)
+ (add-hook 'post-command-idle-hook 'mouse-avoidance-exile-hook)
(setq mouse-avoidance-mode mode
mouse-avoidance-state nil))
((or (eq mode 'banish)
(eq mode t)
(and (null mode) (null mouse-avoidance-mode))
(and mode (> (prefix-numeric-value mode) 0)))
- (add-hook 'post-command-hook 'mouse-avoidance-banish-hook)
+ (add-hook 'post-command-idle-hook 'mouse-avoidance-banish-hook)
(setq mouse-avoidance-mode 'banish))
(t (setq mouse-avoidance-mode nil)))
(force-mode-line-update))