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