annotate lisp/packages/avoid.el @ 76:c0c698873ce1 r20-0b33

Import from CVS: tag r20-0b33
author cvs
date Mon, 13 Aug 2007 09:05:10 +0200
parents 131b0175ea99
children 1ce6082ce73f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1 ;;; avoid.el --- make mouse pointer stay out of the way of editing
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
5 ;; Author: Boris Goldowsky <boris@gnu.ai.mit.edu>
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Version: 1.10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
24 ;; 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
26 ;;; Synched up with: FSF 19.34.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
30 ;; For those who are annoyed by the mouse pointer obscuring text,
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
31 ;; this mode moves the mouse pointer - either just a little out of
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
32 ;; the way, or all the way to the corner of the frame.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
33 ;; To use, load or evaluate this file and type M-x mouse-avoidance-mode .
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
34 ;; To set up permanently, put this file on your .emacs:
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
35 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
36 ;; (if window-system (mouse-avoidance-mode 'animate))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
37 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
38 ;; The 'animate can be 'jump or 'banish or 'exile or 'protean if you prefer.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
39 ;; See the documentation for function `mouse-avoidance-mode' for
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
40 ;; details of the different modes.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
41 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
42 ;; For added silliness, make the animatee animate...
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
43 ;; put something similar to the following into your .emacs:
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
44 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
45 ;; (if window-system
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
46 ;; (mouse-avoidance-set-pointer-shape
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
47 ;; (eval (nth (random 4)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
48 ;; '(x-pointer-man x-pointer-spider
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
49 ;; x-pointer-gobbler x-pointer-gumby)))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
50 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
51 ;; For completely random pointer shape, replace the setq above with:
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
52 ;; (setq x-pointer-shape (mouse-avoidance-random-shape))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
53 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
54 ;; Bugs / Warnings / To-Do:
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
55 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
56 ;; - Using this code does slow emacs down. "banish" mode shouldn't
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
57 ;; be too bad, and on my workstation even "animate" is reasonable.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
58 ;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
59 ;; - It ought find out where any overlapping frames are and avoid them,
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
60 ;; rather than always raising the frame.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
61
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
62 ;; Credits:
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
63 ;; This code was helped by all those who contributed suggestions,
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
64 ;; fixes, and additions
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
65 ;; Joe Harrington (and his advisor), for the original inspiration.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
66 ;; Ken Manheimer, for dreaming up the Protean mode.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
67 ;; Richard Stallman, for the awful cat-and-mouse pun, among other things.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
68 ;; Mike Williams, Denis Howe, Bill Benedetto, Chris Moore, Don Morris,
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
69 ;; Simon Marshall, and M.S. Ashton, for their feedback.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
70
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (provide 'avoid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (defvar mouse-avoidance-mode nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 "Value is t or a symbol if the mouse pointer should avoid the cursor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 See function `mouse-avoidance-mode' for possible values. Changing this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 variable is NOT the recommended way to change modes; use that function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 instead.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (defvar mouse-avoidance-nudge-dist 15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 "*Average distance that mouse will be moved when approached by cursor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 Only applies in mouse-avoidance-mode `jump' and its derivatives.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 For best results make this larger than `mouse-avoidance-threshold'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (defvar mouse-avoidance-nudge-var 10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 "*Variability of `mouse-avoidance-nudge-dist' (which see).")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (defvar mouse-avoidance-animation-delay .01
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 "Delay between animation steps, in seconds.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (defvar mouse-avoidance-threshold 5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 "*Mouse-pointer's flight distance.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 If the cursor gets closer than this, the mouse pointer will move away.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 Only applies in mouse-avoidance-modes `animate' and `jump'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;; Internal variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (defvar mouse-avoidance-state nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (defvar mouse-avoidance-pointer-shapes nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (defvar mouse-avoidance-n-pointer-shapes 0)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
101 (defvar mouse-avoidance-old-pointer-shape nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ;;; Functions:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
105 (defsubst mouse-avoidance-set-pointer-shape (shape)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
106 "Set the shape of the mouse pointer to SHAPE."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
107 (setq x-pointer-shape shape)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
108 (set-mouse-color nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
109
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
110 ;; XEmacs change -- this is so ugly. [FSF version is totally different -sb]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (defun mouse-avoidance-point-position ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 "Returns (WINDOW X . Y) of current point - analogous to mouse-position"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (let* ((beg (window-start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (pos (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (col (current-column))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (row))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (setq row (count-lines beg pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (cons (selected-window) (cons col row))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;(defun mouse-avoidance-point-position-test ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ; (interactive)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 14
diff changeset
122 ; (message "point=%s mouse=%s"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 14
diff changeset
123 ; (cdr (mouse-avoidance-point-position))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 14
diff changeset
124 ; (cdr (mouse-position))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (defun mouse-avoidance-set-mouse-position (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ;; Carefully set mouse position to given position (X . Y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;; Ideally, should check if X,Y is in the current frame, and if not,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ;; leave the mouse where it was. However, this is currently
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ;; difficult to do, so we just raise the frame to avoid frame switches.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;; Returns t if it moved the mouse.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (let ((f (selected-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (raise-frame f)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
134 ;; XEmacs: FSF version of set-mouse-position requires FRAME parameter
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (set-mouse-position (frame-selected-window f) (car pos) (cdr pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (defun mouse-avoidance-too-close-p (mouse)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;; Return t if mouse pointer and point cursor are too close.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ;; Acceptable distance is defined by mouse-avoidance-threshold.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (let ((point (mouse-avoidance-point-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (and (eq (car mouse) (car point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (car (cdr mouse))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (< (abs (- (car (cdr mouse)) (car (cdr point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 mouse-avoidance-threshold)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (< (abs (- (cdr (cdr mouse)) (cdr (cdr point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 mouse-avoidance-threshold))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (defun mouse-avoidance-banish-destination ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 "The position to which mouse-avoidance-mode `banish' moves the mouse.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 You can redefine this if you want the mouse banished to a different corner."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (cons (1- (frame-width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (defun mouse-avoidance-banish-mouse ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 ;; Put the mouse pointer in the upper-right corner of the current frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (mouse-avoidance-set-mouse-position (mouse-avoidance-banish-destination)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (defsubst mouse-avoidance-delta (cur delta dist var min max)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ;; Decide how far to move in either dimension.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ;; Args are the CURRENT location, the desired DELTA for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ;; warp-conservation, the DISTANCE we like to move, the VARIABILITY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ;; in distance allowed, and the MIN and MAX possible window positions.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
164 ;; Returns something as close to DELTA as possible within the constraints.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (let ((L1 (max (- min cur) (+ (- dist) (- var))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (R1 (+ (- dist) var ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (L2 (+ dist (- var)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (R2 (min (- max cur) (+ dist var))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (if (< R1 (- min cur)) (setq L1 nil R1 nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (if (> L2 (- max cur)) (setq L2 nil R2 nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (cond ((and L1 (< delta L1)) L1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ((and R1 (< delta R1)) delta)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ((and R1 (< delta 0)) R1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ((and L2 (< delta L2)) L2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ((and R2 (< delta R2)) delta)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (R2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ((or R1 L2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (t 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (defun mouse-avoidance-nudge-mouse ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ;; Push the mouse a little way away, possibly animating the move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ;; For these modes, state keeps track of the total offset that we've
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ;; accumulated, and tries to keep it close to zero.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (let* ((cur (mouse-position))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
185 (cur-frame (car cur))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (cur-pos (cdr cur))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (deltax (mouse-avoidance-delta
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (car cur-pos) (- (random mouse-avoidance-nudge-var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (car mouse-avoidance-state))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 mouse-avoidance-nudge-dist mouse-avoidance-nudge-var
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 0 (frame-width)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (deltay (mouse-avoidance-delta
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (cdr cur-pos) (- (random mouse-avoidance-nudge-var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (cdr mouse-avoidance-state))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 mouse-avoidance-nudge-dist mouse-avoidance-nudge-var
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
196 0 (frame-height))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (setq mouse-avoidance-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (cons (+ (car mouse-avoidance-state) deltax)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (+ (cdr mouse-avoidance-state) deltay)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (if (or (eq mouse-avoidance-mode 'animate)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (eq mouse-avoidance-mode 'proteus))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (let ((i 0.0)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
203 ;; XEmacs change
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (color (cdr (assoc 'mouse-color (frame-parameters)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (while (<= i 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (mouse-avoidance-set-mouse-position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (cons (+ (car cur-pos) (round (* i deltax)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (+ (cdr cur-pos) (round (* i deltay)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (setq i (+ i (max .1 (/ 1.0 mouse-avoidance-nudge-dist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (if (eq mouse-avoidance-mode 'proteus)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
211 ;; XEmacs change
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (setq x-pointer-shape (mouse-avoidance-random-shape))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (set-mouse-color color)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (sit-for mouse-avoidance-animation-delay)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (mouse-avoidance-set-mouse-position (cons (+ (car (cdr cur)) deltax)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (+ (cdr (cdr cur)) deltay))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (defun mouse-avoidance-random-shape ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 "Return a random cursor shape.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 This assumes that any variable whose name begins with x-pointer- and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 has an integer value is a valid cursor shape. You might want to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 redefine this function to suit your own tastes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (if (null mouse-avoidance-pointer-shapes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (setq mouse-avoidance-pointer-shapes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (mapcar '(lambda (x) (symbol-value (intern x)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (all-completions "x-pointer-" obarray
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 '(lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (and (boundp x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (integerp (symbol-value x)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (setq mouse-avoidance-n-pointer-shapes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (length mouse-avoidance-pointer-shapes))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (nth (random mouse-avoidance-n-pointer-shapes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 mouse-avoidance-pointer-shapes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (defun mouse-avoidance-banish-hook ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (if (and (not executing-kbd-macro) ; don't check inside macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (mouse-avoidance-kbd-command (this-command-keys)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (mouse-avoidance-banish-mouse)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (defun mouse-avoidance-exile-hook ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ;; For exile mode, the state is nil when the mouse is in its normal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;; position, and set to the old mouse-position when the mouse is in exile.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (if (and (not executing-kbd-macro)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (mouse-avoidance-kbd-command (this-command-keys)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (let ((mp (mouse-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (cond ((and (not mouse-avoidance-state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (mouse-avoidance-too-close-p mp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (setq mouse-avoidance-state mp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (mouse-avoidance-banish-mouse))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ((and mouse-avoidance-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (not (mouse-avoidance-too-close-p mouse-avoidance-state)))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
254 ;; XEmacs change
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (if (and (eq (car mp) (if (< emacs-minor-version 12)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (equal (cdr mp) (mouse-avoidance-banish-destination)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (mouse-avoidance-set-mouse-position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ;; move back only if user has not moved mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (cdr mouse-avoidance-state)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;; but clear state anyway, to be ready for another move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (setq mouse-avoidance-state nil))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (defun mouse-avoidance-fancy-hook ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ;; Used for the "fancy" modes, ie jump et al.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (if (and (not executing-kbd-macro) ; don't check inside macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (mouse-avoidance-kbd-command (this-command-keys))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (mouse-avoidance-too-close-p (mouse-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (let ((old-pos (mouse-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (mouse-avoidance-nudge-mouse)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
272 ;; XEmacs change
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (if (not (eq (if (< emacs-minor-version 12)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (selected-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (selected-window)) (car old-pos))) ; move went awry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (set-mouse-position (car old-pos) ; sigh..
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (car (cdr old-pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (cdr (cdr old-pos)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (defun mouse-avoidance-kbd-command (key)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 "Return t if the KEYSEQENCE is composed of keyboard events only.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 Return nil if there are any lists in the key sequence."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (cond ((null key) nil) ; Null event seems to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ; returned occasionally.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 ((not (vectorp key)) t) ; Strings are keyboard events.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ((catch 'done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (let ((i 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (l (length key)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (while (< i l)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (if (listp (aref key i))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (throw 'done nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (setq i (1+ i))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
295 ;;;###autoload
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (defun mouse-avoidance-mode (&optional mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 "Set cursor avoidance mode to MODE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 MODE should be one of the symbols `banish', `exile', `jump', `animate',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 `cat-and-mouse', `proteus', or `none'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 If MODE is nil, toggle mouse avoidance between `none` and `banish'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 modes. Positive numbers and symbols other than the above are treated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 as equivalent to `banish'; negative numbers and `-' are equivalent to `none'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 Effects of the different modes:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 * banish: Move the mouse to the upper-right corner on any keypress.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 * exile: Move the mouse to the corner only if the cursor gets too close,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 and allow it to return once the cursor is out of the way.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 * jump: If the cursor gets too close to the mouse, displace the mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 a random distance & direction.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 * animate: As `jump', but shows steps along the way for illusion of motion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 * cat-and-mouse: Same as `animate'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 * proteus: As `animate', but changes the shape of the mouse pointer too.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 Whenever the mouse is moved, the frame is also raised.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 \(see `mouse-avoidance-threshold' for definition of \"too close\",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 definition of \"random distance\".)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (list (intern (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 "Select cursor avoidance technique (SPACE for list): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 '(("banish") ("exile") ("jump") ("animate")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 ("cat-and-mouse") ("proteus") ("none"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 nil t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (if (eq mode 'cat-and-mouse)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (setq mode 'animate))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
328 ;; XEmacs change - We don't have post-command-idle-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
329 (remove-hook 'post-command-hook 'mouse-avoidance-banish-hook)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
330 (remove-hook 'post-command-hook 'mouse-avoidance-exile-hook)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
331 (remove-hook 'post-command-hook 'mouse-avoidance-fancy-hook)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
332 ;; Restore pointer shape if necessary
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
333 (if (eq mouse-avoidance-mode 'proteus)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
334 (mouse-avoidance-set-pointer-shape mouse-avoidance-old-pointer-shape))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
335
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
336 ;; Do additional setup depending on version of mode requested
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (cond ((eq mode 'none)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (setq mouse-avoidance-mode nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 ((or (eq mode 'jump)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (eq mode 'animate)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (eq mode 'proteus))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
342 ;; XEmacs: we don't have post-command-idle-hook
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (add-hook 'post-command-hook 'mouse-avoidance-fancy-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (setq mouse-avoidance-mode mode
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
345 mouse-avoidance-state (cons 0 0)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
346 mouse-avoidance-old-pointer-shape x-pointer-shape))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 ((eq mode 'exile)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
348 ;; XEmacs: FSF uses post-command-idle-hook
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (add-hook 'post-command-hook 'mouse-avoidance-exile-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (setq mouse-avoidance-mode mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 mouse-avoidance-state nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 ((or (eq mode 'banish)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (eq mode t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (and (null mode) (null mouse-avoidance-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (and mode (> (prefix-numeric-value mode) 0)))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
356 ;; XEmacs: FSF uses post-command-idle-hook
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (add-hook 'post-command-hook 'mouse-avoidance-banish-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (setq mouse-avoidance-mode 'banish))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (t (setq mouse-avoidance-mode nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (force-mode-line-update))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 ;(or (assq 'mouse-avoidance-mode minor-mode-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 ; (setq minor-mode-alist (cons '(mouse-avoidance-mode " Avoid")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 ; minor-mode-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 ;;XEmacs: do it right.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (add-minor-mode 'mouse-avoidance-mode " Avoid")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 14
diff changeset
369 ;;; End of avoid.el