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