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]
|
|
130 )
|
|
131 )
|
|
132
|
|
133 ("Options"
|
30
|
134 ,custom-help-menu
|
0
|
135 ["Read Only" (toggle-read-only)
|
|
136 :style toggle :selected buffer-read-only]
|
|
137 ("Editing Options"
|
|
138 ["Overstrike" (progn
|
|
139 (overwrite-mode current-prefix-arg)
|
|
140 (setq-default overwrite-mode overwrite-mode))
|
|
141 :style toggle :selected overwrite-mode]
|
|
142 ["Case Sensitive Search" (progn
|
|
143 (setq case-fold-search (not case-fold-search))
|
|
144 (setq-default case-fold-search
|
|
145 case-fold-search))
|
|
146 :style toggle :selected (not case-fold-search)]
|
|
147 ["Case Matching Replace" (setq case-replace (not case-replace))
|
|
148 :style toggle :selected case-replace]
|
|
149 ["Auto Delete Selection" (if (memq 'pending-delete-pre-hook
|
|
150 pre-command-hook)
|
|
151 (pending-delete-off nil)
|
|
152 (pending-delete-on nil))
|
|
153 :style toggle
|
|
154 :selected (memq 'pending-delete-pre-hook pre-command-hook)]
|
|
155 ["Active Regions" (setq zmacs-regions (not zmacs-regions))
|
|
156 :style toggle :selected zmacs-regions]
|
|
157 ["Mouse Paste At Text Cursor" (setq mouse-yank-at-point
|
|
158 (not mouse-yank-at-point))
|
|
159 :style toggle :selected mouse-yank-at-point]
|
12
|
160 ["Require Newline At End" (setq require-final-newline
|
|
161 (or (eq require-final-newline 'ask)
|
|
162 (not require-final-newline)))
|
|
163 :style toggle :selected (eq require-final-newline 't)]
|
|
164 ["Add Newline When Moving Past End" (setq next-line-add-newlines
|
|
165 (not next-line-add-newlines))
|
|
166 :style toggle :selected next-line-add-newlines]
|
0
|
167 )
|
|
168 ("General Options"
|
|
169 ["Teach Extended Commands" (setq teach-extended-commands-p
|
|
170 (not teach-extended-commands-p))
|
|
171 :style toggle :selected teach-extended-commands-p]
|
|
172 ["Debug On Error" (setq debug-on-error (not debug-on-error))
|
|
173 :style toggle :selected debug-on-error]
|
|
174 ["Debug On Quit" (setq debug-on-quit (not debug-on-quit))
|
|
175 :style toggle :selected debug-on-quit]
|
|
176 )
|
|
177 ("Printing Options"
|
|
178 ["Command-Line Switches for `lpr'/`lp'..."
|
2
|
179 (setq lpr-switches
|
|
180 (read-expression "Switches for `lpr'/`lp': "
|
|
181 (format "%S" lpr-switches)))
|
0
|
182 t]
|
|
183 ("Pretty-Print Paper Size"
|
|
184 ["Letter"
|
16
|
185 (setq ps-paper-type 'letter)
|
|
186 :style radio
|
|
187 :selected (eq ps-paper-type 'letter)]
|
|
188 ["Letter-small"
|
|
189 (setq ps-paper-type 'letter-small)
|
|
190 :style radio
|
|
191 :selected (eq ps-paper-type 'letter-small)]
|
|
192 ["Legal"
|
|
193 (setq ps-paper-type 'legal)
|
0
|
194 :style radio
|
16
|
195 :selected (eq ps-paper-type 'legal)]
|
|
196 ["Statement"
|
|
197 (setq ps-paper-type 'statement)
|
|
198 :style radio
|
|
199 :selected (eq ps-paper-type 'statement)]
|
|
200 ["Executive"
|
|
201 (setq ps-paper-type 'executive)
|
|
202 :style radio
|
|
203 :selected (eq ps-paper-type 'executive)]
|
|
204 ["Tabloid"
|
|
205 (setq ps-paper-type 'tabloid)
|
0
|
206 :style radio
|
16
|
207 :selected (eq ps-paper-type 'tabloid)]
|
|
208 ["Ledger"
|
|
209 (setq ps-paper-type 'ledger)
|
|
210 :style radio
|
|
211 :selected (eq ps-paper-type 'ledger)]
|
|
212 ["A3"
|
|
213 (setq ps-paper-type 'a3)
|
|
214 :style radio
|
|
215 :selected (eq ps-paper-type 'a3)]
|
0
|
216 ["A4"
|
16
|
217 (setq ps-paper-type 'a4)
|
|
218 :style radio
|
|
219 :selected (eq ps-paper-type 'a4)]
|
|
220 ["A4small"
|
|
221 (setq ps-paper-type 'a4small)
|
0
|
222 :style radio
|
16
|
223 :selected (eq ps-paper-type 'a4small)]
|
|
224 ["B4"
|
|
225 (setq ps-paper-type 'b4)
|
|
226 :style radio
|
|
227 :selected (eq ps-paper-type 'b4)]
|
|
228 ["B5"
|
|
229 (setq ps-paper-type 'b5)
|
|
230 :style radio
|
|
231 :selected (eq ps-paper-type 'b5)]
|
0
|
232 )
|
26
|
233 ["Enable Color Printing"
|
|
234 (progn
|
|
235 (set-face-background 'default "white")
|
|
236 (setq ps-print-color-p t))
|
|
237 t]
|
0
|
238 )
|
|
239 ("\"Other Window\" Location"
|
|
240 ["Always in Same Frame"
|
|
241 (setq get-frame-for-buffer-default-instance-limit nil)
|
|
242 :style radio
|
|
243 :selected (null get-frame-for-buffer-default-instance-limit)]
|
|
244 ["Other Frame (2 Frames Max)"
|
|
245 (setq get-frame-for-buffer-default-instance-limit 2)
|
|
246 :style radio
|
|
247 :selected (eq 2 get-frame-for-buffer-default-instance-limit)]
|
|
248 ["Other Frame (3 Frames Max)"
|
|
249 (setq get-frame-for-buffer-default-instance-limit 3)
|
|
250 :style radio
|
|
251 :selected (eq 3 get-frame-for-buffer-default-instance-limit)]
|
|
252 ["Other Frame (4 Frames Max)"
|
|
253 (setq get-frame-for-buffer-default-instance-limit 4)
|
|
254 :style radio
|
|
255 :selected (eq 4 get-frame-for-buffer-default-instance-limit)]
|
|
256 ["Other Frame (5 Frames Max)"
|
|
257 (setq get-frame-for-buffer-default-instance-limit 5)
|
|
258 :style radio
|
|
259 :selected (eq 5 get-frame-for-buffer-default-instance-limit)]
|
|
260 ["Always Create New Frame"
|
|
261 (setq get-frame-for-buffer-default-instance-limit 0)
|
|
262 :style radio
|
|
263 :selected (eq 0 get-frame-for-buffer-default-instance-limit)]
|
|
264 "-----"
|
|
265 ["Temp Buffers Always in Same Frame"
|
|
266 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame)
|
|
267 :style radio
|
|
268 :selected (eq temp-buffer-show-function
|
|
269 'show-temp-buffer-in-current-frame)]
|
|
270 ["Temp Buffers Like Other Buffers"
|
|
271 (setq temp-buffer-show-function nil)
|
|
272 :style radio
|
|
273 :selected (null temp-buffer-show-function)]
|
12
|
274 "-----"
|
|
275 ["Make current frame gnuserv target"
|
|
276 (setq gnuserv-frame
|
|
277 (if (equal gnuserv-frame (selected-frame))
|
|
278 nil
|
|
279 (selected-frame)))
|
|
280 :style radio
|
|
281 :selected (equal gnuserv-frame (selected-frame))]
|
0
|
282 )
|
|
283
|
|
284 "-----"
|
|
285 ("Syntax Highlighting"
|
|
286 ["In This Buffer" (font-lock-mode)
|
|
287 :style toggle :selected font-lock-mode]
|
|
288 ["Automatic" (if (not (featurep 'font-lock))
|
|
289 (progn
|
|
290 (setq font-lock-auto-fontify t)
|
|
291 (require 'font-lock))
|
|
292 (setq font-lock-auto-fontify
|
|
293 (not font-lock-auto-fontify)))
|
|
294 :style toggle
|
|
295 :selected (and (featurep 'font-lock) font-lock-auto-fontify)]
|
|
296 "-----"
|
|
297 ["Fonts" (progn (require 'font-lock)
|
|
298 (font-lock-use-default-fonts)
|
|
299 (setq font-lock-use-fonts t
|
|
300 font-lock-use-colors nil)
|
|
301 (font-lock-mode 1))
|
|
302 :style radio
|
|
303 :selected (and font-lock-mode
|
|
304 font-lock-use-fonts)]
|
|
305 ["Colors" (progn (require 'font-lock)
|
|
306 (font-lock-use-default-colors)
|
|
307 (setq font-lock-use-colors t
|
|
308 font-lock-use-fonts nil)
|
|
309 (font-lock-mode 1))
|
|
310 :style radio
|
|
311 :selected (and font-lock-mode
|
|
312 font-lock-use-colors)]
|
|
313 "-----"
|
|
314 ["Least" (if (or (and (not (integerp font-lock-maximum-decoration))
|
|
315 (not (eq t font-lock-maximum-decoration)))
|
|
316 (and (integerp font-lock-maximum-decoration)
|
|
317 (<= font-lock-maximum-decoration 0)))
|
|
318 nil
|
|
319 (setq font-lock-maximum-decoration nil)
|
|
320 (font-lock-recompute-variables))
|
|
321 :style radio
|
|
322 :active font-lock-mode
|
|
323 :selected (and font-lock-mode
|
|
324 (or (and (not (integerp font-lock-maximum-decoration))
|
|
325 (not (eq t font-lock-maximum-decoration)))
|
|
326 (and (integerp font-lock-maximum-decoration)
|
|
327 (<= font-lock-maximum-decoration 0))))]
|
|
328 ["More" (if (and (integerp font-lock-maximum-decoration)
|
|
329 (= 1 font-lock-maximum-decoration))
|
|
330 nil
|
|
331 (setq font-lock-maximum-decoration 1)
|
|
332 (font-lock-recompute-variables))
|
|
333 :style radio
|
|
334 :active font-lock-mode
|
|
335 :selected (and font-lock-mode
|
|
336 (integerp font-lock-maximum-decoration)
|
|
337 (= 1 font-lock-maximum-decoration))]
|
|
338 ["Even More" (if (and (integerp font-lock-maximum-decoration)
|
|
339 (= 2 font-lock-maximum-decoration))
|
|
340 nil
|
|
341 (setq font-lock-maximum-decoration 2)
|
|
342 (font-lock-recompute-variables))
|
|
343 :style radio
|
|
344 :active font-lock-mode
|
|
345 :selected (and font-lock-mode
|
|
346 (integerp font-lock-maximum-decoration)
|
|
347 (= 2 font-lock-maximum-decoration))]
|
|
348 ["Most" (if (or (eq font-lock-maximum-decoration t)
|
|
349 (and (integerp font-lock-maximum-decoration)
|
|
350 (>= font-lock-maximum-decoration 3)))
|
|
351 nil
|
|
352 (setq font-lock-maximum-decoration t)
|
|
353 (font-lock-recompute-variables))
|
|
354 :style radio
|
|
355 :active font-lock-mode
|
|
356 :selected (and font-lock-mode
|
|
357 (or (eq font-lock-maximum-decoration t)
|
|
358 (and (integerp font-lock-maximum-decoration)
|
|
359 (>= font-lock-maximum-decoration 3))))]
|
|
360 "-----"
|
|
361 ["Lazy" (progn (require 'lazy-lock)
|
|
362 (if (and (boundp 'lazy-lock-mode) lazy-lock-mode)
|
|
363 (progn
|
|
364 (lazy-lock-mode 0)
|
|
365 ;; this shouldn't be necessary so there has to
|
|
366 ;; be a redisplay bug lurking somewhere (or
|
|
367 ;; possibly another event handler bug)
|
12
|
368 (redraw-modeline)
|
|
369 (remove-hook 'font-lock-mode-hook
|
|
370 'turn-on-lazy-lock))
|
0
|
371 (if font-lock-mode
|
|
372 (progn
|
|
373 (lazy-lock-mode 1)
|
12
|
374 (redraw-modeline)
|
|
375 (add-hook 'font-lock-mode-hook
|
|
376 'turn-on-lazy-lock)))))
|
0
|
377 :active font-lock-mode
|
|
378 :style toggle
|
|
379 :selected (and (boundp 'lazy-lock-mode) lazy-lock-mode)]
|
|
380 ["Caching" (progn (require 'fast-lock)
|
|
381 (if fast-lock-mode
|
|
382 (progn
|
|
383 (fast-lock-mode 0)
|
|
384 ;; this shouldn't be necessary so there has to
|
|
385 ;; be a redisplay bug lurking somewhere (or
|
|
386 ;; possibly another event handler bug)
|
|
387 (redraw-modeline))
|
|
388 (if font-lock-mode
|
|
389 (progn
|
|
390 (fast-lock-mode 1)
|
|
391 (redraw-modeline)))))
|
|
392 :active font-lock-mode
|
|
393 :style toggle
|
24
|
394 :selected (and (boundp 'fast-lock-mode) fast-lock-mode)]
|
0
|
395 )
|
|
396 ("Paren Highlighting"
|
|
397 ["None" (paren-set-mode -1)
|
|
398 :style radio :selected (not paren-mode)]
|
|
399 ["Blinking Paren" (paren-set-mode 'blink-paren)
|
|
400 :style radio :selected (eq paren-mode 'blink-paren)]
|
|
401 ["Steady Paren" (paren-set-mode 'paren)
|
|
402 :style radio :selected (eq paren-mode 'paren)]
|
|
403 ["Expression" (paren-set-mode 'sexp)
|
|
404 :style radio :selected (eq paren-mode 'sexp)]
|
|
405 ;;; ["Nested Shading" (paren-set-mode 'nested)
|
|
406 ;;; :style radio :selected (eq paren-mode 'nested)]
|
|
407 )
|
|
408 "-----"
|
|
409 ("Frame Appearance"
|
|
410 ,@(if (featurep 'scrollbar)
|
|
411 '(["Scrollbars" (if (= (specifier-instance scrollbar-width) 0)
|
|
412 (progn
|
|
413 (set-specifier scrollbar-width 15)
|
|
414 (set-specifier scrollbar-height 15))
|
|
415 (set-specifier scrollbar-width 0)
|
|
416 (set-specifier scrollbar-height 0))
|
|
417 :style toggle :selected (> (specifier-instance scrollbar-width) 0)]))
|
|
418 ["3D Modeline"
|
|
419 (progn
|
|
420 (if (zerop (specifier-instance modeline-shadow-thickness))
|
|
421 (set-specifier modeline-shadow-thickness 2)
|
|
422 (set-specifier modeline-shadow-thickness 0))
|
|
423 (redraw-modeline t))
|
|
424 :style toggle :selected
|
|
425 (let ((thickness
|
|
426 (specifier-instance modeline-shadow-thickness)))
|
|
427 (and (integerp thickness)
|
|
428 (> thickness 0)))]
|
|
429 ["Truncate Lines" (progn
|
|
430 (setq truncate-lines (not truncate-lines))
|
|
431 (setq-default truncate-lines truncate-lines))
|
|
432 :style toggle :selected truncate-lines]
|
|
433 ["Bar Cursor" (progn
|
|
434 (setq bar-cursor
|
|
435 (if (not bar-cursor) 2 nil))
|
|
436 (force-cursor-redisplay))
|
|
437 :style toggle :selected bar-cursor]
|
|
438 ["Blinking Cursor" (blink-cursor-mode)
|
|
439 :style toggle
|
|
440 :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)]
|
10
|
441 ["Frame-Local Font Menu" (setq font-menu-this-frame-only-p
|
|
442 (not font-menu-this-frame-only-p))
|
|
443 :style toggle :selected font-menu-this-frame-only-p]
|
0
|
444 ; ["Line Numbers" (line-number-mode nil)
|
|
445 ; :style toggle :selected line-number-mode]
|
|
446 )
|
|
447 ("Menubar Appearance"
|
|
448 ["Buffers Menu Length..."
|
|
449 (progn
|
|
450 (setq buffers-menu-max-size
|
|
451 (read-number
|
|
452 "Enter number of buffers to display (or 0 for unlimited): "))
|
|
453 (if (eq buffers-menu-max-size 0) (setq buffers-menu-max-size nil)))
|
|
454 t]
|
|
455 ["Multi-Operation Buffers Sub-Menus"
|
|
456 (setq complex-buffers-menu-p
|
|
457 (not complex-buffers-menu-p))
|
|
458 :style toggle :selected complex-buffers-menu-p]
|
|
459 ("Buffers Menu Sorting"
|
|
460 ["Most Recently Used"
|
|
461 (progn
|
|
462 (setq buffers-menu-sort-function nil)
|
|
463 (setq buffers-menu-grouping-function nil))
|
|
464 :style radio
|
|
465 :selected (null buffers-menu-sort-function)]
|
|
466 ["Alphabetically"
|
|
467 (progn
|
|
468 (setq buffers-menu-sort-function
|
|
469 'sort-buffers-menu-alphabetically)
|
|
470 (setq buffers-menu-grouping-function nil))
|
|
471 :style radio
|
|
472 :selected (eq 'sort-buffers-menu-alphabetically
|
|
473 buffers-menu-sort-function)]
|
|
474 ["By Major Mode, Then Alphabetically"
|
|
475 (progn
|
|
476 (setq buffers-menu-sort-function
|
|
477 'sort-buffers-menu-by-mode-then-alphabetically)
|
|
478 (setq buffers-menu-grouping-function
|
|
479 'group-buffers-menu-by-mode-then-alphabetically))
|
|
480 :style radio
|
|
481 :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically
|
|
482 buffers-menu-sort-function)])
|
|
483 ["Submenus for Buffer Groups"
|
|
484 (setq buffers-menu-submenus-for-groups-p
|
|
485 (not buffers-menu-submenus-for-groups-p))
|
|
486 :style toggle
|
|
487 :selected buffers-menu-submenus-for-groups-p
|
|
488 :active (not (null buffers-menu-grouping-function))]
|
|
489 "---"
|
|
490 ["Ignore Scaled Fonts" (setq font-menu-ignore-scaled-fonts
|
|
491 (not font-menu-ignore-scaled-fonts))
|
|
492 :style toggle :selected font-menu-ignore-scaled-fonts]
|
|
493 )
|
|
494 ,@(if (featurep 'toolbar)
|
|
495 '(("Toolbar Appearance"
|
|
496 ["Visible" (set-specifier default-toolbar-visible-p
|
|
497 (not (specifier-instance
|
|
498 default-toolbar-visible-p)))
|
|
499 :style toggle
|
|
500 :selected (specifier-instance default-toolbar-visible-p)]
|
|
501 ["Captioned" (set-specifier toolbar-buttons-captioned-p
|
|
502 (not (specifier-instance
|
|
503 toolbar-buttons-captioned-p)))
|
|
504 :style toggle
|
|
505 :selected
|
|
506 (specifier-instance toolbar-buttons-captioned-p)]
|
|
507 ("Default Location"
|
|
508 ["Top" (set-default-toolbar-position 'top)
|
|
509 :style radio :selected (eq (default-toolbar-position) 'top)]
|
|
510 ["Bottom" (set-default-toolbar-position 'bottom)
|
|
511 :style radio :selected (eq (default-toolbar-position) 'bottom)]
|
|
512 ["Left" (set-default-toolbar-position 'left)
|
|
513 :style radio :selected (eq (default-toolbar-position) 'left)]
|
|
514 ["Right" (set-default-toolbar-position 'right)
|
|
515 :style radio :selected (eq (default-toolbar-position) 'right)]
|
|
516 )
|
|
517 )))
|
14
|
518 ("Mouse"
|
|
519 ["Avoid-Text"
|
|
520 (if (equal (device-type) 'x)
|
|
521 (if mouse-avoidance-mode
|
|
522 (mouse-avoidance-mode 'none)
|
|
523 (mouse-avoidance-mode 'banish))
|
|
524 (beep)
|
|
525 (message "This option requires a window system."))
|
|
526 :style toggle :selected (and mouse-avoidance-mode window-system)])
|
0
|
527 ("Open URLs With"
|
|
528 ["Emacs-W3" (setq browse-url-browser-function 'browse-url-w3)
|
|
529 :style radio
|
|
530 :selected (eq browse-url-browser-function 'browse-url-w3)]
|
|
531 ["Netscape" (setq browse-url-browser-function 'browse-url-netscape)
|
|
532 :style radio
|
|
533 :selected (eq browse-url-browser-function 'browse-url-netscape)]
|
|
534 ["Mosaic" (setq browse-url-browser-function 'browse-url-mosaic)
|
|
535 :style radio
|
|
536 :selected (eq browse-url-browser-function 'browse-url-mosaic)]
|
|
537 ["Mosaic (CCI)" (setq browse-url-browser-function 'browse-url-cci)
|
|
538 :style radio
|
|
539 :selected (eq browse-url-browser-function 'browse-url-iximosaic)]
|
|
540 ["IXI Mosaic" (setq browse-url-browser-function 'browse-url-iximosaic)
|
|
541 :style radio
|
|
542 :selected (eq browse-url-browser-function 'browse-url-iximosaic)]
|
|
543 ["Lynx (xterm)" (setq browse-url-browser-function 'browse-url-lynx-xterm)
|
|
544 :style radio
|
|
545 :selected (eq browse-url-browser-function 'browse-url-lynx-xterm)]
|
|
546 ["Lynx (xemacs)" (setq browse-url-browser-function 'browse-url-lynx-emacs)
|
|
547 :style radio
|
|
548 :selected (eq browse-url-browser-function 'browse-url-lynx-emacs)]
|
|
549 ["Grail" (setq browse-url-browser-function 'browse-url-grail)
|
|
550 :style radio
|
|
551 :selected (eq browse-url-browser-function 'browse-url-grail)]
|
|
552 )
|
|
553 "-----"
|
30
|
554 ["Browse Faces..." edit-faces t]
|
0
|
555 ("Font" :filter font-menu-family-constructor)
|
|
556 ("Size" :filter font-menu-size-constructor)
|
|
557 ("Weight" :filter font-menu-weight-constructor)
|
|
558 "-----"
|
|
559 ["Save Options" save-options-menu-settings t]
|
|
560 )
|
|
561
|
|
562 ("Buffers"
|
|
563 :filter buffers-menu-filter
|
|
564 ["List All Buffers" list-buffers t]
|
|
565 "--"
|
|
566 )
|
|
567
|
|
568 ("Tools"
|
|
569 ["Grep..." grep t]
|
|
570 ["Compile..." compile t]
|
6
|
571 ["Shell" shell t]
|
0
|
572 ["Shell Command..." shell-command t]
|
|
573 ["Shell Command on Region..."
|
|
574 shell-command-on-region (region-exists-p)]
|
|
575 ["Debug (GDB)..." gdb t]
|
|
576 ["Debug (DBX)..." dbx t]
|
|
577 "-----"
|
|
578 ["OO-Browser..." oobr t]
|
|
579 ("Tags"
|
|
580 ["Find..." find-tag t]
|
|
581 ["Find Other Window..." find-tag-other-window t]
|
|
582 ["Tags Search..." tags-search t]
|
|
583 ["Tags Replace..." tags-query-replace t]
|
|
584 "-----"
|
6
|
585 ["Continue Search/Replace" tags-loop-continue t]
|
0
|
586 ["Pop stack" pop-tag-mark t]
|
|
587 ["Apropos..." tags-apropos t]))
|
|
588
|
|
589 nil ; the partition: menus after this are flushright
|
|
590
|
|
591 ("Help"
|
|
592 ["About XEmacs..." about-xemacs t]
|
10
|
593 ("Basics"
|
16
|
594 ["Tutorial" help-with-tutorial t]
|
|
595 ["News" view-emacs-news t]
|
|
596 ["Packages" finder-by-keyword t]
|
|
597 ["Splash" xemacs-splash-buffer t])
|
0
|
598 "-----"
|
16
|
599 ("XEmacs FAQ"
|
26
|
600 ["FAQ (local)" xemacs-local-faq t]
|
16
|
601 ["FAQ via WWW" xemacs-www-faq t]
|
|
602 ["Home Page" xemacs-www-page t])
|
10
|
603 ("Samples"
|
|
604 ["Sample .emacs" (find-file
|
0
|
605 (expand-file-name "sample.emacs"
|
|
606 data-directory))
|
10
|
607 t]
|
|
608 ["Sample .Xdefaults" (find-file
|
6
|
609 (expand-file-name "sample.Xdefaults"
|
|
610 data-directory))
|
14
|
611 t]
|
|
612 ["Sample enriched" (find-file
|
|
613 (expand-file-name "enriched.doc"
|
|
614 data-directory))
|
10
|
615 t])
|
0
|
616 "-----"
|
|
617 ("Lookup in Info"
|
16
|
618 ["Key Binding..." Info-goto-emacs-key-command-node t]
|
0
|
619 ["Command..." Info-goto-emacs-command-node t]
|
16
|
620 ["Function..." Info-elisp-ref t]
|
0
|
621 ["Topic..." Info-query t])
|
10
|
622 ("Manuals"
|
16
|
623 ["Info" info t]
|
10
|
624 ["Unix Manual..." manual-entry t])
|
|
625 ("Commands & Keys"
|
16
|
626 ["Mode" describe-mode t]
|
10
|
627 ["Apropos..." hyper-apropos t]
|
16
|
628 ["Apropos Docs..." apropos-documentation t]
|
10
|
629 "-----"
|
16
|
630 ["Key..." describe-key t]
|
|
631 ["Bindings" describe-bindings t]
|
|
632 ["Mouse Bindings" describe-pointer t]
|
|
633 ["Recent Keys" view-lossage t]
|
10
|
634 "-----"
|
16
|
635 ["Function..." describe-function t]
|
|
636 ["Variable..." describe-variable t]
|
|
637 ["Locate Command..." where-is t])
|
0
|
638 "-----"
|
16
|
639 ["Recent Messages" view-lossage t]
|
0
|
640 ("Misc"
|
16
|
641 ["No Warranty" describe-no-warranty t]
|
|
642 ["XEmacs License" describe-copying t]
|
|
643 ["The Latest Version" describe-distribution t])
|
0
|
644 )
|
|
645 )))
|
|
646
|
|
647
|
|
648 (defun maybe-add-init-button ()
|
2
|
649 "Don't call this.
|
|
650 Adds `Load .emacs' button to menubar when starting up with -q."
|
0
|
651 ;; by Stig@hackvan.com
|
|
652 (cond
|
|
653 (init-file-user nil)
|
|
654 ((file-exists-p (cond
|
|
655 ((eq system-type 'ms-dos)
|
|
656 (concat "~" (user-login-name) "/_emacs"))
|
|
657 ((eq system-type 'vax-vms)
|
|
658 "sys$login:.emacs")
|
|
659 (t
|
|
660 (concat "~" (user-login-name) "/.emacs"))))
|
|
661 (add-menu-button nil
|
|
662 ["Load .emacs"
|
|
663 (progn (delete-menu-item '("Load .emacs"))
|
|
664 (load-user-init-file (user-login-name)))
|
|
665 t]
|
|
666 "Help"))
|
|
667 (t nil)))
|
|
668
|
|
669 (add-hook 'before-init-hook 'maybe-add-init-button)
|
|
670
|
|
671
|
|
672 ;;; The File and Edit menus
|
|
673
|
|
674 (defvar put-buffer-names-in-file-menu t)
|
|
675
|
|
676 ;; The sensitivity part of this function could be done by just adding forms
|
|
677 ;; to evaluate to the menu items themselves; that would be marginally less
|
|
678 ;; efficient but not perceptibly so (I think). But in order to change the
|
|
679 ;; names of the Undo menu item and the various things on the File menu item,
|
|
680 ;; we need to use a hook.
|
|
681
|
|
682 (defun file-menu-filter (menu-items)
|
|
683 "Incrementally update the file menu.
|
|
684 This function changes the arguments and sensitivity of these File menu items:
|
|
685
|
|
686 Delete Buffer has the name of the current buffer appended to it.
|
|
687 Print Buffer has the name of the current buffer appended to it.
|
|
688 Pretty-Print Buffer
|
|
689 has the name of the current buffer appended to it.
|
|
690 Save has the name of the current buffer appended to it, and is
|
|
691 sensitive only when the current buffer is modified.
|
|
692 Revert Buffer has the name of the current buffer appended to it, and is
|
|
693 sensitive only when the current buffer has a file.
|
|
694 Delete Frame sensitive only when there is more than one frame.
|
|
695
|
|
696 The name of the current buffer is only appended to the menu items if
|
|
697 `put-buffer-names-in-file-menu' is non-nil. This behavior is the default."
|
|
698 (let* ((bufname (buffer-name))
|
|
699 (result menu-items) ; save pointer to start of menu.
|
|
700 name
|
|
701 item)
|
|
702 ;; the contents of the menu items in the file menu are destructively
|
|
703 ;; modified so that there is as little consing as possible. This is okay.
|
|
704 ;; As soon as the result is returned, it is converted to widget_values
|
|
705 ;; inside lwlib and the lisp menu-items can be safely modified again.
|
|
706 (while (setq item (pop menu-items))
|
|
707 (if (vectorp item)
|
|
708 (progn
|
|
709 (setq name (aref item 0))
|
|
710 (and put-buffer-names-in-file-menu
|
|
711 (member name '("Save" "Revert Buffer" "Print Buffer"
|
|
712 "Pretty-Print Buffer" "Delete Buffer"))
|
|
713 (>= 4 (length item))
|
|
714 (aset item 3 bufname))
|
|
715 (and (string= "Save" name)
|
|
716 (aset item 2 (buffer-modified-p)))
|
|
717 (and (string= "Revert Buffer" name)
|
|
718 (aset item 2 (not (not (or buffer-file-name
|
|
719 revert-buffer-function)))))
|
|
720 (and (string= "Delete Frame" name)
|
|
721 (aset item 2 (not (eq (next-frame) (selected-frame)))))
|
|
722 )))
|
|
723 result))
|
|
724
|
|
725 (defun edit-menu-filter (menu-items)
|
|
726 "For use as an incremental menu construction filter.
|
|
727 This function changes the sensitivity of these Edit menu items:
|
|
728
|
|
729 Cut sensitive only when emacs owns the primary X Selection.
|
|
730 Copy sensitive only when emacs owns the primary X Selection.
|
|
731 Clear sensitive only when emacs owns the primary X Selection.
|
|
732 Paste sensitive only when there is an owner for the X Clipboard Selection.
|
|
733 Undo sensitive only when there is undo information.
|
|
734 While in the midst of an undo, this is changed to \"Undo More\"."
|
|
735 (let* (item
|
|
736 name
|
|
737 (result menu-items) ; save pointer to head of list
|
|
738 (x-dev (eq 'x (device-type (selected-device))))
|
|
739 (emacs-owns-selection-p (and x-dev (x-selection-owner-p)))
|
|
740 (clipboard-exists-p (and x-dev (x-selection-exists-p 'CLIPBOARD)))
|
|
741 ;;; undo-available undoing-more
|
|
742 ;;; (undo-info-available (not (null (and (not (eq t buffer-undo-list))
|
|
743 ;;; (if (eq last-command 'undo)
|
|
744 ;;; (setq undoing-more
|
|
745 ;;; (and (boundp 'pending-undo-list)
|
|
746 ;;; pending-undo-list)
|
|
747 ;;; buffer-undo-list))))))
|
|
748 undo-name undo-state
|
|
749 )
|
|
750 ;; As with file-menu-filter, menu-items are destructively modified.
|
|
751 ;; This is OK.
|
|
752 (while (setq item (pop menu-items))
|
|
753 (if (vectorp item)
|
|
754 (progn
|
|
755 (setq name (aref item 0))
|
|
756 (and (member name '("Cut" "Copy" "Clear"))
|
|
757 (aset item 2 emacs-owns-selection-p))
|
|
758 (and (string= name "Paste")
|
|
759 (aset item 2 clipboard-exists-p))
|
|
760 (and (member name '("Undo" "Undo More"))
|
|
761 (progn
|
|
762 ;; we could also do this with the third field of the item.
|
|
763 (if (eq last-command 'undo)
|
|
764 (setq undo-name "Undo More"
|
|
765 undo-state (not (null (and (boundp 'pending-undo-list)
|
|
766 pending-undo-list))))
|
|
767 (setq undo-name "Undo"
|
|
768 undo-state (and (not (eq buffer-undo-list t))
|
|
769 (not (null
|
|
770 (or buffer-undo-list
|
|
771 (and (boundp 'pending-undo-list)
|
|
772 pending-undo-list)))))))
|
|
773 (if buffer-read-only (setq undo-state nil))
|
|
774 (aset item 0 undo-name)
|
|
775 (aset item 2 undo-state)
|
|
776 ))
|
|
777 )))
|
|
778 result))
|
|
779
|
|
780
|
|
781 ;;; The Buffers menu
|
|
782
|
|
783 (defvar buffers-menu-max-size 25
|
|
784 "*Maximum number of entries which may appear on the \"Buffers\" menu.
|
|
785 If this is 10, then only the ten most-recently-selected buffers will be
|
|
786 shown. If this is nil, then all buffers will be shown. Setting this to
|
|
787 a large number or nil will slow down menu responsiveness.")
|
|
788
|
|
789 (defvar complex-buffers-menu-p nil
|
|
790 "*If true, the buffers menu will contain several commands, as submenus
|
|
791 of each buffer line. If this is false, then there will be only one command:
|
|
792 select that buffer.")
|
|
793
|
|
794 (defvar buffers-menu-submenus-for-groups-p nil
|
|
795 "*If true, the buffers menu will contain one submenu per group of buffers,
|
6
|
796 if a grouping function is specified in `buffers-menu-grouping-function'.
|
|
797 If this is an integer, do not build submenus if the number of buffers
|
|
798 is not larger than this value.")
|
0
|
799
|
|
800 (defvar buffers-menu-switch-to-buffer-function 'switch-to-buffer
|
|
801 "*The function to call to select a buffer from the buffers menu.
|
|
802 `switch-to-buffer' is a good choice, as is `pop-to-buffer'.")
|
|
803
|
|
804 (defvar buffers-menu-omit-function 'buffers-menu-omit-invisible-buffers
|
|
805 "*If non-nil, a function specifying the buffers to omit from the buffers menu.
|
|
806 This is passed a buffer and should return non-nil if the buffer should be
|
|
807 omitted. The default value `buffers-menu-omit-invisible-buffers' omits
|
|
808 buffers that are normally considered \"invisible\" (those whose name
|
|
809 begins with a space).")
|
|
810
|
|
811 (defvar buffers-menu-format-buffer-line-function 'format-buffers-menu-line
|
|
812 "*The function to call to return a string to represent a buffer in the
|
|
813 buffers menu. The function is passed a buffer and should return a string.
|
|
814 The default value `format-buffers-menu-line' just returns the name of
|
|
815 the buffer. Also check out `slow-format-buffers-menu-line' which
|
|
816 returns a whole bunch of info about a buffer.")
|
|
817
|
|
818 (defvar buffers-menu-sort-function
|
|
819 'sort-buffers-menu-by-mode-then-alphabetically
|
|
820 "*If non-nil, a function to sort the list of buffers in the buffers menu.
|
|
821 It will be passed two arguments (two buffers to compare) and should return
|
|
822 T if the first is \"less\" than the second. One possible value is
|
|
823 `sort-buffers-menu-alphabetically'; another is
|
|
824 `sort-buffers-menu-by-mode-then-alphabetically'.")
|
|
825
|
|
826 (defvar buffers-menu-grouping-function
|
|
827 'group-buffers-menu-by-mode-then-alphabetically
|
|
828 "*If non-nil, a function to group buffers in the buffers menu together.
|
|
829 It will be passed two arguments, successive members of the sorted buffers
|
|
830 list after being passed through `buffers-menu-sort-function'. It should
|
|
831 return non-nil if the second buffer begins a new group. The return value
|
|
832 should be the name of the old group, which may be used in hierarchical
|
|
833 buffers menus. The last invocation of the function contains nil as the
|
|
834 second argument, so that the name of the last group can be determined.
|
|
835
|
|
836 The sensible values of this function are dependent on the value specified
|
|
837 for `buffers-menu-sort-function'.")
|
|
838
|
|
839 (defun buffers-menu-omit-invisible-buffers (buf)
|
|
840 "For use as a value of `buffers-menu-omit-function'.
|
|
841 Omits normally invisible buffers (those whose name begins with a space)."
|
|
842 (not (null (string-match "\\` " (buffer-name buf)))))
|
|
843
|
|
844 (defun sort-buffers-menu-alphabetically (buf1 buf2)
|
|
845 "For use as a value of `buffers-menu-sort-function'.
|
|
846 Sorts the buffers in alphabetical order by name, but puts buffers beginning
|
|
847 with a star at the end of the list."
|
|
848 (let* ((nam1 (buffer-name buf1))
|
|
849 (nam2 (buffer-name buf2))
|
|
850 (star1p (not (null (string-match "\\`*" nam1))))
|
|
851 (star2p (not (null (string-match "\\`*" nam2)))))
|
|
852 (if (not (eq star1p star2p))
|
|
853 (not star1p)
|
|
854 (string-lessp nam1 nam2))))
|
|
855
|
|
856 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
|
|
857 "For use as a value of `buffers-menu-sort-function'.
|
|
858 Sorts first by major mode and then alphabetically by name, but puts buffers
|
|
859 beginning with a star at the end of the list."
|
|
860 (let* ((nam1 (buffer-name buf1))
|
|
861 (nam2 (buffer-name buf2))
|
|
862 (star1p (not (null (string-match "\\`*" nam1))))
|
|
863 (star2p (not (null (string-match "\\`*" nam2))))
|
|
864 (mode1 (symbol-value-in-buffer 'major-mode buf1))
|
|
865 (mode2 (symbol-value-in-buffer 'major-mode buf2)))
|
|
866 (cond ((not (eq star1p star2p)) (not star1p))
|
|
867 ((and star1p star2p (string-lessp nam1 nam2)))
|
|
868 ((string-lessp mode1 mode2) t)
|
|
869 ((string-lessp mode2 mode1) nil)
|
|
870 (t (string-lessp nam1 nam2)))))
|
|
871
|
|
872 ;; this version is too slow on some machines.
|
|
873 (defun slow-format-buffers-menu-line (buffer)
|
|
874 "For use as a value of `buffers-menu-format-buffer-line-function'.
|
|
875 This returns a string containing a bunch of info about the buffer."
|
|
876 (format "%s%s %-19s %6s %-15s %s"
|
|
877 (if (buffer-modified-p buffer) "*" " ")
|
|
878 (if (symbol-value-in-buffer 'buffer-read-only buffer) "%" " ")
|
|
879 (buffer-name buffer)
|
|
880 (buffer-size buffer)
|
|
881 (symbol-value-in-buffer 'mode-name buffer)
|
|
882 (or (buffer-file-name buffer) "")))
|
|
883
|
|
884 (defun format-buffers-menu-line (buffer)
|
|
885 "For use as a value of `buffers-menu-format-buffer-line-function'.
|
|
886 This just returns the buffer's name."
|
|
887 (buffer-name buffer))
|
|
888
|
|
889 (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
|
|
890 "For use as a value of `buffers-menu-grouping-function'.
|
|
891 This groups buffers by major mode. It only really makes sense if
|
|
892 `buffers-menu-sorting-function' is
|
|
893 `sort-buffers-menu-by-mode-then-alphabetically'."
|
|
894 (cond ((string-match "\\`*" (buffer-name buf1))
|
|
895 (and (null buf2) "*Misc*"))
|
|
896 ((or (null buf2)
|
|
897 (string-match "\\`*" (buffer-name buf2))
|
|
898 (not (eq (symbol-value-in-buffer 'major-mode buf1)
|
|
899 (symbol-value-in-buffer 'major-mode buf2))))
|
|
900 (symbol-value-in-buffer 'mode-name buf1))
|
|
901 (t nil)))
|
|
902
|
|
903 (defun buffer-menu-save-buffer (buffer)
|
|
904 (save-excursion
|
|
905 (set-buffer buffer)
|
|
906 (save-buffer)))
|
|
907
|
|
908 (defun buffer-menu-write-file (buffer)
|
|
909 (save-excursion
|
|
910 (set-buffer buffer)
|
|
911 (write-file (read-file-name
|
|
912 (format "Write %s to file: "
|
|
913 (buffer-name (current-buffer)))))))
|
|
914
|
|
915 (defsubst build-buffers-menu-internal (buffers)
|
|
916 (let (name line)
|
|
917 (mapcar
|
|
918 #'(lambda (buffer)
|
|
919 (if (eq buffer t)
|
|
920 "---"
|
|
921 (setq line (funcall buffers-menu-format-buffer-line-function
|
|
922 buffer))
|
|
923 (if complex-buffers-menu-p
|
|
924 (delq nil
|
|
925 (list line
|
|
926 (vector "Switch to Buffer"
|
|
927 (list buffers-menu-switch-to-buffer-function
|
|
928 (setq name (buffer-name buffer)))
|
|
929 t)
|
|
930 (if (eq buffers-menu-switch-to-buffer-function
|
|
931 'switch-to-buffer)
|
|
932 (vector "Switch to Buffer, Other Frame"
|
|
933 (list 'switch-to-buffer-other-frame
|
|
934 (setq name (buffer-name buffer)))
|
|
935 t)
|
|
936 nil)
|
|
937 (if (and (buffer-modified-p buffer)
|
|
938 (buffer-file-name buffer))
|
|
939 (vector "Save Buffer"
|
|
940 (list 'buffer-menu-save-buffer name) t)
|
|
941 ["Save Buffer" nil nil]
|
|
942 )
|
|
943 (vector "Save As..."
|
|
944 (list 'buffer-menu-write-file name) t)
|
|
945 (vector "Delete Buffer" (list 'kill-buffer name)
|
|
946 t)))
|
|
947 (vector line
|
|
948 (list buffers-menu-switch-to-buffer-function
|
|
949 (buffer-name buffer))
|
|
950 t))))
|
|
951 buffers)))
|
|
952
|
|
953 (defun buffers-menu-filter (menu)
|
|
954 "This is the menu filter for the top-level buffers \"Buffers\" menu.
|
|
955 It dynamically creates a list of buffers to use as the contents of the menu.
|
|
956 Only the most-recently-used few buffers will be listed on the menu, for
|
|
957 efficiency reasons. You can control how many buffers will be shown by
|
|
958 setting `buffers-menu-max-size'. You can control the text of the menu
|
|
959 items by redefining the function `format-buffers-menu-line'."
|
|
960 (let ((buffers (delete-if buffers-menu-omit-function (buffer-list))))
|
|
961 (and (integerp buffers-menu-max-size)
|
|
962 (> buffers-menu-max-size 1)
|
|
963 (> (length buffers) buffers-menu-max-size)
|
6
|
964 ;; shorten list of buffers (not with submenus!)
|
|
965 (not (and buffers-menu-grouping-function
|
|
966 buffers-menu-submenus-for-groups-p))
|
0
|
967 (setcdr (nthcdr buffers-menu-max-size buffers) nil))
|
|
968 (if buffers-menu-sort-function
|
|
969 (setq buffers (sort buffers buffers-menu-sort-function)))
|
|
970 (if (and buffers-menu-grouping-function
|
6
|
971 buffers-menu-submenus-for-groups-p
|
|
972 (or (not (integerp buffers-menu-submenus-for-groups-p))
|
|
973 (> (length buffers) buffers-menu-submenus-for-groups-p)))
|
0
|
974 (let (groups groupnames current-group)
|
|
975 (mapl
|
|
976 #'(lambda (sublist)
|
|
977 (let ((groupname (funcall buffers-menu-grouping-function
|
|
978 (car sublist) (cadr sublist))))
|
|
979 (setq current-group (cons (car sublist) current-group))
|
|
980 (if groupname
|
|
981 (progn
|
|
982 (setq groups (cons (nreverse current-group)
|
|
983 groups))
|
|
984 (setq groupnames (cons groupname groupnames))
|
|
985 (setq current-group nil)))))
|
|
986 buffers)
|
|
987 (setq buffers
|
|
988 (mapcar*
|
|
989 #'(lambda (groupname group)
|
|
990 (cons groupname (build-buffers-menu-internal group)))
|
|
991 (nreverse groupnames)
|
|
992 (nreverse groups))))
|
|
993 (if buffers-menu-grouping-function
|
|
994 (progn
|
|
995 (setq buffers
|
|
996 (mapcon
|
|
997 #'(lambda (sublist)
|
|
998 (cond ((funcall buffers-menu-grouping-function
|
|
999 (car sublist) (cadr sublist))
|
|
1000 (list (car sublist) t))
|
|
1001 (t (list (car sublist)))))
|
|
1002 buffers))
|
|
1003 ;; remove a trailing separator.
|
|
1004 (and (>= (length buffers) 2)
|
|
1005 (let ((lastcdr (nthcdr (- (length buffers) 2) buffers)))
|
|
1006 (if (eq t (cadr lastcdr))
|
|
1007 (setcdr lastcdr nil))))))
|
|
1008 (setq buffers (build-buffers-menu-internal buffers)))
|
|
1009 (append menu buffers)
|
|
1010 ))
|
|
1011
|
|
1012
|
|
1013
|
|
1014 ;;; The Options menu
|
4
|
1015 (defvar save-options-font-hack nil)
|
0
|
1016
|
26
|
1017 (defvar options-save-faces nil
|
|
1018 "if t, save-options will save all the face information.
|
|
1019 Set to nil to avoid this. This is recommended on XEmacs 19.15
|
|
1020 and above as we have a much more powerful (read: working) way
|
|
1021 of changing and saving faces via cu-edit-faces.el & custom.el.")
|
|
1022
|
0
|
1023 (defconst options-menu-saved-forms
|
|
1024 ;; This is really quite a kludge, but it gets the job done.
|
|
1025 ;;
|
|
1026 ;; remember that we have to conditionalize on default features
|
|
1027 ;; both in the forms to evaluate and in the forms output to
|
|
1028 ;; .emacs, in case the .emacs is loaded into an XEmacs with
|
|
1029 ;; different features.
|
|
1030 (purecopy
|
|
1031 '(
|
|
1032 ;; Editing Options menu.
|
|
1033 ;; put case-fold-search first to defeat a bug in the backquote
|
|
1034 ;; processing mechanism. Feh!
|
|
1035 case-fold-search
|
|
1036 `(setq-default overwrite-mode ,(default-value 'overwrite-mode))
|
|
1037 (if (default-value 'overwrite-mode)
|
|
1038 '(overwrite-mode 1))
|
|
1039 `(setq-default case-fold-search ,(default-value 'case-fold-search))
|
|
1040 case-replace
|
|
1041 (if (memq 'pending-delete-pre-hook pre-command-hook)
|
|
1042 '(progn
|
|
1043 (require 'pending-del)
|
|
1044 (pending-delete-on nil)))
|
|
1045 zmacs-regions
|
|
1046 mouse-yank-at-point
|
12
|
1047 require-final-newline
|
|
1048 next-line-add-newlines
|
0
|
1049
|
|
1050 ;; General Options menu.
|
|
1051 teach-extended-commands-p
|
|
1052 ;; (#### not actually on Options menu)
|
|
1053 teach-extended-commands-timeout
|
|
1054 debug-on-error
|
|
1055 debug-on-quit
|
|
1056
|
|
1057 ;; Printing Options menu.
|
|
1058 lpr-switches
|
|
1059 ps-print-color-p
|
|
1060 ps-paper-type
|
|
1061
|
|
1062 ;; Other Window Location
|
|
1063 get-frame-for-buffer-default-instance-limit
|
|
1064 temp-buffer-show-function
|
12
|
1065 (if gnuserv-frame
|
|
1066 '(setq gnuserv-frame (selected-frame)))
|
0
|
1067
|
|
1068 ;; Syntax Highlighting
|
|
1069 font-lock-auto-fontify
|
|
1070 font-lock-use-fonts
|
|
1071 font-lock-use-colors
|
|
1072 font-lock-maximum-decoration
|
|
1073 font-lock-maximum-size
|
|
1074 ;; (#### the next two not on Options menu)
|
|
1075 font-lock-mode-enable-list
|
|
1076 font-lock-mode-disable-list
|
|
1077 ;; #### - this structure is clearly broken. There's no way to ever
|
|
1078 ;; un-require font-lock via the menus. --Stig
|
|
1079 (if (featurep 'font-lock)
|
|
1080 '(require 'font-lock))
|
|
1081 (if (and (boundp 'font-lock-mode-hook)
|
|
1082 (memq 'turn-on-fast-lock font-lock-mode-hook))
|
|
1083 '(add-hook 'font-lock-mode-hook 'turn-on-fast-lock)
|
|
1084 '(remove-hook 'font-lock-mode-hook 'turn-on-fast-lock))
|
|
1085 (if (and (boundp 'font-lock-mode-hook)
|
|
1086 (memq 'turn-on-lazy-lock font-lock-mode-hook))
|
|
1087 '(add-hook 'font-lock-mode-hook 'turn-on-lazy-lock)
|
|
1088 '(remove-hook 'font-lock-mode-hook 'turn-on-lazy-lock))
|
|
1089
|
|
1090 ;; Paren Highlighting
|
|
1091 (if paren-mode
|
|
1092 `(progn (require 'paren) (paren-set-mode ',paren-mode)))
|
|
1093
|
|
1094 ;; For specifiers, we only save global settings since the others
|
|
1095 ;; will belong to objects which only exist during this session.
|
|
1096
|
|
1097 ;; Frame Appearance
|
|
1098 (if (featurep 'scrollbar)
|
|
1099 `(if (featurep 'scrollbar)
|
|
1100 (progn
|
|
1101 (add-spec-list-to-specifier
|
|
1102 scrollbar-width
|
|
1103 ',(specifier-spec-list scrollbar-width 'global))
|
|
1104 (add-spec-list-to-specifier
|
|
1105 scrollbar-height
|
|
1106 ',(specifier-spec-list scrollbar-height 'global)))))
|
|
1107 `(add-spec-list-to-specifier
|
|
1108 modeline-shadow-thickness
|
|
1109 ',(specifier-spec-list modeline-shadow-thickness 'global))
|
|
1110 `(setq-default truncate-lines ,(default-value 'truncate-lines))
|
|
1111 bar-cursor
|
|
1112 (if (and (boundp 'blink-cursor-mode) blink-cursor-mode)
|
|
1113 '(blink-cursor-mode t))
|
|
1114
|
|
1115 ;; Menubar Appearance
|
|
1116 buffers-menu-max-size
|
|
1117 complex-buffers-menu-p
|
|
1118 buffers-menu-sort-function
|
|
1119 buffers-menu-grouping-function
|
|
1120 buffers-menu-submenus-for-groups-p
|
|
1121 font-menu-ignore-scaled-fonts
|
|
1122 font-menu-this-frame-only-p
|
|
1123
|
|
1124 ;; Toolbar Appearance
|
|
1125 (if (featurep 'toolbar)
|
|
1126 `(if (featurep 'toolbar)
|
|
1127 (progn
|
|
1128 (set-default-toolbar-position
|
|
1129 ',(default-toolbar-position))
|
|
1130 (add-spec-list-to-specifier
|
|
1131 default-toolbar-visible-p
|
|
1132 ',(specifier-spec-list default-toolbar-visible-p 'global))
|
|
1133 (add-spec-list-to-specifier
|
|
1134 toolbar-buttons-captioned-p
|
|
1135 ',(specifier-spec-list toolbar-buttons-captioned-p
|
|
1136 'global)))))
|
|
1137
|
14
|
1138 ;; mouse
|
|
1139 mouse-avoidance-mode
|
|
1140
|
0
|
1141 ;; Open URLs With
|
|
1142 browse-url-browser-function
|
|
1143
|
|
1144 ;; Now save all faces.
|
|
1145
|
|
1146 ;; Setting this in lisp conflicts with X resources. Bad move. --Stig
|
|
1147 ;; (list 'set-face-font ''default (face-font-name 'default))
|
|
1148 ;; (list 'set-face-font ''modeline (face-font-name 'modeline))
|
26
|
1149 (if options-save-faces
|
|
1150 (cons 'progn
|
|
1151 (mapcar #'(lambda (face)
|
|
1152 `(make-face ',face))
|
30
|
1153 (save-options-non-customized-face-list))))
|
26
|
1154
|
|
1155 (if options-save-faces
|
|
1156 (cons 'progn
|
|
1157 (apply 'nconc
|
|
1158 (mapcar
|
|
1159 #'(lambda (face)
|
|
1160 (delq nil
|
|
1161 (mapcar
|
|
1162 #'(lambda (property)
|
|
1163 (if (specifier-spec-list
|
|
1164 (face-property face property))
|
|
1165 `(add-spec-list-to-specifier
|
|
1166 (face-property ',face ',property)
|
|
1167 ',(save-options-specifier-spec-list
|
|
1168 face property))))
|
|
1169 (delq 'display-table
|
|
1170 (copy-sequence
|
|
1171 built-in-face-specifiers)))))
|
30
|
1172 (save-options-non-customized-face-list)))))
|
26
|
1173
|
0
|
1174 ))
|
|
1175 "The variables to save; or forms to evaluate to get forms to write out.
|
|
1176 This is used by `save-options-menu-settings' and should mirror the
|
|
1177 options listed in the Options menu.")
|
|
1178
|
30
|
1179 (defun save-options-non-customized-face-list ()
|
|
1180 "This function will return a list of all faces that have not been
|
|
1181 'customized'."
|
|
1182 (delq nil (mapcar '(lambda (face)
|
|
1183 (if (not (or (get face 'saved-face)
|
|
1184 (get face 'factory-face)))
|
|
1185 face))
|
|
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)
|
|
1403 (let ((title (car mode-popup-menu))
|
|
1404 (items (cdr mode-popup-menu)))
|
|
1405 (append global-popup-menu
|
|
1406 '("---" "---")
|
|
1407 (if popup-menu-titles (list title))
|
|
1408 (if popup-menu-titles '("---" "---"))
|
|
1409 items)))
|
|
1410 (t
|
|
1411 (or mode-popup-menu
|
|
1412 global-popup-menu
|
|
1413 (error "No menu here."))))))
|
|
1414
|
|
1415 (defun popup-buffer-menu (event)
|
|
1416 "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked."
|
|
1417 (interactive "e")
|
|
1418 (let ((window (and (event-over-text-area-p event) (event-window event)))
|
|
1419 (bmenu nil))
|
|
1420 (or window
|
|
1421 (error "Pointer must be in a normal window"))
|
|
1422 (select-window window)
|
|
1423 (if current-menubar
|
|
1424 (setq bmenu (assoc "Buffers" current-menubar)))
|
|
1425 (if (null bmenu)
|
|
1426 (setq bmenu (assoc "Buffers" default-menubar)))
|
|
1427 (if (null bmenu)
|
|
1428 (error "Can't find the Buffers menu"))
|
|
1429 (popup-menu bmenu)))
|
|
1430
|
|
1431 (defun popup-menubar-menu (event)
|
|
1432 "Pop up a copy of menu that also appears in the menubar"
|
|
1433 ;; by Stig@hackvan.com
|
|
1434 (interactive "e")
|
|
1435 (let ((window (and (event-over-text-area-p event) (event-window event)))
|
|
1436 popup-menubar)
|
|
1437 (or window
|
|
1438 (error "Pointer must be in a normal window"))
|
|
1439 (select-window window)
|
|
1440 (and current-menubar (run-hooks 'activate-menubar-hook))
|
|
1441 ;; ##### Instead of having to copy this just to safely get rid of
|
|
1442 ;; any nil what we should really do is fix up the internal menubar
|
|
1443 ;; code to just ignore nil if generating a popup menu
|
|
1444 (setq popup-menubar (delete nil (copy-sequence (or current-menubar
|
|
1445 default-menubar))))
|
|
1446 (popup-menu (cons "Menubar Menu" popup-menubar))
|
|
1447 ))
|
|
1448
|
|
1449 (global-set-key 'button3 'popup-mode-menu)
|
|
1450 ;; shift button3 and shift button2 are reserved for Hyperbole
|
|
1451 (global-set-key '(meta control button3) 'popup-buffer-menu)
|
|
1452 (global-set-key '(meta shift button3) 'popup-menubar-menu)
|
|
1453
|
|
1454 ;; Here's a test of the cool new menu features (from Stig).
|
|
1455
|
|
1456 ;(setq mode-popup-menu
|
|
1457 ; '("Test Popup Menu"
|
|
1458 ; :filter cdr
|
|
1459 ; ["this item won't appear because of the menu filter" ding t]
|
|
1460 ; "--:singleLine"
|
|
1461 ; "singleLine"
|
|
1462 ; "--:doubleLine"
|
|
1463 ; "doubleLine"
|
|
1464 ; "--:singleDashedLine"
|
|
1465 ; "singleDashedLine"
|
|
1466 ; "--:doubleDashedLine"
|
|
1467 ; "doubleDashedLine"
|
|
1468 ; "--:noLine"
|
|
1469 ; "noLine"
|
|
1470 ; "--:shadowEtchedIn"
|
|
1471 ; "shadowEtchedIn"
|
|
1472 ; "--:shadowEtchedOut"
|
|
1473 ; "shadowEtchedOut"
|
|
1474 ; "--:shadowDoubleEtchedIn"
|
|
1475 ; "shadowDoubleEtchedIn"
|
|
1476 ; "--:shadowDoubleEtchedOut"
|
|
1477 ; "shadowDoubleEtchedOut"
|
|
1478 ; "--:shadowEtchedInDash"
|
|
1479 ; "shadowEtchedInDash"
|
|
1480 ; "--:shadowEtchedOutDash"
|
|
1481 ; "shadowEtchedOutDash"
|
|
1482 ; "--:shadowDoubleEtchedInDash"
|
|
1483 ; "shadowDoubleEtchedInDash"
|
|
1484 ; "--:shadowDoubleEtchedOutDash"
|
|
1485 ; "shadowDoubleEtchedOutDash"
|
|
1486 ; ))
|
|
1487
|
10
|
1488 (defun xemacs-splash-buffer ()
|
|
1489 "Redisplay XEmacs splash screen in a buffer."
|
|
1490 (interactive)
|
|
1491 (let ((buffer (get-buffer-create "*Splash*")))
|
|
1492 (set-buffer buffer)
|
|
1493 (erase-buffer buffer)
|
|
1494 (startup-splash-frame)
|
|
1495 (pop-to-buffer buffer)
|
|
1496 (delete-other-windows)))
|
0
|
1497
|
|
1498 (provide 'x-menubar)
|
|
1499
|
|
1500 ;;; x-menubar.el ends here.
|