annotate lisp/modeline.el @ 209:41ff10fd062f r20-4b3

Import from CVS: tag r20-4b3
author cvs
date Mon, 13 Aug 2007 10:04:58 +0200
parents
children 12579d965149
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1 ;;; modeline.el --- modeline hackery.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
2
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
3 ;; Copyright (C) 1988, 1992-1994, 1997 Free Software Foundation, Inc.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995, 1996 Ben Wing.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
5
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
6 ;; Maintainer: XEmacs Development Team
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
7 ;; Keywords: extensions, dumped
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
8
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
10
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
14 ;; any later version.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
15
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
19 ;; General Public License for more details.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
20
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
23 ;; Free Software Foundation, 59 Temple Place - Suite 330,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
25
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
26 ;;; Synched up with: Not in FSF.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
27
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
28 ;;; Commentary:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
29
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
30 ;; This file is dumped with XEmacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
31
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
32 ;;; Code:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
33
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
35 ;;; General mouse modeline stuff ;;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
36 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
37
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
38 (defgroup modeline nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
39 "Modeline customizations"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
40 :group 'environment)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
41
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
42 (defcustom drag-modeline-event-lag 150
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
43 "*The pause (in msecs) between drag modeline events before redisplaying.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
44 If this value is too small, dragging will be choppy because redisplay cannot
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
45 keep up. If it is too large, dragging will be choppy because of the explicit
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
46 redisplay delay specified."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
47 :type 'integer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
48 :group 'modeline)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
49
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
50 (defcustom modeline-click-swaps-buffers nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
51 "*If non-nil, clicking on the modeline changes the current buffer.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
52 Click on the left half of the modeline cycles forward through the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
53 buffer list and clicking on the right half cycles backward."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
54 :type 'boolean
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
55 :group 'modeline)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
56
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
57 (defun mouse-drag-modeline (event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
58 "Resize a window by dragging its modeline.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
59 This command should be bound to a button-press event in modeline-map.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
60 Holding down a mouse button and moving the mouse up and down will
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
61 make the clicked-on window taller or shorter."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
62 (interactive "e")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
63 (or (button-press-event-p event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
64 (error "%s must be invoked by a mouse-press" this-command))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
65 (or (event-over-modeline-p event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
66 (error "not over a modeline"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
67 (let ((done nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
68 (depress-line (event-y event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
69 (start-event-frame (event-frame event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
70 (start-event-window (event-window event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
71 (start-nwindows (count-windows t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
72 (last-timestamp 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
73 default-line-height
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
74 modeline-height
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
75 should-enlarge-minibuffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
76 event min-height minibuffer y top bot edges wconfig growth)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
77 (setq minibuffer (minibuffer-window start-event-frame)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
78 default-line-height (face-height 'default start-event-window)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
79 min-height (+ (* window-min-height default-line-height)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
80 ;; Don't let the window shrink by a
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
81 ;; non-multiple of the default line
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
82 ;; height. (enlarge-window -1) will do
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
83 ;; this if the difference between the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
84 ;; current window height and the minimum
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
85 ;; window height is less than the height
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
86 ;; of the default font. These extra
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
87 ;; lost pixels of height don't come back
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
88 ;; if you grow the window again. This
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
89 ;; can make it impossible to drag back
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
90 ;; to the exact original size, which is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
91 ;; disconcerting.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
92 (% (window-pixel-height start-event-window)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
93 default-line-height))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
94 modeline-height
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
95 (if (specifier-instance has-modeline-p start-event-window)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
96 (+ (face-height 'modeline start-event-window)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
97 (* 2 (specifier-instance modeline-shadow-thickness
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
98 start-event-window)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
99 (* 2 (specifier-instance modeline-shadow-thickness
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
100 start-event-window))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
101 (if (not (eq (window-frame minibuffer) start-event-frame))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
102 (setq minibuffer nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
103 (if (and (null minibuffer) (one-window-p t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
104 (error "Attempt to resize sole window"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
105 ;; if this is the bottommost ordinary window, then to
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
106 ;; move its modeline the minibuffer must be enlarged.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
107 (setq should-enlarge-minibuffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
108 (and minibuffer (window-lowest-p start-event-window)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
109 ;; loop reading events
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
110 (while (not done)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
111 (setq event (next-event event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
112 ;; requeue event and quit if this is a misc-user, eval or
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
113 ;; keypress event.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
114 ;; quit if this is a button press or release event, or if the event
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
115 ;; occurred in some other frame.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
116 ;; drag if this is a mouse motion event and the time
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
117 ;; between this event and the last event is greater than
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
118 ;; drag-modeline-event-lag.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
119 ;; do nothing if this is any other kind of event.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
120 (cond ((or (misc-user-event-p event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
121 (key-press-event-p event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
122 (setq unread-command-events (nconc unread-command-events
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
123 (list event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
124 done t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
125 ((button-release-event-p event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
126 (setq done t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
127 (if modeline-click-swaps-buffers
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
128 (mouse-release-modeline event depress-line)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
129 ((button-event-p event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
130 (setq done t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
131 ((not (motion-event-p event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
132 (dispatch-event event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
133 ((not (eq start-event-frame (event-frame event)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
134 (setq done t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
135 ((< (abs (- (event-timestamp event) last-timestamp))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
136 drag-modeline-event-lag)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
137 nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
138 (t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
139 (setq last-timestamp (event-timestamp event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
140 y (event-y-pixel event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
141 edges (window-pixel-edges start-event-window)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
142 top (nth 1 edges)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
143 bot (nth 3 edges))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
144 ;; scale back a move that would make the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
145 ;; window too short.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
146 (cond ((< (- y top (- modeline-height)) min-height)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
147 (setq y (+ top min-height (- modeline-height)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
148 ;; compute size change needed
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
149 (setq growth (- y bot (/ (- modeline-height) 2))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
150 wconfig (current-window-configuration))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
151 ;; grow/shrink minibuffer?
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
152 (if should-enlarge-minibuffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
153 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
154 ;; yes. scale back shrinkage if it
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
155 ;; would make the minibuffer less than 1
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
156 ;; line tall.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
157 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
158 ;; also flip the sign of the computed growth,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
159 ;; since if we want to grow the window with the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
160 ;; modeline we need to shrink the minibuffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
161 ;; and vice versa.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
162 (if (and (> growth 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
163 (< (- (window-pixel-height minibuffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
164 growth)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
165 default-line-height))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
166 (setq growth
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
167 (- (window-pixel-height minibuffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
168 default-line-height)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
169 (setq growth (- growth))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
170 ;; window grow and shrink by lines not pixels, so
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
171 ;; divide the pixel height by the height of the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
172 ;; default face.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
173 (setq growth (/ growth default-line-height))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
174 ;; grow/shrink the window
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
175 (enlarge-window growth nil (if should-enlarge-minibuffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
176 minibuffer
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
177 start-event-window))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
178 ;; if this window's growth caused another
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
179 ;; window to be deleted because it was too
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
180 ;; short, rescind the change.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
181 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
182 ;; if size change caused space to be stolen
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
183 ;; from a window above this one, rescind the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
184 ;; change, but only if we didn't grow/shrink
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
185 ;; the minibuffer. minibuffer size changes
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
186 ;; can cause all windows to shrink... no way
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
187 ;; around it.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
188 (if (or (/= start-nwindows (count-windows t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
189 (and (not should-enlarge-minibuffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
190 (/= top (nth 1 (window-pixel-edges
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
191 start-event-window)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
192 (set-window-configuration wconfig)))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
193
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
194 ;; from Bob Weiner (bob_weiner@pts.mot.com)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
195 (defun mouse-release-modeline (event line-num)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
196 "Handle modeline click EVENT on LINE-NUM by switching buffers.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
197 If click on left half of a frame's modeline, bury current buffer.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
198 If click on right half of a frame's modeline, raise bottommost buffer.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
199 Args are: EVENT, the mouse release event, and LINE-NUM, the line number
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
200 within the frame at which the mouse was first depressed."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
201 (if (= line-num (event-y event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
202 ;; Button press and release are at same line, treat this as
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
203 ;; a click and switch buffers.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
204 (if (< (event-x event) (/ (window-width (event-window event)) 2))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
205 ;; On left half of modeline, bury current buffer,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
206 ;; displaying second buffer on list.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
207 (mouse-bury-buffer event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
208 ;; On right half of modeline, raise and display bottommost
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
209 ;; buffer in buffer list.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
210 (mouse-unbury-buffer event))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
211
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
212 (defconst modeline-menu
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
213 '("Window Commands"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
214 ["Delete Window Above" delete-window t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
215 ["Delete Other Windows" delete-other-windows t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
216 ["Split Window Above" split-window-vertically t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
217 ["Split Window Horizontally" split-window-horizontally t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
218 ["Balance Windows" balance-windows t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
219 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
220
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
221 (defun modeline-menu (event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
222 (interactive "e")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
223 (popup-menu-and-execute-in-window
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
224 (cons (format "Window Commands for %S:"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
225 (buffer-name (event-buffer event)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
226 (cdr modeline-menu))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
227 event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
228
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
229 (defvar modeline-map (make-sparse-keymap 'modeline-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
230 "Keymap consulted for mouse-clicks on the modeline of a window.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
231 This variable may be buffer-local; its value will be looked up in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
232 the buffer of the window whose modeline was clicked upon.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
233
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
234 (define-key modeline-map 'button1 'mouse-drag-modeline)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
235 ;; button2 selects the window without setting point
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
236 (define-key modeline-map 'button2 (lambda () (interactive "@")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
237 (define-key modeline-map 'button3 'modeline-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
238
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
239 (make-face 'modeline-mousable "Face for mousable portions of the modeline.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
240 (set-face-parent 'modeline-mousable 'modeline)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
241 (when (featurep 'x)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
242 (set-face-foreground 'modeline-mousable "firebrick" 'global '(color x))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
243 (set-face-font 'modeline-mousable [bold] nil '(mono x))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
244 (set-face-font 'modeline-mousable [bold] nil '(grayscale x)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
245
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
246 (defmacro make-modeline-command-wrapper (command)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
247 `#'(lambda (event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
248 (interactive "e")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
249 (save-selected-window
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
250 (select-window (event-window event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
251 (call-interactively ',(eval command)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
252
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
253 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
254 ;;; Minor modes ;;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
255 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
256
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
257 (defvar minor-mode-alist nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
258 "Alist saying how to show minor modes in the modeline.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
259 Each element looks like (VARIABLE STRING);
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
260 STRING is included in the modeline iff VARIABLE's value is non-nil.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
261
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
262 Actually, STRING need not be a string; any possible modeline element
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
263 is okay. See `modeline-format'.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
264
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
265 ;; Used by C code (lookup-key and friends) but defined here.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
266 (defvar minor-mode-map-alist nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
267 "Alist of keymaps to use for minor modes.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
268 Each element looks like (VARIABLE . KEYMAP); KEYMAP is used to read
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
269 key sequences and look up bindings iff VARIABLE's value is non-nil.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
270 If two active keymaps bind the same key, the keymap appearing earlier
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
271 in the list takes precedence.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
272
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
273 (make-face 'modeline-mousable-minor-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
274 "Face for mousable minor-mode strings in the modeline.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
275 (set-face-parent 'modeline-mousable-minor-mode 'modeline-mousable)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
276 (when (featurep 'x)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
277 (set-face-foreground 'modeline-mousable-minor-mode
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
278 '(((color x) . "green4")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
279 ((color x) . "forestgreen")) 'global))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
280
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
281 (defvar modeline-mousable-minor-mode-extent (make-extent nil nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
282 ;; alliteration at its finest.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
283 "Extent managing the mousable minor mode modeline strings.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
284 (set-extent-face modeline-mousable-minor-mode-extent
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
285 'modeline-mousable-minor-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
286
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
287 ;; This replaces the idiom
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
288 ;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
289 ;; (or (assq 'isearch-mode minor-mode-alist)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
290 ;; (setq minor-mode-alist
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
291 ;; (purecopy
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
292 ;; (append minor-mode-alist
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
293 ;; '((isearch-mode isearch-mode))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
294
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
295 (defvar place)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
296 (defun add-minor-mode (toggle name &optional keymap after toggle-fun)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
297 "Add a minor mode to `minor-mode-alist' and `minor-mode-map-alist'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
298 TOGGLE is a symbol whose value as a variable specifies whether the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
299 minor mode is active. NAME is the name that should appear in the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
300 modeline (it should either be a string beginning with a space or a
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
301 symbol). KEYMAP is a keymap to make active when the minor mode is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
302 active. AFTER is the toggling symbol used for another minor mode. If
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
303 AFTER is non-nil, then it is used to position the new mode in the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
304 minor-mode alists. TOGGLE-FUN specifies an interactive function that
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
305 is called to toggle the mode on and off; this affects what happens
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
306 when button2 is pressed on the mode, and when button3 is pressed
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
307 somewhere in the list of modes. If TOGGLE-FUN is nil and TOGGLE names
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
308 an interactive function, TOGGLE is used as the toggle function.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
309
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
310 Example: (add-minor-mode 'view-minor-mode \" View\" view-mode-map)"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
311 (let (el place
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
312 (add-elt #'(lambda (elt sym)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
313 (cond ((null after) ; add to front
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
314 (set sym (cons elt (symbol-value sym))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
315 ((and (not (eq after t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
316 (setq place (memq (assq after
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
317 (symbol-value sym))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
318 (symbol-value sym))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
319 (setq elt (cons elt (cdr place)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
320 (setcdr place elt))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
321 (t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
322 (set sym (append (symbol-value sym) (list elt))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
323 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
324 (symbol-value sym)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
325 toggle-keymap)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
326 (if toggle-fun
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
327 (if (not (commandp toggle-fun))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
328 (error "not an interactive function: %S" toggle-fun))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
329 (if (commandp toggle)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
330 (setq toggle-fun toggle)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
331 (if (and toggle-fun name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
332 (progn
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
333 (setq toggle-keymap (make-sparse-keymap
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
334 (intern (concat "modeline-minor-"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
335 (symbol-name toggle)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
336 "-map"))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
337 (define-key toggle-keymap 'button2
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
338 ;; defeat the DUMB-ASS byte-compiler, which tries to
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
339 ;; expand the macro at compile time and fucks up.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
340 (eval '(make-modeline-command-wrapper toggle-fun)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
341 (put toggle 'modeline-toggle-function toggle-fun)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
342 (and name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
343 (let ((hacked-name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
344 (if toggle-keymap
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
345 (cons (let ((extent (make-extent nil nil)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
346 (set-extent-keymap extent toggle-keymap)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
347 (set-extent-property
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
348 extent 'help-echo
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
349 (concat "button2 turns off "
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
350 (if (symbolp toggle-fun)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
351 (symbol-name toggle-fun)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
352 (symbol-name toggle))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
353 extent)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
354 (cons
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
355 modeline-mousable-minor-mode-extent
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
356 name))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
357 name)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
358 (if (setq el (assq toggle minor-mode-alist))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
359 (setcdr el (list hacked-name))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
360 (funcall add-elt
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
361 (list toggle hacked-name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
362 'minor-mode-alist))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
363 (and keymap
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
364 (if (setq el (assq toggle minor-mode-map-alist))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
365 (setcdr el keymap)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
366 (funcall add-elt
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
367 (cons toggle keymap)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
368 'minor-mode-map-alist)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
369 ))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
370
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
371 (add-minor-mode 'abbrev-mode " Abbrev")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
372 (add-minor-mode 'overwrite-mode 'overwrite-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
373 (add-minor-mode 'auto-fill-function " Fill" nil nil 'auto-fill-mode)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
374 ;; not really a minor mode...
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
375 (add-minor-mode 'defining-kbd-macro " Def")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
376
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
377 (defun modeline-minor-mode-menu (event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
378 (interactive "e")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
379 (save-excursion
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
380 (set-buffer (event-buffer event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
381 (popup-menu-and-execute-in-window
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
382 (cons (format "Minor Mode Commands for %S:"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
383 (buffer-name (event-buffer event)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
384 (apply 'nconc
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
385 (mapcar
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
386 #'(lambda (x)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
387 (let* ((toggle-sym (car x))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
388 (toggle-fun
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
389 (or (get toggle-sym
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
390 'modeline-toggle-function)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
391 (and (fboundp toggle-sym)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
392 (commandp toggle-sym)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
393 toggle-sym))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
394 (if (not toggle-fun) nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
395 (list (vector
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
396 (concat (if (and (boundp toggle-sym)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
397 (symbol-value toggle-sym))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
398 "turn off " "turn on ")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
399 (if (symbolp toggle-fun)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
400 (symbol-name toggle-fun)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
401 (symbol-name toggle-sym)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
402
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
403 toggle-fun
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
404 t)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
405 minor-mode-alist)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
406 event)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
407
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
408 (defvar modeline-minor-mode-map (make-sparse-keymap 'modeline-minor-mode-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
409 "Keymap consulted for mouse-clicks on the minor-mode modeline list.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
410 (define-key modeline-minor-mode-map 'button3 'modeline-minor-mode-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
411
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
412 (defvar modeline-minor-mode-extent (make-extent nil nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
413 "Extent covering the minor mode modeline strings.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
414 (set-extent-face modeline-minor-mode-extent 'modeline-mousable)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
415 (set-extent-keymap modeline-minor-mode-extent modeline-minor-mode-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
416
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
417
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
418 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
419 ;;; Other ;;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
420 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
421
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
422 (defun modeline-buffers-menu (event)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
423 (interactive "e")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
424 (popup-menu-and-execute-in-window
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
425 '("Buffers Popup Menu"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
426 :filter buffers-menu-filter
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
427 ["List All Buffers" list-buffers t]
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
428 "--"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
429 )
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
430 event))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
431
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
432 (defvar modeline-buffer-id-left-map
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
433 (make-sparse-keymap 'modeline-buffer-id-left-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
434 "Keymap consulted for mouse-clicks on the left half of the buffer-id string.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
435
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
436 (defvar modeline-buffer-id-right-map
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
437 (make-sparse-keymap 'modeline-buffer-id-right-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
438 "Keymap consulted for mouse-clicks on the right half of the buffer-id string.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
439
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
440 (define-key modeline-buffer-id-left-map 'button2 'mouse-unbury-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
441 (define-key modeline-buffer-id-right-map 'button2 'mouse-bury-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
442 (define-key modeline-buffer-id-left-map 'button3 'modeline-buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
443 (define-key modeline-buffer-id-right-map 'button3 'modeline-buffers-menu)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
444
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
445 (make-face 'modeline-buffer-id
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
446 "Face for the buffer ID string in the modeline.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
447 (set-face-parent 'modeline-buffer-id 'modeline)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
448 (when (featurep 'x)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
449 (set-face-foreground 'modeline-buffer-id "blue4" 'global '(color x)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
450 (when (featurep 'x)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
451 (set-face-font 'modeline-buffer-id [bold-italic] nil '(mono x))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
452 (set-face-font 'modeline-buffer-id [bold-italic] nil '(grayscale x)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
453 (when (featurep 'tty)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
454 (set-face-font 'modeline-buffer-id [bold-italic] nil 'tty))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
455
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
456 (defvar modeline-buffer-id-extent (make-extent nil nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
457 "Extent covering the whole of the buffer-id string.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
458 (set-extent-face modeline-buffer-id-extent 'modeline-buffer-id)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
459
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
460 (defvar modeline-buffer-id-left-extent (make-extent nil nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
461 "Extent covering the left half of the buffer-id string.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
462 (set-extent-keymap modeline-buffer-id-left-extent
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
463 modeline-buffer-id-left-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
464 (set-extent-property modeline-buffer-id-left-extent 'help-echo
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
465 "button2 cycles to the previous buffer")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
466
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
467 (defvar modeline-buffer-id-right-extent (make-extent nil nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
468 "Extent covering the right half of the buffer-id string.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
469 (set-extent-keymap modeline-buffer-id-right-extent
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
470 modeline-buffer-id-right-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
471 (set-extent-property modeline-buffer-id-right-extent 'help-echo
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
472 "button2 cycles to the next buffer")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
473
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
474 (defconst modeline-buffer-identification
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
475 (list (cons modeline-buffer-id-left-extent (purecopy "XEmacs%N:"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
476 ; this used to be "XEmacs:"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
477 (cons modeline-buffer-id-right-extent (purecopy " %17b")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
478 "Modeline control for identifying the buffer being displayed.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
479 Its default value is \"XEmacs: %17b\" (NOT!). Major modes that edit things
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
480 other than ordinary files may change this (e.g. Info, Dired,...)")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
481 (make-variable-buffer-local 'modeline-buffer-identification)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
482
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
483 (defconst modeline-process nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
484 "Modeline control for displaying info on process status.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
485 Normally nil in most modes, since there is no process to display.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
486 (make-variable-buffer-local 'modeline-process)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
487
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
488 (defvar modeline-modified-map (make-sparse-keymap 'modeline-modified-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
489 "Keymap consulted for mouse-clicks on the modeline-modified string.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
490 (define-key modeline-modified-map 'button2
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
491 (make-modeline-command-wrapper 'modeline-toggle-read-only))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
492
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
493 (defvar modeline-modified-extent (make-extent nil nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
494 "Extent covering the modeline-modified string.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
495 (set-extent-face modeline-modified-extent 'modeline-mousable)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
496 (set-extent-keymap modeline-modified-extent modeline-modified-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
497 (set-extent-property modeline-modified-extent 'help-echo
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
498 "button2 toggles the buffer's read-only status")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
499
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
500 (defconst modeline-modified (purecopy '("--%1*%1+-"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
501 "Modeline control for displaying whether current buffer is modified.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
502 (make-variable-buffer-local 'modeline-modified)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
503
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
504 (defvar modeline-narrowed-map (make-sparse-keymap 'modeline-narrowed-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
505 "Keymap consulted for mouse-clicks on the modeline-narrowed string.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
506 (define-key modeline-narrowed-map 'button2
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
507 (make-modeline-command-wrapper 'widen))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
508
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
509 (defvar modeline-narrowed-extent (make-extent nil nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
510 "Extent covering the modeline-narrowed string.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
511 (set-extent-face modeline-narrowed-extent 'modeline-mousable)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
512 (set-extent-keymap modeline-narrowed-extent modeline-narrowed-map)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
513 (set-extent-property modeline-narrowed-extent 'help-echo
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
514 "button2 widens the buffer")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
515
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
516 (setq-default
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
517 modeline-format
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
518 (list
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
519 (purecopy "")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
520 (cons modeline-modified-extent 'modeline-modified)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
521 (cons modeline-buffer-id-extent 'modeline-buffer-identification)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
522 (purecopy " ")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
523 'global-mode-string
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
524 (purecopy " %[(")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
525 (cons modeline-minor-mode-extent (list "" 'mode-name 'minor-mode-alist))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
526 (cons modeline-narrowed-extent "%n")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
527 'modeline-process
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
528 (purecopy ")%]----")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
529 (purecopy '(line-number-mode "L%l--"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
530 (purecopy '(column-number-mode "C%c--"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
531 (purecopy '(-3 . "%p"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
532 (purecopy "-%-")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
533
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
534 ;;; Added for XEmacs 20.3. Provide wrapper for vc since it may not always be
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
535 ;;; present, and its symbols are not visible this early in the dump if it
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
536 ;;; is.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
537
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
538 (defun modeline-toggle-read-only ()
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
539 "Change whether this buffer is visiting its file read-only.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
540 With arg, set read-only iff arg is positive.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
541 This function is designed to be called when the read-only indicator on the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
542 modeline is clicked. It will call `vc-toggle-read-only' if available,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
543 otherwise it will call the usual `toggle-read-only'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
544 (interactive)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
545 (if (fboundp 'vc-toggle-read-only)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
546 (vc-toggle-read-only)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
547 (toggle-read-only)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
548
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
549 ;;; modeline.el ends here