diff lisp/packages/avoid.el @ 134:34a5b81f86ba r20-2b1

Import from CVS: tag r20-2b1
author cvs
date Mon, 13 Aug 2007 09:30:11 +0200
parents 1ce6082ce73f
children 489f57a838ef
line wrap: on
line diff
--- a/lisp/packages/avoid.el	Mon Aug 13 09:29:37 2007 +0200
+++ b/lisp/packages/avoid.el	Mon Aug 13 09:30:11 2007 +0200
@@ -72,6 +72,12 @@
 
 (provide 'avoid)
 
+(defgroup avoid nil
+  "Make mouse pointer stay out of the way of editing."
+  :prefix "mouse-avoidance-"
+  :group 'mouse)
+
+
 ;;;###autoload
 (defvar mouse-avoidance-mode nil
   "Value is t or a symbol if the mouse pointer should avoid the cursor.
@@ -79,21 +85,29 @@
 variable is NOT the recommended way to change modes; use that function 
 instead.")
 
-(defvar mouse-avoidance-nudge-dist 15
+(defcustom mouse-avoidance-nudge-dist 15
   "*Average distance that mouse will be moved when approached by cursor.
 Only applies in mouse-avoidance-mode `jump' and its derivatives.
-For best results make this larger than `mouse-avoidance-threshold'.")
-
-(defvar mouse-avoidance-nudge-var 10
-  "*Variability of `mouse-avoidance-nudge-dist' (which see).")
+For best results make this larger than `mouse-avoidance-threshold'."
+  :type 'integer
+  :group 'avoid)
 
-(defvar mouse-avoidance-animation-delay .01
-  "Delay between animation steps, in seconds.")
+(defcustom mouse-avoidance-nudge-var 10
+  "*Variability of `mouse-avoidance-nudge-dist' (which see)."
+  :type 'integer
+  :group 'avoid)
 
-(defvar mouse-avoidance-threshold 5
+(defcustom mouse-avoidance-animation-delay .01
+  "Delay between animation steps, in seconds."
+  :type 'number
+  :group 'avoid)
+
+(defcustom mouse-avoidance-threshold 5
   "*Mouse-pointer's flight distance.
 If the cursor gets closer than this, the mouse pointer will move away.
-Only applies in mouse-avoidance-modes `animate' and `jump'.")
+Only applies in mouse-avoidance-modes `animate' and `jump'."
+  :type 'integer
+  :group 'avoid)
 
 ;; Internal variables
 (defvar mouse-avoidance-state nil)
@@ -281,14 +295,15 @@
 (defun mouse-avoidance-kbd-command (key)
   "Return t if the KEYSEQENCE is composed of keyboard events only.
 Return nil if there are any lists in the key sequence."
-  (cond ((null key) nil)		; Null event seems to be
+  (cond ((null key) nil)       		; Null event seems to be
 					; returned occasionally.
 	((not (vectorp key)) t)		; Strings are keyboard events.
 	((catch 'done
 	   (let ((i 0)
 		 (l (length key)))
 	     (while (< i l)
-	       (if (listp (aref key i))
+	       ;; XEmacs change: (Emacs version was: (listp (aref key i)))
+	       (if (not (key-press-event-p (aref key i)))
 		   (throw 'done nil))
 	       (setq i (1+ i))))
 	   t))))