0
|
1 ;;; x-menubar.el --- Menubar and popup-menu support for X.
|
|
2
|
|
3 ;; Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
|
4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
|
|
5 ;; Copyright (C) 1995 Sun Microsystems.
|
|
6 ;; Copyright (C) 1995, 1996 Ben Wing.
|
|
7
|
|
8 ;; This file is part of XEmacs.
|
|
9
|
|
10 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
11 ;; under the terms of the GNU General Public License as published by
|
|
12 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
13 ;; any later version.
|
|
14
|
|
15 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
18 ;; General Public License for more details.
|
|
19
|
|
20 ;; You should have received a copy of the GNU General Public License
|
|
21 ;; along with Xmacs; see the file COPYING. If not, write to the Free
|
|
22 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
23
|
|
24 ;;; Commentary:
|
|
25
|
|
26 ;;; Code:
|
|
27
|
|
28 (defconst default-menubar
|
|
29 (purecopy-menubar
|
|
30 ;; note backquote.
|
|
31 `(
|
|
32 ("File"
|
|
33 :filter file-menu-filter
|
|
34 ["Open..." find-file t]
|
|
35 ["Open in Other Window..." find-file-other-window t]
|
|
36 ["Open in New Frame..." find-file-other-frame t]
|
|
37 ["Insert File..." insert-file t]
|
|
38 ["View File..." view-file t]
|
|
39 "------"
|
|
40 ["Save" save-buffer t nil]
|
|
41 ["Save As..." write-file t]
|
|
42 ["Save Some Buffers" save-some-buffers t]
|
|
43 "-----"
|
|
44 ["Print Buffer" lpr-buffer t nil]
|
|
45 ["Pretty-Print Buffer" ps-print-buffer-with-faces t nil]
|
|
46 "-----"
|
|
47 ["New Frame" make-frame t]
|
|
48 ["Frame on Other Display..."
|
|
49 make-frame-on-display t]
|
|
50 ["Delete Frame" delete-frame t]
|
|
51 "-----"
|
|
52 ["Split Window" split-window-vertically t]
|
|
53 ["Un-Split (Keep This)" delete-other-windows (not (one-window-p t))]
|
|
54 ["Un-Split (Keep Others)" delete-window (not (one-window-p t))]
|
|
55 "-----"
|
|
56 ["Revert Buffer" revert-buffer t nil]
|
|
57 ["Delete Buffer" kill-this-buffer t nil]
|
|
58 "-----"
|
|
59 ["Exit XEmacs" save-buffers-kill-emacs t]
|
|
60 )
|
|
61
|
|
62 ("Edit"
|
|
63 :filter edit-menu-filter
|
|
64 ["Undo" advertised-undo t]
|
|
65 ["Cut" x-kill-primary-selection t]
|
|
66 ["Copy" x-copy-primary-selection t]
|
|
67 ["Paste" x-yank-clipboard-selection t]
|
|
68 ["Clear" x-delete-primary-selection t]
|
|
69 "----"
|
|
70 ["Search..." isearch-forward t]
|
|
71 ["Search Backward..." isearch-backward t]
|
|
72 ["Replace..." query-replace t]
|
|
73 "----"
|
|
74 ["Search (Regexp)..." isearch-forward-regexp t]
|
|
75 ["Search Backward (Regexp)..." isearch-backward-regexp t]
|
|
76 ["Replace (Regexp)..." query-replace-regexp t]
|
|
77 "----"
|
|
78 ("Bookmarks"
|
|
79 ["Jump to bookmark" bookmark-menu-jump t]
|
|
80 ["Set bookmark" bookmark-set t]
|
|
81 "---"
|
|
82 ["Insert contents" bookmark-menu-insert t]
|
|
83 ["Insert location" bookmark-menu-locate t]
|
|
84 "---"
|
|
85 ["Rename bookmark" bookmark-menu-rename t]
|
|
86 ["Delete bookmark" bookmark-menu-delete t]
|
|
87 ["Edit Bookmark List" bookmark-bmenu-list t]
|
|
88 "---"
|
|
89 ["Save bookmarks" bookmark-save t]
|
|
90 ["Save bookmarks as..." bookmark-write t]
|
|
91 ["Load a bookmark file" bookmark-load t])
|
|
92 "----"
|
|
93 ["Goto Line..." goto-line t]
|
|
94 ["What Line" what-line t]
|
|
95 "----"
|
|
96 ["Start Macro Recording" start-kbd-macro (not defining-kbd-macro)]
|
|
97 ["End Macro Recording" end-kbd-macro defining-kbd-macro]
|
|
98 ["Execute Last Macro" call-last-kbd-macro last-kbd-macro]
|
|
99 )
|
|
100
|
|
101 ("Apps"
|
|
102 ["Read Mail (VM)..." vm t]
|
|
103 ["Read Mail (MH)..." (mh-rmail t) t]
|
|
104 ["Send mail..." mail t]
|
|
105 ["Usenet News" gnus t]
|
|
106 ["Browse the Web" w3 t]
|
|
107 ["Gopher" gopher t]
|
|
108 ["Hyperbole..." hyperbole t]
|
|
109 "----"
|
|
110 ["Spell-Check Buffer" ispell-buffer t]
|
|
111 ["Emulate VI" viper-mode t]
|
|
112 "----"
|
|
113 ("Calendar"
|
|
114 ["3-Month Calendar" calendar t]
|
|
115 ["Diary" diary t]
|
|
116 ["Holidays" holidays t]
|
|
117 ;; we're all pagans at heart ...
|
|
118 ["Phases of the Moon" phases-of-moon t]
|
|
119 ["Sunrise/Sunset" sunrise-sunset t]
|
|
120 )
|
|
121 ("Games"
|
|
122 ["Quote from Zippy" yow t]
|
|
123 ["Psychoanalyst" doctor t]
|
|
124 ["Psychoanalyze Zippy!" psychoanalyze-pinhead t]
|
|
125 ["Random Flames" flame t]
|
|
126 ["Dunnet (Adventure)" dunnet t]
|
|
127 ["Towers of Hanoi" hanoi t]
|
|
128 ["Game of Life" life t]
|
|
129 ["Multiplication Puzzle" mpuz t]
|
32
|
130 ["Mine Game" mine t]
|
0
|
131 )
|
|
132 )
|
|
133
|
|
134 ("Options"
|
30
|
135 ,custom-help-menu
|
0
|
136 ["Read Only" (toggle-read-only)
|
|
137 :style toggle :selected buffer-read-only]
|
|
138 ("Editing Options"
|
|
139 ["Overstrike" (progn
|
|
140 (overwrite-mode current-prefix-arg)
|
|
141 (setq-default overwrite-mode overwrite-mode))
|
|
142 :style toggle :selected overwrite-mode]
|
|
143 ["Case Sensitive Search" (progn
|
|
144 (setq case-fold-search (not case-fold-search))
|
|
145 (setq-default case-fold-search
|
|
146 case-fold-search))
|
|
147 :style toggle :selected (not case-fold-search)]
|
|
148 ["Case Matching Replace" (setq case-replace (not case-replace))
|
|
149 :style toggle :selected case-replace]
|
|
150 ["Auto Delete Selection" (if (memq 'pending-delete-pre-hook
|
|
151 pre-command-hook)
|
|
152 (pending-delete-off nil)
|
|
153 (pending-delete-on nil))
|
|
154 :style toggle
|
|
155 :selected (memq 'pending-delete-pre-hook pre-command-hook)]
|
|
156 ["Active Regions" (setq zmacs-regions (not zmacs-regions))
|
|
157 :style toggle :selected zmacs-regions]
|
|
158 ["Mouse Paste At Text Cursor" (setq mouse-yank-at-point
|
|
159 (not mouse-yank-at-point))
|
|
160 :style toggle :selected mouse-yank-at-point]
|
12
|
161 ["Require Newline At End" (setq require-final-newline
|
|
162 (or (eq require-final-newline 'ask)
|
|
163 (not require-final-newline)))
|
|
164 :style toggle :selected (eq require-final-newline 't)]
|
|
165 ["Add Newline When Moving Past End" (setq next-line-add-newlines
|
|
166 (not next-line-add-newlines))
|
|
167 :style toggle :selected next-line-add-newlines]
|
0
|
168 )
|
|
169 ("General Options"
|
|
170 ["Teach Extended Commands" (setq teach-extended-commands-p
|
|
171 (not teach-extended-commands-p))
|
|
172 :style toggle :selected teach-extended-commands-p]
|
|
173 ["Debug On Error" (setq debug-on-error (not debug-on-error))
|
|
174 :style toggle :selected debug-on-error]
|
|
175 ["Debug On Quit" (setq debug-on-quit (not debug-on-quit))
|
|
176 :style toggle :selected debug-on-quit]
|
|
177 )
|
|
178 ("Printing Options"
|
|
179 ["Command-Line Switches for `lpr'/`lp'..."
|
2
|
180 (setq lpr-switches
|
|
181 (read-expression "Switches for `lpr'/`lp': "
|
|
182 (format "%S" lpr-switches)))
|
0
|
183 t]
|
|
184 ("Pretty-Print Paper Size"
|
|
185 ["Letter"
|
16
|
186 (setq ps-paper-type 'letter)
|
|
187 :style radio
|
|
188 :selected (eq ps-paper-type 'letter)]
|
|
189 ["Letter-small"
|
|
190 (setq ps-paper-type 'letter-small)
|
|
191 :style radio
|
|
192 :selected (eq ps-paper-type 'letter-small)]
|
|
193 ["Legal"
|
|
194 (setq ps-paper-type 'legal)
|
0
|
195 :style radio
|
16
|
196 :selected (eq ps-paper-type 'legal)]
|
|
197 ["Statement"
|
|
198 (setq ps-paper-type 'statement)
|
|
199 :style radio
|
|
200 :selected (eq ps-paper-type 'statement)]
|
|
201 ["Executive"
|
|
202 (setq ps-paper-type 'executive)
|
|
203 :style radio
|
|
204 :selected (eq ps-paper-type 'executive)]
|
|
205 ["Tabloid"
|
|
206 (setq ps-paper-type 'tabloid)
|
0
|
207 :style radio
|
16
|
208 :selected (eq ps-paper-type 'tabloid)]
|
|
209 ["Ledger"
|
|
210 (setq ps-paper-type 'ledger)
|
|
211 :style radio
|
|
212 :selected (eq ps-paper-type 'ledger)]
|
|
213 ["A3"
|
|
214 (setq ps-paper-type 'a3)
|
|
215 :style radio
|
|
216 :selected (eq ps-paper-type 'a3)]
|
0
|
217 ["A4"
|
16
|
218 (setq ps-paper-type 'a4)
|
|
219 :style radio
|
|
220 :selected (eq ps-paper-type 'a4)]
|
|
221 ["A4small"
|
|
222 (setq ps-paper-type 'a4small)
|
0
|
223 :style radio
|
16
|
224 :selected (eq ps-paper-type 'a4small)]
|
|
225 ["B4"
|
|
226 (setq ps-paper-type 'b4)
|
|
227 :style radio
|
|
228 :selected (eq ps-paper-type 'b4)]
|
|
229 ["B5"
|
|
230 (setq ps-paper-type 'b5)
|
|
231 :style radio
|
|
232 :selected (eq ps-paper-type 'b5)]
|
0
|
233 )
|
26
|
234 ["Enable Color Printing"
|
|
235 (progn
|
|
236 (set-face-background 'default "white")
|
|
237 (setq ps-print-color-p t))
|
|
238 t]
|
0
|
239 )
|
|
240 ("\"Other Window\" Location"
|
|
241 ["Always in Same Frame"
|
|
242 (setq get-frame-for-buffer-default-instance-limit nil)
|
|
243 :style radio
|
|
244 :selected (null get-frame-for-buffer-default-instance-limit)]
|
|
245 ["Other Frame (2 Frames Max)"
|
|
246 (setq get-frame-for-buffer-default-instance-limit 2)
|
|
247 :style radio
|
|
248 :selected (eq 2 get-frame-for-buffer-default-instance-limit)]
|
|
249 ["Other Frame (3 Frames Max)"
|
|
250 (setq get-frame-for-buffer-default-instance-limit 3)
|
|
251 :style radio
|
|
252 :selected (eq 3 get-frame-for-buffer-default-instance-limit)]
|
|
253 ["Other Frame (4 Frames Max)"
|
|
254 (setq get-frame-for-buffer-default-instance-limit 4)
|
|
255 :style radio
|
|
256 :selected (eq 4 get-frame-for-buffer-default-instance-limit)]
|
|
257 ["Other Frame (5 Frames Max)"
|
|
258 (setq get-frame-for-buffer-default-instance-limit 5)
|
|
259 :style radio
|
|
260 :selected (eq 5 get-frame-for-buffer-default-instance-limit)]
|
|
261 ["Always Create New Frame"
|
|
262 (setq get-frame-for-buffer-default-instance-limit 0)
|
|
263 :style radio
|
|
264 :selected (eq 0 get-frame-for-buffer-default-instance-limit)]
|
|
265 "-----"
|
|
266 ["Temp Buffers Always in Same Frame"
|
|
267 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame)
|
|
268 :style radio
|
|
269 :selected (eq temp-buffer-show-function
|
|
270 'show-temp-buffer-in-current-frame)]
|
|
271 ["Temp Buffers Like Other Buffers"
|
|
272 (setq temp-buffer-show-function nil)
|
|
273 :style radio
|
|
274 :selected (null temp-buffer-show-function)]
|
12
|
275 "-----"
|
|
276 ["Make current frame gnuserv target"
|
|
277 (setq gnuserv-frame
|
|
278 (if (equal gnuserv-frame (selected-frame))
|
|
279 nil
|
|
280 (selected-frame)))
|
|
281 :style radio
|
|
282 :selected (equal gnuserv-frame (selected-frame))]
|
0
|
283 )
|
|
284
|
|
285 "-----"
|
|
286 ("Syntax Highlighting"
|
|
287 ["In This Buffer" (font-lock-mode)
|
|
288 :style toggle :selected font-lock-mode]
|
|
289 ["Automatic" (if (not (featurep 'font-lock))
|
|
290 (progn
|
|
291 (setq font-lock-auto-fontify t)
|
|
292 (require 'font-lock))
|
|
293 (setq font-lock-auto-fontify
|
|
294 (not font-lock-auto-fontify)))
|
|
295 :style toggle
|
|
296 :selected (and (featurep 'font-lock) font-lock-auto-fontify)]
|
|
297 "-----"
|
|
298 ["Fonts" (progn (require 'font-lock)
|
|
299 (font-lock-use-default-fonts)
|
|
300 (setq font-lock-use-fonts t
|
|
301 font-lock-use-colors nil)
|
|
302 (font-lock-mode 1))
|
|
303 :style radio
|
|
304 :selected (and font-lock-mode
|
|
305 font-lock-use-fonts)]
|
|
306 ["Colors" (progn (require 'font-lock)
|
|
307 (font-lock-use-default-colors)
|
|
308 (setq font-lock-use-colors t
|
|
309 font-lock-use-fonts nil)
|
|
310 (font-lock-mode 1))
|
|
311 :style radio
|
|
312 :selected (and font-lock-mode
|
|
313 font-lock-use-colors)]
|
|
314 "-----"
|
|
315 ["Least" (if (or (and (not (integerp font-lock-maximum-decoration))
|
|
316 (not (eq t font-lock-maximum-decoration)))
|
|
317 (and (integerp font-lock-maximum-decoration)
|
|
318 (<= font-lock-maximum-decoration 0)))
|
|
319 nil
|
|
320 (setq font-lock-maximum-decoration nil)
|
|
321 (font-lock-recompute-variables))
|
|
322 :style radio
|
|
323 :active font-lock-mode
|
|
324 :selected (and font-lock-mode
|
|
325 (or (and (not (integerp font-lock-maximum-decoration))
|
|
326 (not (eq t font-lock-maximum-decoration)))
|
|
327 (and (integerp font-lock-maximum-decoration)
|
|
328 (<= font-lock-maximum-decoration 0))))]
|
|
329 ["More" (if (and (integerp font-lock-maximum-decoration)
|
|
330 (= 1 font-lock-maximum-decoration))
|
|
331 nil
|
|
332 (setq font-lock-maximum-decoration 1)
|
|
333 (font-lock-recompute-variables))
|
|
334 :style radio
|
|
335 :active font-lock-mode
|
|
336 :selected (and font-lock-mode
|
|
337 (integerp font-lock-maximum-decoration)
|
|
338 (= 1 font-lock-maximum-decoration))]
|
|
339 ["Even More" (if (and (integerp font-lock-maximum-decoration)
|
|
340 (= 2 font-lock-maximum-decoration))
|
|
341 nil
|
|
342 (setq font-lock-maximum-decoration 2)
|
|
343 (font-lock-recompute-variables))
|
|
344 :style radio
|
|
345 :active font-lock-mode
|
|
346 :selected (and font-lock-mode
|
|
347 (integerp font-lock-maximum-decoration)
|
|
348 (= 2 font-lock-maximum-decoration))]
|
|
349 ["Most" (if (or (eq font-lock-maximum-decoration t)
|
|
350 (and (integerp font-lock-maximum-decoration)
|
|
351 (>= font-lock-maximum-decoration 3)))
|
|
352 nil
|
|
353 (setq font-lock-maximum-decoration t)
|
|
354 (font-lock-recompute-variables))
|
|
355 :style radio
|
|
356 :active font-lock-mode
|
|
357 :selected (and font-lock-mode
|
|
358 (or (eq font-lock-maximum-decoration t)
|
|
359 (and (integerp font-lock-maximum-decoration)
|
|
360 (>= font-lock-maximum-decoration 3))))]
|
|
361 "-----"
|
|
362 ["Lazy" (progn (require 'lazy-lock)
|
|
363 (if (and (boundp 'lazy-lock-mode) lazy-lock-mode)
|
|
364 (progn
|
|
365 (lazy-lock-mode 0)
|
|
366 ;; this shouldn't be necessary so there has to
|
|
367 ;; be a redisplay bug lurking somewhere (or
|
|
368 ;; possibly another event handler bug)
|
12
|
369 (redraw-modeline)
|
|
370 (remove-hook 'font-lock-mode-hook
|
|
371 'turn-on-lazy-lock))
|
0
|
372 (if font-lock-mode
|
|
373 (progn
|
|
374 (lazy-lock-mode 1)
|
12
|
375 (redraw-modeline)
|
|
376 (add-hook 'font-lock-mode-hook
|
|
377 'turn-on-lazy-lock)))))
|
0
|
378 :active font-lock-mode
|
|
379 :style toggle
|
|
380 :selected (and (boundp 'lazy-lock-mode) lazy-lock-mode)]
|
|
381 ["Caching" (progn (require 'fast-lock)
|
|
382 (if fast-lock-mode
|
|
383 (progn
|
|
384 (fast-lock-mode 0)
|
|
385 ;; this shouldn't be necessary so there has to
|
|
386 ;; be a redisplay bug lurking somewhere (or
|
|
387 ;; possibly another event handler bug)
|
|
388 (redraw-modeline))
|
|
389 (if font-lock-mode
|
|
390 (progn
|
|
391 (fast-lock-mode 1)
|
|
392 (redraw-modeline)))))
|
|
393 :active font-lock-mode
|
|
394 :style toggle
|
24
|
395 :selected (and (boundp 'fast-lock-mode) fast-lock-mode)]
|
0
|
396 )
|
|
397 ("Paren Highlighting"
|
|
398 ["None" (paren-set-mode -1)
|
|
399 :style radio :selected (not paren-mode)]
|
|
400 ["Blinking Paren" (paren-set-mode 'blink-paren)
|
|
401 :style radio :selected (eq paren-mode 'blink-paren)]
|
|
402 ["Steady Paren" (paren-set-mode 'paren)
|
|
403 :style radio :selected (eq paren-mode 'paren)]
|
|
404 ["Expression" (paren-set-mode 'sexp)
|
|
405 :style radio :selected (eq paren-mode 'sexp)]
|
|
406 ;;; ["Nested Shading" (paren-set-mode 'nested)
|
|
407 ;;; :style radio :selected (eq paren-mode 'nested)]
|
|
408 )
|
|
409 "-----"
|
|
410 ("Frame Appearance"
|
|
411 ,@(if (featurep 'scrollbar)
|
|
412 '(["Scrollbars" (if (= (specifier-instance scrollbar-width) 0)
|
|
413 (progn
|
|
414 (set-specifier scrollbar-width 15)
|
|
415 (set-specifier scrollbar-height 15))
|
|
416 (set-specifier scrollbar-width 0)
|
|
417 (set-specifier scrollbar-height 0))
|
|
418 :style toggle :selected (> (specifier-instance scrollbar-width) 0)]))
|
|
419 ["3D Modeline"
|
|
420 (progn
|
|
421 (if (zerop (specifier-instance modeline-shadow-thickness))
|
|
422 (set-specifier modeline-shadow-thickness 2)
|
|
423 (set-specifier modeline-shadow-thickness 0))
|
|
424 (redraw-modeline t))
|
|
425 :style toggle :selected
|
|
426 (let ((thickness
|
|
427 (specifier-instance modeline-shadow-thickness)))
|
|
428 (and (integerp thickness)
|
|
429 (> thickness 0)))]
|
|
430 ["Truncate Lines" (progn
|
|
431 (setq truncate-lines (not truncate-lines))
|
|
432 (setq-default truncate-lines truncate-lines))
|
|
433 :style toggle :selected truncate-lines]
|
|
434 ["Bar Cursor" (progn
|
|
435 (setq bar-cursor
|
|
436 (if (not bar-cursor) 2 nil))
|
|
437 (force-cursor-redisplay))
|
|
438 :style toggle :selected bar-cursor]
|
|
439 ["Blinking Cursor" (blink-cursor-mode)
|
|
440 :style toggle
|
|
441 :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)]
|
10
|
442 ["Frame-Local Font Menu" (setq font-menu-this-frame-only-p
|
|
443 (not font-menu-this-frame-only-p))
|
|
444 :style toggle :selected font-menu-this-frame-only-p]
|
0
|
445 ; ["Line Numbers" (line-number-mode nil)
|
|
446 ; :style toggle :selected line-number-mode]
|
|
447 )
|
|
448 ("Menubar Appearance"
|
|
449 ["Buffers Menu Length..."
|
|
450 (progn
|
|
451 (setq buffers-menu-max-size
|
|
452 (read-number
|
|
453 "Enter number of buffers to display (or 0 for unlimited): "))
|
|
454 (if (eq buffers-menu-max-size 0) (setq buffers-menu-max-size nil)))
|
|
455 t]
|
|
456 ["Multi-Operation Buffers Sub-Menus"
|
|
457 (setq complex-buffers-menu-p
|
|
458 (not complex-buffers-menu-p))
|
|
459 :style toggle :selected complex-buffers-menu-p]
|
|
460 ("Buffers Menu Sorting"
|
|
461 ["Most Recently Used"
|
|
462 (progn
|
|
463 (setq buffers-menu-sort-function nil)
|
|
464 (setq buffers-menu-grouping-function nil))
|
|
465 :style radio
|
|
466 :selected (null buffers-menu-sort-function)]
|
|
467 ["Alphabetically"
|
|
468 (progn
|
|
469 (setq buffers-menu-sort-function
|
|
470 'sort-buffers-menu-alphabetically)
|
|
471 (setq buffers-menu-grouping-function nil))
|
|
472 :style radio
|
|
473 :selected (eq 'sort-buffers-menu-alphabetically
|
|
474 buffers-menu-sort-function)]
|
|
475 ["By Major Mode, Then Alphabetically"
|
|
476 (progn
|
|
477 (setq buffers-menu-sort-function
|
|
478 'sort-buffers-menu-by-mode-then-alphabetically)
|
|
479 (setq buffers-menu-grouping-function
|
|
480 'group-buffers-menu-by-mode-then-alphabetically))
|
|
481 :style radio
|
|
482 :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically
|
|
483 buffers-menu-sort-function)])
|
|
484 ["Submenus for Buffer Groups"
|
|
485 (setq buffers-menu-submenus-for-groups-p
|
|
486 (not buffers-menu-submenus-for-groups-p))
|
|
487 :style toggle
|
|
488 :selected buffers-menu-submenus-for-groups-p
|
|
489 :active (not (null buffers-menu-grouping-function))]
|
|
490 "---"
|
|
491 ["Ignore Scaled Fonts" (setq font-menu-ignore-scaled-fonts
|
|
492 (not font-menu-ignore-scaled-fonts))
|
|
493 :style toggle :selected font-menu-ignore-scaled-fonts]
|
|
494 )
|
|
495 ,@(if (featurep 'toolbar)
|
|
496 '(("Toolbar Appearance"
|
|
497 ["Visible" (set-specifier default-toolbar-visible-p
|
|
498 (not (specifier-instance
|
|
499 default-toolbar-visible-p)))
|
|
500 :style toggle
|
|
501 :selected (specifier-instance default-toolbar-visible-p)]
|
|
502 ["Captioned" (set-specifier toolbar-buttons-captioned-p
|
|
503 (not (specifier-instance
|
|
504 toolbar-buttons-captioned-p)))
|
|
505 :style toggle
|
|
506 :selected
|
|
507 (specifier-instance toolbar-buttons-captioned-p)]
|
|
508 ("Default Location"
|
|
509 ["Top" (set-default-toolbar-position 'top)
|
|
510 :style radio :selected (eq (default-toolbar-position) 'top)]
|
|
511 ["Bottom" (set-default-toolbar-position 'bottom)
|
|
512 :style radio :selected (eq (default-toolbar-position) 'bottom)]
|
|
513 ["Left" (set-default-toolbar-position 'left)
|
|
514 :style radio :selected (eq (default-toolbar-position) 'left)]
|
|
515 ["Right" (set-default-toolbar-position 'right)
|
|
516 :style radio :selected (eq (default-toolbar-position) 'right)]
|
|
517 )
|
|
518 )))
|
14
|
519 ("Mouse"
|
|
520 ["Avoid-Text"
|
|
521 (if (equal (device-type) 'x)
|
|
522 (if mouse-avoidance-mode
|
|
523 (mouse-avoidance-mode 'none)
|
|
524 (mouse-avoidance-mode 'banish))
|
|
525 (beep)
|
|
526 (message "This option requires a window system."))
|
|
527 :style toggle :selected (and mouse-avoidance-mode window-system)])
|
0
|
528 ("Open URLs With"
|
|
529 ["Emacs-W3" (setq browse-url-browser-function 'browse-url-w3)
|
|
530 :style radio
|
|
531 :selected (eq browse-url-browser-function 'browse-url-w3)]
|
|
532 ["Netscape" (setq browse-url-browser-function 'browse-url-netscape)
|
|
533 :style radio
|
|
534 :selected (eq browse-url-browser-function 'browse-url-netscape)]
|
|
535 ["Mosaic" (setq browse-url-browser-function 'browse-url-mosaic)
|
|
536 :style radio
|
|
537 :selected (eq browse-url-browser-function 'browse-url-mosaic)]
|
|
538 ["Mosaic (CCI)" (setq browse-url-browser-function 'browse-url-cci)
|
|
539 :style radio
|
|
540 :selected (eq browse-url-browser-function 'browse-url-iximosaic)]
|
|
541 ["IXI Mosaic" (setq browse-url-browser-function 'browse-url-iximosaic)
|
|
542 :style radio
|
|
543 :selected (eq browse-url-browser-function 'browse-url-iximosaic)]
|
|
544 ["Lynx (xterm)" (setq browse-url-browser-function 'browse-url-lynx-xterm)
|
|
545 :style radio
|
|
546 :selected (eq browse-url-browser-function 'browse-url-lynx-xterm)]
|
|
547 ["Lynx (xemacs)" (setq browse-url-browser-function 'browse-url-lynx-emacs)
|
|
548 :style radio
|
|
549 :selected (eq browse-url-browser-function 'browse-url-lynx-emacs)]
|
|
550 ["Grail" (setq browse-url-browser-function 'browse-url-grail)
|
|
551 :style radio
|
|
552 :selected (eq browse-url-browser-function 'browse-url-grail)]
|
|
553 )
|
|
554 "-----"
|
30
|
555 ["Browse Faces..." edit-faces t]
|
0
|
556 ("Font" :filter font-menu-family-constructor)
|
|
557 ("Size" :filter font-menu-size-constructor)
|
|
558 ("Weight" :filter font-menu-weight-constructor)
|
|
559 "-----"
|
|
560 ["Save Options" save-options-menu-settings t]
|
|
561 )
|
|
562
|
|
563 ("Buffers"
|
|
564 :filter buffers-menu-filter
|
|
565 ["List All Buffers" list-buffers t]
|
|
566 "--"
|
|
567 )
|
|
568
|
|
569 ("Tools"
|
|
570 ["Grep..." grep t]
|
|
571 ["Compile..." compile t]
|
6
|
572 ["Shell" shell t]
|
0
|
573 ["Shell Command..." shell-command t]
|
|
574 ["Shell Command on Region..."
|
|
575 shell-command-on-region (region-exists-p)]
|
|
576 ["Debug (GDB)..." gdb t]
|
|
577 ["Debug (DBX)..." dbx t]
|
|
578 "-----"
|
|
579 ["OO-Browser..." oobr t]
|
|
580 ("Tags"
|
|
581 ["Find..." find-tag t]
|
|
582 ["Find Other Window..." find-tag-other-window t]
|
|
583 ["Tags Search..." tags-search t]
|
|
584 ["Tags Replace..." tags-query-replace t]
|
|
585 "-----"
|
6
|
586 ["Continue Search/Replace" tags-loop-continue t]
|
0
|
587 ["Pop stack" pop-tag-mark t]
|
|
588 ["Apropos..." tags-apropos t]))
|
|
589
|
|
590 nil ; the partition: menus after this are flushright
|
|
591
|
|
592 ("Help"
|
|
593 ["About XEmacs..." about-xemacs t]
|
10
|
594 ("Basics"
|
16
|
595 ["Tutorial" help-with-tutorial t]
|
|
596 ["News" view-emacs-news t]
|
|
597 ["Packages" finder-by-keyword t]
|
|
598 ["Splash" xemacs-splash-buffer t])
|
0
|
599 "-----"
|
16
|
600 ("XEmacs FAQ"
|
26
|
601 ["FAQ (local)" xemacs-local-faq t]
|
16
|
602 ["FAQ via WWW" xemacs-www-faq t]
|
|
603 ["Home Page" xemacs-www-page t])
|
10
|
604 ("Samples"
|
|
605 ["Sample .emacs" (find-file
|
0
|
606 (expand-file-name "sample.emacs"
|
|
607 data-directory))
|
10
|
608 t]
|
|
609 ["Sample .Xdefaults" (find-file
|
6
|
610 (expand-file-name "sample.Xdefaults"
|
|
611 data-directory))
|
14
|
612 t]
|
|
613 ["Sample enriched" (find-file
|
|
614 (expand-file-name "enriched.doc"
|
|
615 data-directory))
|
10
|
616 t])
|
0
|
617 "-----"
|
|
618 ("Lookup in Info"
|
16
|
619 ["Key Binding..." Info-goto-emacs-key-command-node t]
|
0
|
620 ["Command..." Info-goto-emacs-command-node t]
|
16
|
621 ["Function..." Info-elisp-ref t]
|
0
|
622 ["Topic..." Info-query t])
|
10
|
623 ("Manuals"
|
16
|
624 ["Info" info t]
|
10
|
625 ["Unix Manual..." manual-entry t])
|
|
626 ("Commands & Keys"
|
16
|
627 ["Mode" describe-mode t]
|
10
|
628 ["Apropos..." hyper-apropos t]
|
16
|
629 ["Apropos Docs..." apropos-documentation t]
|
10
|
630 "-----"
|
16
|
631 ["Key..." describe-key t]
|
|
632 ["Bindings" describe-bindings t]
|
|
633 ["Mouse Bindings" describe-pointer t]
|
|
634 ["Recent Keys" view-lossage t]
|
10
|
635 "-----"
|
16
|
636 ["Function..." describe-function t]
|
|
637 ["Variable..." describe-variable t]
|
|
638 ["Locate Command..." where-is t])
|
0
|
639 "-----"
|
16
|
640 ["Recent Messages" view-lossage t]
|
0
|
641 ("Misc"
|
16
|
642 ["No Warranty" describe-no-warranty t]
|
|
643 ["XEmacs License" describe-copying t]
|
|
644 ["The Latest Version" describe-distribution t])
|
0
|
645 )
|
|
646 )))
|
|
647
|
|
648
|
|
649 (defun maybe-add-init-button ()
|
2
|
650 "Don't call this.
|
|
651 Adds `Load .emacs' button to menubar when starting up with -q."
|
0
|
652 ;; by Stig@hackvan.com
|
|
653 (cond
|
|
654 (init-file-user nil)
|
|
655 ((file-exists-p (cond
|
|
656 ((eq system-type 'ms-dos)
|
|
657 (concat "~" (user-login-name) "/_emacs"))
|
|
658 ((eq system-type 'vax-vms)
|
|
659 "sys$login:.emacs")
|
|
660 (t
|
|
661 (concat "~" (user-login-name) "/.emacs"))))
|
|
662 (add-menu-button nil
|
|
663 ["Load .emacs"
|
|
664 (progn (delete-menu-item '("Load .emacs"))
|
|
665 (load-user-init-file (user-login-name)))
|
|
666 t]
|
|
667 "Help"))
|
|
668 (t nil)))
|
|
669
|
|
670 (add-hook 'before-init-hook 'maybe-add-init-button)
|
|
671
|
|
672
|
|
673 ;;; The File and Edit menus
|
|
674
|
|
675 (defvar put-buffer-names-in-file-menu t)
|
|
676
|
|
677 ;; The sensitivity part of this function could be done by just adding forms
|
|
678 ;; to evaluate to the menu items themselves; that would be marginally less
|
|
679 ;; efficient but not perceptibly so (I think). But in order to change the
|
|
680 ;; names of the Undo menu item and the various things on the File menu item,
|
|
681 ;; we need to use a hook.
|
|
682
|
|
683 (defun file-menu-filter (menu-items)
|
|
684 "Incrementally update the file menu.
|
|
685 This function changes the arguments and sensitivity of these File menu items:
|
|
686
|
|
687 Delete Buffer has the name of the current buffer appended to it.
|
|
688 Print Buffer has the name of the current buffer appended to it.
|
|
689 Pretty-Print Buffer
|
|
690 has the name of the current buffer appended to it.
|
|
691 Save has the name of the current buffer appended to it, and is
|
|
692 sensitive only when the current buffer is modified.
|
|
693 Revert Buffer has the name of the current buffer appended to it, and is
|
|
694 sensitive only when the current buffer has a file.
|
|
695 Delete Frame sensitive only when there is more than one frame.
|
|
696
|
|
697 The name of the current buffer is only appended to the menu items if
|
|
698 `put-buffer-names-in-file-menu' is non-nil. This behavior is the default."
|
|
699 (let* ((bufname (buffer-name))
|
|
700 (result menu-items) ; save pointer to start of menu.
|
|
701 name
|
|
702 item)
|
|
703 ;; the contents of the menu items in the file menu are destructively
|
|
704 ;; modified so that there is as little consing as possible. This is okay.
|
|
705 ;; As soon as the result is returned, it is converted to widget_values
|
|
706 ;; inside lwlib and the lisp menu-items can be safely modified again.
|
|
707 (while (setq item (pop menu-items))
|
|
708 (if (vectorp item)
|
|
709 (progn
|
|
710 (setq name (aref item 0))
|
|
711 (and put-buffer-names-in-file-menu
|
|
712 (member name '("Save" "Revert Buffer" "Print Buffer"
|
|
713 "Pretty-Print Buffer" "Delete Buffer"))
|
|
714 (>= 4 (length item))
|
|
715 (aset item 3 bufname))
|
|
716 (and (string= "Save" name)
|
|
717 (aset item 2 (buffer-modified-p)))
|
|
718 (and (string= "Revert Buffer" name)
|
|
719 (aset item 2 (not (not (or buffer-file-name
|
|
720 revert-buffer-function)))))
|
|
721 (and (string= "Delete Frame" name)
|
|
722 (aset item 2 (not (eq (next-frame) (selected-frame)))))
|
|
723 )))
|
|
724 result))
|
|
725
|
|
726 (defun edit-menu-filter (menu-items)
|
|
727 "For use as an incremental menu construction filter.
|
|
728 This function changes the sensitivity of these Edit menu items:
|
|
729
|
|
730 Cut sensitive only when emacs owns the primary X Selection.
|
|
731 Copy sensitive only when emacs owns the primary X Selection.
|
|
732 Clear sensitive only when emacs owns the primary X Selection.
|
|
733 Paste sensitive only when there is an owner for the X Clipboard Selection.
|
|
734 Undo sensitive only when there is undo information.
|
|
735 While in the midst of an undo, this is changed to \"Undo More\"."
|
|
736 (let* (item
|
|
737 name
|
|
738 (result menu-items) ; save pointer to head of list
|
|
739 (x-dev (eq 'x (device-type (selected-device))))
|
|
740 (emacs-owns-selection-p (and x-dev (x-selection-owner-p)))
|
|
741 (clipboard-exists-p (and x-dev (x-selection-exists-p 'CLIPBOARD)))
|
|
742 ;;; undo-available undoing-more
|
|
743 ;;; (undo-info-available (not (null (and (not (eq t buffer-undo-list))
|
|
744 ;;; (if (eq last-command 'undo)
|
|
745 ;;; (setq undoing-more
|
|
746 ;;; (and (boundp 'pending-undo-list)
|
|
747 ;;; pending-undo-list)
|
|
748 ;;; buffer-undo-list))))))
|
|
749 undo-name undo-state
|
|
750 )
|
|
751 ;; As with file-menu-filter, menu-items are destructively modified.
|
|
752 ;; This is OK.
|
|
753 (while (setq item (pop menu-items))
|
|
754 (if (vectorp item)
|
|
755 (progn
|
|
756 (setq name (aref item 0))
|
|
757 (and (member name '("Cut" "Copy" "Clear"))
|
|
758 (aset item 2 emacs-owns-selection-p))
|
|
759 (and (string= name "Paste")
|
|
760 (aset item 2 clipboard-exists-p))
|
|
761 (and (member name '("Undo" "Undo More"))
|
|
762 (progn
|
|
763 ;; we could also do this with the third field of the item.
|
|
764 (if (eq last-command 'undo)
|
|
765 (setq undo-name "Undo More"
|
|
766 undo-state (not (null (and (boundp 'pending-undo-list)
|
|
767 pending-undo-list))))
|
|
768 (setq undo-name "Undo"
|
|
769 undo-state (and (not (eq buffer-undo-list t))
|
|
770 (not (null
|
|
771 (or buffer-undo-list
|
|
772 (and (boundp 'pending-undo-list)
|
|
773 pending-undo-list)))))))
|
|
774 (if buffer-read-only (setq undo-state nil))
|
|
775 (aset item 0 undo-name)
|
|
776 (aset item 2 undo-state)
|
|
777 ))
|
|
778 )))
|
|
779 result))
|
|
780
|
|
781
|
|
782 ;;; The Buffers menu
|
|
783
|
|
784 (defvar buffers-menu-max-size 25
|
|
785 "*Maximum number of entries which may appear on the \"Buffers\" menu.
|
|
786 If this is 10, then only the ten most-recently-selected buffers will be
|
|
787 shown. If this is nil, then all buffers will be shown. Setting this to
|
|
788 a large number or nil will slow down menu responsiveness.")
|
|
789
|
|
790 (defvar complex-buffers-menu-p nil
|
|
791 "*If true, the buffers menu will contain several commands, as submenus
|
|
792 of each buffer line. If this is false, then there will be only one command:
|
|
793 select that buffer.")
|
|
794
|
|
795 (defvar buffers-menu-submenus-for-groups-p nil
|
|
796 "*If true, the buffers menu will contain one submenu per group of buffers,
|
6
|
797 if a grouping function is specified in `buffers-menu-grouping-function'.
|
|
798 If this is an integer, do not build submenus if the number of buffers
|
|
799 is not larger than this value.")
|
0
|
800
|
|
801 (defvar buffers-menu-switch-to-buffer-function 'switch-to-buffer
|
|
802 "*The function to call to select a buffer from the buffers menu.
|
|
803 `switch-to-buffer' is a good choice, as is `pop-to-buffer'.")
|
|
804
|
|
805 (defvar buffers-menu-omit-function 'buffers-menu-omit-invisible-buffers
|
|
806 "*If non-nil, a function specifying the buffers to omit from the buffers menu.
|
|
807 This is passed a buffer and should return non-nil if the buffer should be
|
|
808 omitted. The default value `buffers-menu-omit-invisible-buffers' omits
|
|
809 buffers that are normally considered \"invisible\" (those whose name
|
|
810 begins with a space).")
|
|
811
|
|
812 (defvar buffers-menu-format-buffer-line-function 'format-buffers-menu-line
|
|
813 "*The function to call to return a string to represent a buffer in the
|
|
814 buffers menu. The function is passed a buffer and should return a string.
|
|
815 The default value `format-buffers-menu-line' just returns the name of
|
|
816 the buffer. Also check out `slow-format-buffers-menu-line' which
|
|
817 returns a whole bunch of info about a buffer.")
|
|
818
|
|
819 (defvar buffers-menu-sort-function
|
|
820 'sort-buffers-menu-by-mode-then-alphabetically
|
|
821 "*If non-nil, a function to sort the list of buffers in the buffers menu.
|
|
822 It will be passed two arguments (two buffers to compare) and should return
|
|
823 T if the first is \"less\" than the second. One possible value is
|
|
824 `sort-buffers-menu-alphabetically'; another is
|
|
825 `sort-buffers-menu-by-mode-then-alphabetically'.")
|
|
826
|
|
827 (defvar buffers-menu-grouping-function
|
|
828 'group-buffers-menu-by-mode-then-alphabetically
|
|
829 "*If non-nil, a function to group buffers in the buffers menu together.
|
|
830 It will be passed two arguments, successive members of the sorted buffers
|
|
831 list after being passed through `buffers-menu-sort-function'. It should
|
|
832 return non-nil if the second buffer begins a new group. The return value
|
|
833 should be the name of the old group, which may be used in hierarchical
|
|
834 buffers menus. The last invocation of the function contains nil as the
|
|
835 second argument, so that the name of the last group can be determined.
|
|
836
|
|
837 The sensible values of this function are dependent on the value specified
|
|
838 for `buffers-menu-sort-function'.")
|
|
839
|
|
840 (defun buffers-menu-omit-invisible-buffers (buf)
|
|
841 "For use as a value of `buffers-menu-omit-function'.
|
|
842 Omits normally invisible buffers (those whose name begins with a space)."
|
|
843 (not (null (string-match "\\` " (buffer-name buf)))))
|
|
844
|
|
845 (defun sort-buffers-menu-alphabetically (buf1 buf2)
|
|
846 "For use as a value of `buffers-menu-sort-function'.
|
|
847 Sorts the buffers in alphabetical order by name, but puts buffers beginning
|
|
848 with a star at the end of the list."
|
|
849 (let* ((nam1 (buffer-name buf1))
|
|
850 (nam2 (buffer-name buf2))
|
|
851 (star1p (not (null (string-match "\\`*" nam1))))
|
|
852 (star2p (not (null (string-match "\\`*" nam2)))))
|
|
853 (if (not (eq star1p star2p))
|
|
854 (not star1p)
|
|
855 (string-lessp nam1 nam2))))
|
|
856
|
|
857 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
|
|
858 "For use as a value of `buffers-menu-sort-function'.
|
|
859 Sorts first by major mode and then alphabetically by name, but puts buffers
|
|
860 beginning with a star at the end of the list."
|
|
861 (let* ((nam1 (buffer-name buf1))
|
|
862 (nam2 (buffer-name buf2))
|
|
863 (star1p (not (null (string-match "\\`*" nam1))))
|
|
864 (star2p (not (null (string-match "\\`*" nam2))))
|
|
865 (mode1 (symbol-value-in-buffer 'major-mode buf1))
|
|
866 (mode2 (symbol-value-in-buffer 'major-mode buf2)))
|
|
867 (cond ((not (eq star1p star2p)) (not star1p))
|
|
868 ((and star1p star2p (string-lessp nam1 nam2)))
|
|
869 ((string-lessp mode1 mode2) t)
|
|
870 ((string-lessp mode2 mode1) nil)
|
|
871 (t (string-lessp nam1 nam2)))))
|
|
872
|
|
873 ;; this version is too slow on some machines.
|
|
874 (defun slow-format-buffers-menu-line (buffer)
|
|
875 "For use as a value of `buffers-menu-format-buffer-line-function'.
|
|
876 This returns a string containing a bunch of info about the buffer."
|
|
877 (format "%s%s %-19s %6s %-15s %s"
|
|
878 (if (buffer-modified-p buffer) "*" " ")
|
|
879 (if (symbol-value-in-buffer 'buffer-read-only buffer) "%" " ")
|
|
880 (buffer-name buffer)
|
|
881 (buffer-size buffer)
|
|
882 (symbol-value-in-buffer 'mode-name buffer)
|
|
883 (or (buffer-file-name buffer) "")))
|
|
884
|
|
885 (defun format-buffers-menu-line (buffer)
|
|
886 "For use as a value of `buffers-menu-format-buffer-line-function'.
|
|
887 This just returns the buffer's name."
|
|
888 (buffer-name buffer))
|
|
889
|
|
890 (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
|
|
891 "For use as a value of `buffers-menu-grouping-function'.
|
|
892 This groups buffers by major mode. It only really makes sense if
|
|
893 `buffers-menu-sorting-function' is
|
|
894 `sort-buffers-menu-by-mode-then-alphabetically'."
|
|
895 (cond ((string-match "\\`*" (buffer-name buf1))
|
|
896 (and (null buf2) "*Misc*"))
|
|
897 ((or (null buf2)
|
|
898 (string-match "\\`*" (buffer-name buf2))
|
|
899 (not (eq (symbol-value-in-buffer 'major-mode buf1)
|
|
900 (symbol-value-in-buffer 'major-mode buf2))))
|
|
901 (symbol-value-in-buffer 'mode-name buf1))
|
|
902 (t nil)))
|
|
903
|
|
904 (defun buffer-menu-save-buffer (buffer)
|
|
905 (save-excursion
|
|
906 (set-buffer buffer)
|
|
907 (save-buffer)))
|
|
908
|
|
909 (defun buffer-menu-write-file (buffer)
|
|
910 (save-excursion
|
|
911 (set-buffer buffer)
|
|
912 (write-file (read-file-name
|
|
913 (format "Write %s to file: "
|
|
914 (buffer-name (current-buffer)))))))
|
|
915
|
|
916 (defsubst build-buffers-menu-internal (buffers)
|
|
917 (let (name line)
|
|
918 (mapcar
|
|
919 #'(lambda (buffer)
|
|
920 (if (eq buffer t)
|
|
921 "---"
|
|
922 (setq line (funcall buffers-menu-format-buffer-line-function
|
|
923 buffer))
|
|
924 (if complex-buffers-menu-p
|
|
925 (delq nil
|
|
926 (list line
|
|
927 (vector "Switch to Buffer"
|
|
928 (list buffers-menu-switch-to-buffer-function
|
|
929 (setq name (buffer-name buffer)))
|
|
930 t)
|
|
931 (if (eq buffers-menu-switch-to-buffer-function
|
|
932 'switch-to-buffer)
|
|
933 (vector "Switch to Buffer, Other Frame"
|
|
934 (list 'switch-to-buffer-other-frame
|
|
935 (setq name (buffer-name buffer)))
|
|
936 t)
|
|
937 nil)
|
|
938 (if (and (buffer-modified-p buffer)
|
|
939 (buffer-file-name buffer))
|
|
940 (vector "Save Buffer"
|
|
941 (list 'buffer-menu-save-buffer name) t)
|
|
942 ["Save Buffer" nil nil]
|
|
943 )
|
|
944 (vector "Save As..."
|
|
945 (list 'buffer-menu-write-file name) t)
|
|
946 (vector "Delete Buffer" (list 'kill-buffer name)
|
|
947 t)))
|
|
948 (vector line
|
|
949 (list buffers-menu-switch-to-buffer-function
|
|
950 (buffer-name buffer))
|
|
951 t))))
|
|
952 buffers)))
|
|
953
|
|
954 (defun buffers-menu-filter (menu)
|
|
955 "This is the menu filter for the top-level buffers \"Buffers\" menu.
|
|
956 It dynamically creates a list of buffers to use as the contents of the menu.
|
|
957 Only the most-recently-used few buffers will be listed on the menu, for
|
|
958 efficiency reasons. You can control how many buffers will be shown by
|
|
959 setting `buffers-menu-max-size'. You can control the text of the menu
|
|
960 items by redefining the function `format-buffers-menu-line'."
|
|
961 (let ((buffers (delete-if buffers-menu-omit-function (buffer-list))))
|
|
962 (and (integerp buffers-menu-max-size)
|
|
963 (> buffers-menu-max-size 1)
|
|
964 (> (length buffers) buffers-menu-max-size)
|
6
|
965 ;; shorten list of buffers (not with submenus!)
|
|
966 (not (and buffers-menu-grouping-function
|
|
967 buffers-menu-submenus-for-groups-p))
|
0
|
968 (setcdr (nthcdr buffers-menu-max-size buffers) nil))
|
|
969 (if buffers-menu-sort-function
|
|
970 (setq buffers (sort buffers buffers-menu-sort-function)))
|
|
971 (if (and buffers-menu-grouping-function
|
6
|
972 buffers-menu-submenus-for-groups-p
|
|
973 (or (not (integerp buffers-menu-submenus-for-groups-p))
|
|
974 (> (length buffers) buffers-menu-submenus-for-groups-p)))
|
0
|
975 (let (groups groupnames current-group)
|
|
976 (mapl
|
|
977 #'(lambda (sublist)
|
|
978 (let ((groupname (funcall buffers-menu-grouping-function
|
|
979 (car sublist) (cadr sublist))))
|
|
980 (setq current-group (cons (car sublist) current-group))
|
|
981 (if groupname
|
|
982 (progn
|
|
983 (setq groups (cons (nreverse current-group)
|
|
984 groups))
|
|
985 (setq groupnames (cons groupname groupnames))
|
|
986 (setq current-group nil)))))
|
|
987 buffers)
|
|
988 (setq buffers
|
|
989 (mapcar*
|
|
990 #'(lambda (groupname group)
|
|
991 (cons groupname (build-buffers-menu-internal group)))
|
|
992 (nreverse groupnames)
|
|
993 (nreverse groups))))
|
|
994 (if buffers-menu-grouping-function
|
|
995 (progn
|
|
996 (setq buffers
|
|
997 (mapcon
|
|
998 #'(lambda (sublist)
|
|
999 (cond ((funcall buffers-menu-grouping-function
|
|
1000 (car sublist) (cadr sublist))
|
|
1001 (list (car sublist) t))
|
|
1002 (t (list (car sublist)))))
|
|
1003 buffers))
|
|
1004 ;; remove a trailing separator.
|
|
1005 (and (>= (length buffers) 2)
|
|
1006 (let ((lastcdr (nthcdr (- (length buffers) 2) buffers)))
|
|
1007 (if (eq t (cadr lastcdr))
|
|
1008 (setcdr lastcdr nil))))))
|
|
1009 (setq buffers (build-buffers-menu-internal buffers)))
|
|
1010 (append menu buffers)
|
|
1011 ))
|
|
1012
|
|
1013
|
|
1014
|
|
1015 ;;; The Options menu
|
4
|
1016 (defvar save-options-font-hack nil)
|
0
|
1017
|
26
|
1018 (defvar options-save-faces nil
|
|
1019 "if t, save-options will save all the face information.
|
|
1020 Set to nil to avoid this. This is recommended on XEmacs 19.15
|
|
1021 and above as we have a much more powerful (read: working) way
|
|
1022 of changing and saving faces via cu-edit-faces.el & custom.el.")
|
|
1023
|
0
|
1024 (defconst options-menu-saved-forms
|
|
1025 ;; This is really quite a kludge, but it gets the job done.
|
|
1026 ;;
|
|
1027 ;; remember that we have to conditionalize on default features
|
|
1028 ;; both in the forms to evaluate and in the forms output to
|
|
1029 ;; .emacs, in case the .emacs is loaded into an XEmacs with
|
|
1030 ;; different features.
|
|
1031 (purecopy
|
|
1032 '(
|
|
1033 ;; Editing Options menu.
|
|
1034 ;; put case-fold-search first to defeat a bug in the backquote
|
|
1035 ;; processing mechanism. Feh!
|
|
1036 case-fold-search
|
|
1037 `(setq-default overwrite-mode ,(default-value 'overwrite-mode))
|
|
1038 (if (default-value 'overwrite-mode)
|
|
1039 '(overwrite-mode 1))
|
|
1040 `(setq-default case-fold-search ,(default-value 'case-fold-search))
|
|
1041 case-replace
|
|
1042 (if (memq 'pending-delete-pre-hook pre-command-hook)
|
|
1043 '(progn
|
|
1044 (require 'pending-del)
|
|
1045 (pending-delete-on nil)))
|
|
1046 zmacs-regions
|
|
1047 mouse-yank-at-point
|
12
|
1048 require-final-newline
|
|
1049 next-line-add-newlines
|
0
|
1050
|
|
1051 ;; General Options menu.
|
|
1052 teach-extended-commands-p
|
|
1053 ;; (#### not actually on Options menu)
|
|
1054 teach-extended-commands-timeout
|
|
1055 debug-on-error
|
|
1056 debug-on-quit
|
|
1057
|
|
1058 ;; Printing Options menu.
|
|
1059 lpr-switches
|
|
1060 ps-print-color-p
|
|
1061 ps-paper-type
|
|
1062
|
|
1063 ;; Other Window Location
|
|
1064 get-frame-for-buffer-default-instance-limit
|
|
1065 temp-buffer-show-function
|
12
|
1066 (if gnuserv-frame
|
|
1067 '(setq gnuserv-frame (selected-frame)))
|
0
|
1068
|
|
1069 ;; Syntax Highlighting
|
|
1070 font-lock-auto-fontify
|
|
1071 font-lock-use-fonts
|
|
1072 font-lock-use-colors
|
|
1073 font-lock-maximum-decoration
|
|
1074 font-lock-maximum-size
|
|
1075 ;; (#### the next two not on Options menu)
|
|
1076 font-lock-mode-enable-list
|
|
1077 font-lock-mode-disable-list
|
|
1078 ;; #### - this structure is clearly broken. There's no way to ever
|
|
1079 ;; un-require font-lock via the menus. --Stig
|
|
1080 (if (featurep 'font-lock)
|
|
1081 '(require 'font-lock))
|
|
1082 (if (and (boundp 'font-lock-mode-hook)
|
|
1083 (memq 'turn-on-fast-lock font-lock-mode-hook))
|
|
1084 '(add-hook 'font-lock-mode-hook 'turn-on-fast-lock)
|
|
1085 '(remove-hook 'font-lock-mode-hook 'turn-on-fast-lock))
|
|
1086 (if (and (boundp 'font-lock-mode-hook)
|
|
1087 (memq 'turn-on-lazy-lock font-lock-mode-hook))
|
|
1088 '(add-hook 'font-lock-mode-hook 'turn-on-lazy-lock)
|
|
1089 '(remove-hook 'font-lock-mode-hook 'turn-on-lazy-lock))
|
|
1090
|
|
1091 ;; Paren Highlighting
|
|
1092 (if paren-mode
|
|
1093 `(progn (require 'paren) (paren-set-mode ',paren-mode)))
|
|
1094
|
|
1095 ;; For specifiers, we only save global settings since the others
|
|
1096 ;; will belong to objects which only exist during this session.
|
|
1097
|
|
1098 ;; Frame Appearance
|
|
1099 (if (featurep 'scrollbar)
|
|
1100 `(if (featurep 'scrollbar)
|
|
1101 (progn
|
|
1102 (add-spec-list-to-specifier
|
|
1103 scrollbar-width
|
|
1104 ',(specifier-spec-list scrollbar-width 'global))
|
|
1105 (add-spec-list-to-specifier
|
|
1106 scrollbar-height
|
|
1107 ',(specifier-spec-list scrollbar-height 'global)))))
|
|
1108 `(add-spec-list-to-specifier
|
|
1109 modeline-shadow-thickness
|
|
1110 ',(specifier-spec-list modeline-shadow-thickness 'global))
|
|
1111 `(setq-default truncate-lines ,(default-value 'truncate-lines))
|
|
1112 bar-cursor
|
|
1113 (if (and (boundp 'blink-cursor-mode) blink-cursor-mode)
|
|
1114 '(blink-cursor-mode t))
|
|
1115
|
|
1116 ;; Menubar Appearance
|
|
1117 buffers-menu-max-size
|
|
1118 complex-buffers-menu-p
|
|
1119 buffers-menu-sort-function
|
|
1120 buffers-menu-grouping-function
|
|
1121 buffers-menu-submenus-for-groups-p
|
|
1122 font-menu-ignore-scaled-fonts
|
|
1123 font-menu-this-frame-only-p
|
|
1124
|
|
1125 ;; Toolbar Appearance
|
|
1126 (if (featurep 'toolbar)
|
|
1127 `(if (featurep 'toolbar)
|
|
1128 (progn
|
|
1129 (set-default-toolbar-position
|
|
1130 ',(default-toolbar-position))
|
|
1131 (add-spec-list-to-specifier
|
|
1132 default-toolbar-visible-p
|
|
1133 ',(specifier-spec-list default-toolbar-visible-p 'global))
|
|
1134 (add-spec-list-to-specifier
|
|
1135 toolbar-buttons-captioned-p
|
|
1136 ',(specifier-spec-list toolbar-buttons-captioned-p
|
|
1137 'global)))))
|
|
1138
|
14
|
1139 ;; mouse
|
|
1140 mouse-avoidance-mode
|
|
1141
|
0
|
1142 ;; Open URLs With
|
|
1143 browse-url-browser-function
|
|
1144
|
|
1145 ;; Now save all faces.
|
|
1146
|
|
1147 ;; Setting this in lisp conflicts with X resources. Bad move. --Stig
|
|
1148 ;; (list 'set-face-font ''default (face-font-name 'default))
|
|
1149 ;; (list 'set-face-font ''modeline (face-font-name 'modeline))
|
26
|
1150 (if options-save-faces
|
|
1151 (cons 'progn
|
|
1152 (mapcar #'(lambda (face)
|
|
1153 `(make-face ',face))
|
30
|
1154 (save-options-non-customized-face-list))))
|
26
|
1155
|
|
1156 (if options-save-faces
|
|
1157 (cons 'progn
|
|
1158 (apply 'nconc
|
|
1159 (mapcar
|
|
1160 #'(lambda (face)
|
|
1161 (delq nil
|
|
1162 (mapcar
|
|
1163 #'(lambda (property)
|
|
1164 (if (specifier-spec-list
|
|
1165 (face-property face property))
|
|
1166 `(add-spec-list-to-specifier
|
|
1167 (face-property ',face ',property)
|
|
1168 ',(save-options-specifier-spec-list
|
|
1169 face property))))
|
|
1170 (delq 'display-table
|
|
1171 (copy-sequence
|
|
1172 built-in-face-specifiers)))))
|
30
|
1173 (save-options-non-customized-face-list)))))
|
26
|
1174
|
0
|
1175 ))
|
|
1176 "The variables to save; or forms to evaluate to get forms to write out.
|
|
1177 This is used by `save-options-menu-settings' and should mirror the
|
|
1178 options listed in the Options menu.")
|
|
1179
|
30
|
1180 (defun save-options-non-customized-face-list ()
|
|
1181 "This function will return a list of all faces that have not been
|
|
1182 'customized'."
|
|
1183 (delq nil (mapcar '(lambda (face)
|
32
|
1184 (unless (get face 'saved-face)
|
|
1185 face))
|
30
|
1186 (face-list))))
|
|
1187
|
0
|
1188 (defun save-options-specifier-spec-list (face property)
|
|
1189 (if (not (or (eq property 'font) (eq property 'color)))
|
|
1190 (specifier-spec-list (face-property face property) 'global)
|
|
1191 (let* ((retlist (specifier-spec-list (face-property face property)
|
|
1192 'global))
|
|
1193 (entry (cdr (car retlist)))
|
|
1194 item)
|
|
1195 (while entry
|
|
1196 (setq item (car entry))
|
|
1197 (if (eq property 'font)
|
|
1198 (if (font-instance-p (cdr item))
|
|
1199 (setcdr item (font-instance-name (cdr item))))
|
|
1200 (if (color-instance-p (cdr item))
|
|
1201 (setcdr item (color-instance-name (cdr item)))))
|
|
1202 (setq entry (cdr entry)))
|
|
1203 retlist)))
|
|
1204
|
|
1205 (defvar save-options-init-file nil
|
|
1206 "File into which to save forms to load the options file (nil for .emacs).
|
|
1207 Normally this is nil, which means save into your .emacs file (the value
|
|
1208 of `user-init-file'.")
|
|
1209
|
|
1210 (defvar save-options-file ".xemacs-options"
|
|
1211 "File to save options into.
|
|
1212 This file is loaded from your .emacs file.
|
|
1213 If this is a relative filename, it is put into the same directory as your
|
|
1214 .emacs file.")
|
|
1215
|
|
1216 (defun save-options-menu-settings ()
|
|
1217 "Saves the current settings of the `Options' menu to your `.emacs' file."
|
|
1218 (interactive)
|
|
1219 ;; we compute the actual filenames now because x-menubar is loaded
|
|
1220 ;; at dump time, when the identity of the user running XEmacs is not known.
|
|
1221 (let* ((actual-save-options-init-file
|
|
1222 (or save-options-init-file
|
|
1223 (and (not (equal user-init-file ""))
|
|
1224 user-init-file)
|
|
1225 (and (eq system-type 'ms-dos)
|
|
1226 (concat "~" (user-login-name) "/_emacs"))
|
|
1227 (concat "~" (user-login-name) "/.emacs")))
|
|
1228 (actual-save-options-file
|
|
1229 (abbreviate-file-name
|
|
1230 (expand-file-name
|
|
1231 save-options-file
|
|
1232 (file-name-directory actual-save-options-init-file))
|
2
|
1233 ;; Don't hack-homedir in abbreviate-file-name. This will
|
|
1234 ;; cause an incorrect expansion if the save-options variables
|
|
1235 ;; have ~ in them.
|
|
1236 ))
|
0
|
1237 (init-output-buffer (find-file-noselect
|
|
1238 actual-save-options-init-file))
|
|
1239 init-output-marker
|
|
1240 (options-output-buffer
|
|
1241 (find-file-noselect actual-save-options-file))
|
|
1242 options-output-marker)
|
|
1243
|
|
1244 (save-excursion
|
|
1245 (set-buffer options-output-buffer)
|
|
1246 (erase-buffer)
|
|
1247 (setq options-output-marker (point-marker)))
|
|
1248
|
|
1249 ;; run with current-buffer unchanged so that variables are evaluated in
|
|
1250 ;; the current context, instead of in the context of the ".emacs" buffer
|
|
1251 ;; or the ".xemacs-options" buffer.
|
|
1252
|
|
1253 ;; first write out .xemacs-options.
|
|
1254
|
|
1255 (let ((standard-output options-output-marker))
|
|
1256 (princ ";; -*- Mode: Emacs-Lisp -*-\n\n")
|
|
1257 (princ "(setq options-file-xemacs-version '(")
|
|
1258 (princ emacs-major-version)
|
|
1259 (princ " ")
|
|
1260 (princ emacs-minor-version)
|
|
1261 (princ "))\n")
|
|
1262 (let ((print-readably t)
|
|
1263 (print-escape-newlines t))
|
|
1264 (mapcar #'(lambda (var)
|
|
1265 (princ " ")
|
|
1266 (if (symbolp var)
|
|
1267 (prin1 (list 'setq-default var
|
|
1268 (let ((val (symbol-value var)))
|
|
1269 (if (or (memq val '(t nil))
|
|
1270 (and (not (symbolp val))
|
|
1271 (not (consp val))))
|
|
1272 val
|
|
1273 (list 'quote val)))))
|
|
1274 (setq var (eval var))
|
|
1275 (cond ((eq (car-safe var) 'progn)
|
|
1276 (while (setq var (cdr var))
|
|
1277 (prin1 (car var))
|
|
1278 (princ "\n")
|
|
1279 (if (cdr var) (princ " "))
|
|
1280 ))
|
|
1281 (var
|
|
1282 (prin1 var))))
|
|
1283 (if var (princ "\n")))
|
|
1284 options-menu-saved-forms)
|
4
|
1285 (when save-options-font-hack
|
|
1286 (princ "(require 'x-font-menu)\n")
|
|
1287 (princ "(setq save-options-font-hack '(")
|
|
1288 (princ (car save-options-font-hack))
|
|
1289 (princ " ")
|
|
1290 (prin1 (cadr save-options-font-hack))
|
|
1291 (princ " ")
|
|
1292 (prin1 (caddr save-options-font-hack))
|
|
1293 (princ " ")
|
|
1294 (prin1 (format "%d" (cadddr save-options-font-hack)))
|
|
1295 (princ "))\n(")
|
|
1296 (princ (car save-options-font-hack))
|
|
1297 (princ " ")
|
|
1298 (prin1 (cadr save-options-font-hack))
|
|
1299 (princ " ")
|
|
1300 (prin1 (caddr save-options-font-hack))
|
|
1301 (princ " ")
|
|
1302 (prin1 (format "%d" (cadddr save-options-font-hack)))
|
|
1303 (princ ")\n"))
|
0
|
1304 ))
|
|
1305 (set-marker options-output-marker nil)
|
|
1306 (save-excursion
|
|
1307 (set-buffer options-output-buffer)
|
|
1308 (save-buffer))
|
|
1309
|
|
1310 ;; then fix .emacs.
|
|
1311
|
|
1312 (save-excursion
|
|
1313 (set-buffer init-output-buffer)
|
|
1314 ;;
|
|
1315 ;; Find and delete the previously saved data, and position to write.
|
|
1316 ;;
|
|
1317 (goto-char (point-min))
|
|
1318 (if (re-search-forward "^;; Options Menu Settings *\n" nil 'move)
|
|
1319 (let ((p (match-beginning 0)))
|
|
1320 (goto-char p)
|
|
1321 (or (re-search-forward
|
|
1322 "^;; End of Options Menu Settings *\\(\n\\|\\'\\)"
|
|
1323 nil t)
|
|
1324 (error "can't find END of saved state in .emacs"))
|
|
1325 (delete-region p (match-end 0)))
|
|
1326 (goto-char (point-max))
|
|
1327 (insert "\n"))
|
|
1328 (setq init-output-marker (point-marker)))
|
|
1329
|
|
1330 (let ((standard-output init-output-marker))
|
|
1331 (princ ";; Options Menu Settings\n")
|
|
1332 (princ ";; =====================\n")
|
|
1333 (princ "(cond\n")
|
|
1334 (princ " ((and (string-match \"XEmacs\" emacs-version)\n")
|
|
1335 (princ " (boundp 'emacs-major-version)\n")
|
|
1336 (princ " (or (and\n")
|
|
1337 (princ " (= emacs-major-version 19)\n")
|
|
1338 (princ " (>= emacs-minor-version 14))\n")
|
|
1339 (princ " (= emacs-major-version 20))\n")
|
|
1340 (princ " (fboundp 'load-options-file))\n")
|
|
1341 (princ " (load-options-file \"")
|
|
1342 (princ actual-save-options-file)
|
|
1343 (princ "\")))\n")
|
|
1344 (princ ";; ============================\n")
|
|
1345 (princ ";; End of Options Menu Settings\n"))
|
|
1346
|
|
1347 (set-marker init-output-marker nil)
|
|
1348 (save-excursion
|
|
1349 (set-buffer init-output-buffer)
|
|
1350 (save-buffer))
|
|
1351 ))
|
|
1352
|
|
1353
|
|
1354 (set-menubar default-menubar)
|
|
1355
|
|
1356
|
|
1357 ;;; Popup menus.
|
|
1358
|
|
1359 (defconst default-popup-menu
|
|
1360 '("XEmacs Commands"
|
|
1361 :filter edit-menu-filter
|
|
1362 ["Undo" advertised-undo t]
|
|
1363 ["Cut" x-kill-primary-selection t]
|
|
1364 ["Copy" x-copy-primary-selection t]
|
|
1365 ["Paste" x-yank-clipboard-selection t]
|
|
1366 ["Clear" x-delete-primary-selection t]
|
|
1367 "-----"
|
|
1368 ["Select Block" mark-paragraph t]
|
|
1369 ["Split Window" (split-window) t]
|
|
1370 ["Unsplit Window" delete-other-windows t]
|
|
1371 ))
|
|
1372
|
|
1373 (defvar global-popup-menu nil
|
|
1374 "The global popup menu. This is present in all modes.
|
|
1375 See the function `popup-menu' for a description of menu syntax.")
|
|
1376
|
|
1377 (defvar mode-popup-menu nil
|
|
1378 "The mode-specific popup menu. Automatically buffer local.
|
|
1379 This is appended to the default items in `global-popup-menu'.
|
|
1380 See the function `popup-menu' for a description of menu syntax.")
|
|
1381 (make-variable-buffer-local 'mode-popup-menu)
|
|
1382
|
|
1383 ;; In an effort to avoid massive menu clutter, this mostly worthless menu is
|
|
1384 ;; superceded by any local popup menu...
|
|
1385 (setq-default mode-popup-menu default-popup-menu)
|
|
1386
|
|
1387 (defvar activate-popup-menu-hook nil
|
|
1388 "Function or functions run before a mode-specific popup menu is made visible.
|
|
1389 These functions are called with no arguments, and should interrogate and
|
|
1390 modify the value of `global-popup-menu' or `mode-popup-menu' as desired.
|
|
1391 Note: this hook is only run if you use `popup-mode-menu' for activating the
|
|
1392 global and mode-specific commands; if you have your own binding for button3,
|
|
1393 this hook won't be run.")
|
|
1394
|
|
1395 (defun popup-mode-menu ()
|
|
1396 "Pop up a menu of global and mode-specific commands.
|
|
1397 The menu is computed by combining `global-popup-menu' and `mode-popup-menu'."
|
|
1398 (interactive "@_")
|
|
1399 (run-hooks 'activate-popup-menu-hook)
|
|
1400 (popup-menu
|
|
1401 (cond ((and global-popup-menu mode-popup-menu)
|
|
1402 (check-menu-syntax mode-popup-menu)
|
32
|
1403 (let* ((title (car mode-popup-menu))
|
|
1404 (items (cdr mode-popup-menu))
|
|
1405 filters)
|
|
1406 ;; Strip keywords from local menu for attaching them at the top
|
44
|
1407 (while (and items
|
|
1408 (symbolp (car items)))
|
32
|
1409 (setq items (append filters (list (car items))))
|
|
1410 (setq items (cdr items)))
|
|
1411 ;; If filters contains a keyword already present in
|
|
1412 ;; `global-popup-menu' you will probably lose.
|
|
1413 (append (list (car global-popup-menu))
|
|
1414 filters
|
|
1415 (cdr global-popup-menu)
|
0
|
1416 '("---" "---")
|
|
1417 (if popup-menu-titles (list title))
|
|
1418 (if popup-menu-titles '("---" "---"))
|
|
1419 items)))
|
|
1420 (t
|
|
1421 (or mode-popup-menu
|
|
1422 global-popup-menu
|
|
1423 (error "No menu here."))))))
|
|
1424
|
|
1425 (defun popup-buffer-menu (event)
|
|
1426 "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked."
|
|
1427 (interactive "e")
|
|
1428 (let ((window (and (event-over-text-area-p event) (event-window event)))
|
|
1429 (bmenu nil))
|
|
1430 (or window
|
|
1431 (error "Pointer must be in a normal window"))
|
|
1432 (select-window window)
|
|
1433 (if current-menubar
|
|
1434 (setq bmenu (assoc "Buffers" current-menubar)))
|
|
1435 (if (null bmenu)
|
|
1436 (setq bmenu (assoc "Buffers" default-menubar)))
|
|
1437 (if (null bmenu)
|
|
1438 (error "Can't find the Buffers menu"))
|
|
1439 (popup-menu bmenu)))
|
|
1440
|
|
1441 (defun popup-menubar-menu (event)
|
|
1442 "Pop up a copy of menu that also appears in the menubar"
|
|
1443 ;; by Stig@hackvan.com
|
|
1444 (interactive "e")
|
|
1445 (let ((window (and (event-over-text-area-p event) (event-window event)))
|
|
1446 popup-menubar)
|
|
1447 (or window
|
|
1448 (error "Pointer must be in a normal window"))
|
|
1449 (select-window window)
|
|
1450 (and current-menubar (run-hooks 'activate-menubar-hook))
|
|
1451 ;; ##### Instead of having to copy this just to safely get rid of
|
|
1452 ;; any nil what we should really do is fix up the internal menubar
|
|
1453 ;; code to just ignore nil if generating a popup menu
|
|
1454 (setq popup-menubar (delete nil (copy-sequence (or current-menubar
|
|
1455 default-menubar))))
|
|
1456 (popup-menu (cons "Menubar Menu" popup-menubar))
|
|
1457 ))
|
|
1458
|
|
1459 (global-set-key 'button3 'popup-mode-menu)
|
|
1460 ;; shift button3 and shift button2 are reserved for Hyperbole
|
|
1461 (global-set-key '(meta control button3) 'popup-buffer-menu)
|
|
1462 (global-set-key '(meta shift button3) 'popup-menubar-menu)
|
|
1463
|
|
1464 ;; Here's a test of the cool new menu features (from Stig).
|
|
1465
|
|
1466 ;(setq mode-popup-menu
|
|
1467 ; '("Test Popup Menu"
|
|
1468 ; :filter cdr
|
|
1469 ; ["this item won't appear because of the menu filter" ding t]
|
|
1470 ; "--:singleLine"
|
|
1471 ; "singleLine"
|
|
1472 ; "--:doubleLine"
|
|
1473 ; "doubleLine"
|
|
1474 ; "--:singleDashedLine"
|
|
1475 ; "singleDashedLine"
|
|
1476 ; "--:doubleDashedLine"
|
|
1477 ; "doubleDashedLine"
|
|
1478 ; "--:noLine"
|
|
1479 ; "noLine"
|
|
1480 ; "--:shadowEtchedIn"
|
|
1481 ; "shadowEtchedIn"
|
|
1482 ; "--:shadowEtchedOut"
|
|
1483 ; "shadowEtchedOut"
|
|
1484 ; "--:shadowDoubleEtchedIn"
|
|
1485 ; "shadowDoubleEtchedIn"
|
|
1486 ; "--:shadowDoubleEtchedOut"
|
|
1487 ; "shadowDoubleEtchedOut"
|
|
1488 ; "--:shadowEtchedInDash"
|
|
1489 ; "shadowEtchedInDash"
|
|
1490 ; "--:shadowEtchedOutDash"
|
|
1491 ; "shadowEtchedOutDash"
|
|
1492 ; "--:shadowDoubleEtchedInDash"
|
|
1493 ; "shadowDoubleEtchedInDash"
|
|
1494 ; "--:shadowDoubleEtchedOutDash"
|
|
1495 ; "shadowDoubleEtchedOutDash"
|
|
1496 ; ))
|
|
1497
|
10
|
1498 (defun xemacs-splash-buffer ()
|
|
1499 "Redisplay XEmacs splash screen in a buffer."
|
|
1500 (interactive)
|
|
1501 (let ((buffer (get-buffer-create "*Splash*")))
|
|
1502 (set-buffer buffer)
|
|
1503 (erase-buffer buffer)
|
|
1504 (startup-splash-frame)
|
|
1505 (pop-to-buffer buffer)
|
|
1506 (delete-other-windows)))
|
0
|
1507
|
|
1508 (provide 'x-menubar)
|
|
1509
|
|
1510 ;;; x-menubar.el ends here.
|