# HG changeset patch # User Richard M. Stallman # Date 809363643 0 # Node ID f7d26ee5ea26ff5de1b2765c4ab9c1f74ff3d55e # Parent 1fc5a2981547b66b3855afa1ed2094ea9db1c651 (mouse-avoidance-mode): Use post-command-idle-hook. Use remove-hook. diff -r 1fc5a2981547 -r f7d26ee5ea26 lisp/avoid.el --- a/lisp/avoid.el Fri Aug 25 14:16:26 1995 +0000 +++ b/lisp/avoid.el Fri Aug 25 15:14:03 1995 +0000 @@ -319,29 +319,26 @@ 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))