aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/avoid.el
diff options
context:
space:
mode:
authorRichard M. Stallman1997-12-22 21:50:59 +0000
committerRichard M. Stallman1997-12-22 21:50:59 +0000
commit8557ea062c62eda1f85f26617e4c05938aed395e (patch)
tree18d228be4dc41a08813b2a794f6ec7e05667bdff /lisp/avoid.el
parenteab0fb012651fb83c51545dc3902fa98909a7447 (diff)
downloademacs-8557ea062c62eda1f85f26617e4c05938aed395e.tar.gz
emacs-8557ea062c62eda1f85f26617e4c05938aed395e.zip
(mouse-avoidance-mode): Variable customized to automatically load the package.
Diffstat (limited to 'lisp/avoid.el')
-rw-r--r--lisp/avoid.el29
1 files changed, 22 insertions, 7 deletions
diff --git a/lisp/avoid.el b/lisp/avoid.el
index 7aee1e6b11e..1c7ece39272 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -32,7 +32,9 @@
32;; 32;;
33;; (if window-system (mouse-avoidance-mode 'animate)) 33;; (if window-system (mouse-avoidance-mode 'animate))
34;; 34;;
35;; The 'animate can be 'jump or 'banish or 'exile or 'protean if you prefer. 35;; Other legitimate alternatives include
36;; `banish', `exile', `jump', `cat-and-mouse', and `proteus'.
37;; They do somewhat different things.
36;; See the documentation for function `mouse-avoidance-mode' for 38;; See the documentation for function `mouse-avoidance-mode' for
37;; details of the different modes. 39;; details of the different modes.
38;; 40;;
@@ -75,11 +77,20 @@
75 :group 'mouse) 77 :group 'mouse)
76 78
77 79
78(defvar mouse-avoidance-mode nil 80(defcustom mouse-avoidance-mode nil
79 "Value is t or a symbol if the mouse pointer should avoid the cursor. 81 "Activate mouse avoidance mode.
80See function `mouse-avoidance-mode' for possible values. Changing this 82See function `mouse-avoidance-mode' for possible values.
81variable is NOT the recommended way to change modes; use that function 83You must modify via \\[customize] for this variable to have an effect."
82instead.") 84 :set (lambda (symbol value)
85 ;; 'none below prevents toggling when value is nil.
86 (mouse-avoidance-mode (or value 'none)))
87 :initialize 'custom-initialize-default
88 :type '(choice (const :tag "none" nil) (const banish) (const jump)
89 (const animate) (const exile) (const proteus)
90 )
91 :group 'avoid
92 :require 'avoid)
93
83 94
84(defcustom mouse-avoidance-nudge-dist 15 95(defcustom mouse-avoidance-nudge-dist 15
85 "*Average distance that mouse will be moved when approached by cursor. 96 "*Average distance that mouse will be moved when approached by cursor.
@@ -378,4 +389,8 @@ definition of \"random distance\".)"
378;; (setq minor-mode-alist (cons '(mouse-avoidance-mode " Avoid") 389;; (setq minor-mode-alist (cons '(mouse-avoidance-mode " Avoid")
379;; minor-mode-alist))) 390;; minor-mode-alist)))
380 391
381;;; End of avoid.el 392;; Needed for custom.
393(if mouse-avoidance-mode
394 (mouse-avoidance-mode mouse-avoidance-mode))
395
396;;; avoid.el ends here