summaryrefslogtreecommitdiff
path: root/lisp/avoid.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-12-22 21:50:59 +0000
committerRichard M. Stallman <rms@gnu.org>1997-12-22 21:50:59 +0000
commit8557ea062c62eda1f85f26617e4c05938aed395e (patch)
tree18d228be4dc41a08813b2a794f6ec7e05667bdff /lisp/avoid.el
parenteab0fb012651fb83c51545dc3902fa98909a7447 (diff)
downloademacs-8557ea062c62eda1f85f26617e4c05938aed395e.tar.gz
(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 @@
;;
;; (if window-system (mouse-avoidance-mode 'animate))
;;
-;; The 'animate can be 'jump or 'banish or 'exile or 'protean if you prefer.
+;; Other legitimate alternatives include
+;; `banish', `exile', `jump', `cat-and-mouse', and `proteus'.
+;; They do somewhat different things.
;; See the documentation for function `mouse-avoidance-mode' for
;; details of the different modes.
;;
@@ -75,11 +77,20 @@
:group 'mouse)
-(defvar mouse-avoidance-mode nil
- "Value is t or a symbol if the mouse pointer should avoid the cursor.
-See function `mouse-avoidance-mode' for possible values. Changing this
-variable is NOT the recommended way to change modes; use that function
-instead.")
+(defcustom mouse-avoidance-mode nil
+ "Activate mouse avoidance mode.
+See function `mouse-avoidance-mode' for possible values.
+You must modify via \\[customize] for this variable to have an effect."
+ :set (lambda (symbol value)
+ ;; 'none below prevents toggling when value is nil.
+ (mouse-avoidance-mode (or value 'none)))
+ :initialize 'custom-initialize-default
+ :type '(choice (const :tag "none" nil) (const banish) (const jump)
+ (const animate) (const exile) (const proteus)
+ )
+ :group 'avoid
+ :require 'avoid)
+
(defcustom mouse-avoidance-nudge-dist 15
"*Average distance that mouse will be moved when approached by cursor.
@@ -378,4 +389,8 @@ definition of \"random distance\".)"
;; (setq minor-mode-alist (cons '(mouse-avoidance-mode " Avoid")
;; minor-mode-alist)))
-;;; End of avoid.el
+;; Needed for custom.
+(if mouse-avoidance-mode
+ (mouse-avoidance-mode mouse-avoidance-mode))
+
+;;; avoid.el ends here