1 ;;; menubar-items.el --- Menubar and popup-menu content for XEmacs.
3 ;; Copyright (C) 1991-1995, 1997-1998 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, 2000 Ben Wing.
7 ;; Copyright (C) 1997 MORIOKA Tomohiko.
9 ;; Maintainer: XEmacs Development Team
10 ;; Keywords: frames, extensions, internal, dumped
12 ;; This file is part of XEmacs.
14 ;; XEmacs is free software; you can redistribute it and/or modify it
15 ;; under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation; either version 2, or (at your option)
19 ;; XEmacs is distributed in the hope that it will be useful, but
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 ;; General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with Xmacs; see the file COPYING. If not, write to the
26 ;; Free Software Foundation, 59 Temple Place - Suite 330,
27 ;; Boston, MA 02111-1307, USA.
31 ;; Created c. 1991 for Lucid Emacs. Originally called x-menubar.el.
32 ;; Contained four menus -- File, Edit, Buffers, Help.
33 ;; Dynamic menu changes possible only through activate-menubar-hook.
34 ;; Also contained menu manipulation funs, e.g. find-menu-item, add-menu.
35 ;; Options menu added for 19.9 by Jamie Zawinski, late 1993.
36 ;; Major reorganization c. 1994 by Ben Wing; added many items and moved
37 ;; some items to two new menus, Apps and Tools. (for 19.10?)
38 ;; Generic menubar functions moved to new file, menubar.el, by Ben Wing,
39 ;; 1995, for 19.12; also, creation of current buffers menu options,
40 ;; and buffers menu changed from purely most-recent to sorted alphabetical,
41 ;; by mode. Also added mode-popup-menu support.
42 ;; New API (add-submenu, add-menu-button) and menu filter support added
43 ;; late summer 1995 by Stig, for 19.13. Also popup-menubar-menu.
44 ;; Renamed to menubar-items.el c. 1998, with MS Win support.
45 ;; Options menu rewritten to use custom c. 1999 by ? (Jan Vroonhof?).
46 ;; Major reorganization Mar. 2000 by Ben Wing; added many items and changed
47 ;; top-level menus to File, Edit, View, Cmds, Tools, Options, Buffers.
48 ;; Accelerator spec functionality added Mar. 2000 by Ben Wing.
52 ;; This file is dumped with XEmacs (when window system and menubar support is
57 ;;; Warning-free compile
59 (defvar language-environment-list)
60 (defvar bookmark-alist)
61 (defvar language-info-alist)
62 (defvar current-language-environment)
63 (defvar tutorial-supported-languages))
65 (defun menu-truncate-list (list n)
66 (if (<= (length list) n)
68 (butlast list (- (length list) n))))
70 (defun submenu-generate-accelerator-spec (list &optional omit-chars-list)
71 "Add auto-generated accelerator specifications to a submenu.
72 This can be used to add accelerators to the return value of a menu filter
73 function. It correctly ignores unselectable items. It will destructively
74 modify the list passed to it. If an item already has an auto-generated
75 accelerator spec, this will be removed before the new one is added, making
76 this function idempotent.
78 If OMIT-CHARS-LIST is given, it should be a list of lowercase characters,
79 which will not be used as accelerators."
81 (dolist (item list list)
87 (menu-item-generate-accelerator-spec n omit-chars-list)
88 (menu-item-strip-accelerator-spec (aref item 0)))))
93 (menu-item-generate-accelerator-spec n omit-chars-list)
94 (menu-item-strip-accelerator-spec (car item)))))))))
96 (defun menu-item-strip-accelerator-spec (item)
97 "Strip an auto-generated accelerator spec off of ITEM.
98 ITEM should be a string. This removes specs added by
99 `menu-item-generate-accelerator-spec' and `submenu-generate-accelerator-spec'."
100 (if (string-match "%_. " item)
104 (defun menu-item-generate-accelerator-spec (n &optional omit-chars-list)
105 "Return an accelerator specification for use with auto-generated menus.
106 This should be concat'd onto the beginning of each menu line. The spec
107 allows the Nth line to be selected by the number N. '0' is used for the
108 10th line, and 'a' through 'z' are used for the following 26 lines.
110 If OMIT-CHARS-LIST is given, it should be a list of lowercase characters,
111 which will not be used as accelerators."
112 (cond ((< n 10) (concat "%_" (int-to-string n) " "))
119 (while (memq (int-to-char (+ m (- (char-to-int ?a) 1)))
126 (char-to-string (int-to-char (+ m (- (char-to-int ?a) 1))))
131 (defconst default-menubar
136 ["%_Open..." find-file]
137 ["Open in Other %_Window..." find-file-other-window]
138 ["Open in New %_Frame..." find-file-other-frame]
139 ["%_Hex Edit File..." hexl-find-file
140 :active (fboundp 'hexl-find-file)]
141 ["%_Insert File..." insert-file]
142 ["%_View File..." view-file]
144 ["%_Save" save-buffer
145 :active (buffer-modified-p)
146 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
147 ["Save %_As..." write-file]
148 ["Save So%_me Buffers" save-some-buffers]
150 ["%_Print Buffer" generic-print-buffer
151 :active (or (valid-specifier-tag-p 'msprinter)
152 (and (not (eq system-type 'windows-nt))
153 (fboundp 'lpr-buffer)))
154 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
155 ["Prett%_y-Print Buffer" ps-print-buffer-with-faces
156 :active (fboundp 'ps-print-buffer-with-faces)
157 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
159 ["%_Revert Buffer" revert-buffer
160 :active (or buffer-file-name revert-buffer-function)
161 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
162 ["Re%_cover File..." recover-file]
163 ["Recover S%_ession..." recover-session]
165 ["E%_xit XEmacs" save-buffers-kill-emacs]
169 ["%_Undo" advertised-undo
170 :active (and (not (eq buffer-undo-list t))
171 (or buffer-undo-list pending-undo-list))
172 :suffix (if (or (eq last-command 'undo)
173 (eq last-command 'advertised-undo))
176 :included (fboundp 'redo)
177 :active (not (or (eq buffer-undo-list t)
178 (eq last-buffer-undo-list nil)
179 (not (or (eq last-buffer-undo-list buffer-undo-list)
180 (and (null (car-safe buffer-undo-list))
181 (eq last-buffer-undo-list
182 (cdr-safe buffer-undo-list)))))
183 (or (eq buffer-undo-list pending-undo-list)
184 (eq (cdr buffer-undo-list) pending-undo-list))))
185 :suffix (if (eq last-command 'redo) "More" "")]
187 ["Cu%_t" kill-primary-selection
188 :active (selection-owner-p)]
189 ["%_Copy" copy-primary-selection
190 :active (selection-owner-p)]
191 ["%_Paste" yank-clipboard-selection
192 :active (selection-exists-p 'CLIPBOARD)]
193 ["%_Delete" delete-primary-selection
194 :active (selection-owner-p)]
196 ["Select %_All" mark-whole-buffer]
197 ["Select %_Page" mark-page]
199 ["%_Search..." make-search-dialog]
200 ["%_1 Replace..." query-replace]
202 ["%_2 Search (Regexp)..." isearch-forward-regexp]
203 ["%_3 Search Backward (Regexp)..." isearch-backward-regexp]
204 ["%_4 Replace (Regexp)..." query-replace-regexp]
206 ,@(when (featurep 'mule)
208 ("%_Multilingual (\"Mule\")"
209 ("%_Describe Language Support")
210 ("%_Set Language Environment")
212 ["T%_oggle Input Method" toggle-input-method]
213 ["Select %_Input Method" set-input-method]
214 ["D%_escribe Input Method" describe-input-method]
216 ["Describe Current %_Coding Systems"
217 describe-current-coding-system]
218 ["Set Coding System of %_Buffer File..."
219 set-buffer-file-coding-system]
220 ;; not implemented yet
221 ["Set Coding System of %_Terminal..."
222 set-terminal-coding-system :active nil]
223 ;; not implemented yet
224 ["Set Coding System of %_Keyboard..."
225 set-keyboard-coding-system :active nil]
226 ["Set Coding System of %_Process..."
227 set-buffer-process-coding-system
228 :active (get-buffer-process (current-buffer))]
230 ["Show Cha%_racter Table" view-charset-by-menu]
231 ;; not implemented yet
232 ["Show Dia%_gnosis for MULE" mule-diag :active nil]
233 ["Show \"%_hello\" in Many Languages" view-hello-file]))
238 ["%_New Frame" make-frame]
239 ["Frame on Other Displa%_y..." make-frame-on-display]
240 ["%_Delete Frame" delete-frame
241 :active (not (eq (next-frame (selected-frame) 'nomini 'window-system)
244 ["%_Split Window" split-window-vertically]
245 ["S%_plit Window (Side by Side)" split-window-horizontally]
246 ["%_Un-Split (Keep This)" delete-other-windows
247 :active (not (one-window-p t))]
248 ["Un-Split (Keep %_Others)" delete-window
249 :active (not (one-window-p t))]
252 ["%_Narrow to Region" narrow-to-region :active (region-exists-p)]
253 ["Narrow to %_Page" narrow-to-page]
254 ["Narrow to %_Defun" narrow-to-defun]
256 ["%_Widen" widen :active (or (/= (point-min) 1)
257 (/= (point-max) (1+ (buffer-size))))]
260 ["Show Message %_Log" show-message-log]
262 ["%_Goto Line..." goto-line]
263 ["%_What Line" what-line]
265 :filter bookmark-menu-filter)
267 ["%_Jump to Previous Mark" (set-mark-command t)
272 ["Repeat %_Last Complex Command..." repeat-complex-command]
273 ["E%_valuate Lisp Expression..." eval-expression]
274 ["Execute %_Named Command..." execute-extended-command]
276 ["Start %_Macro Recording" start-kbd-macro
277 :included (not defining-kbd-macro)]
278 ["End %_Macro Recording" end-kbd-macro
279 :included defining-kbd-macro]
280 ["E%_xecute Last Macro" call-last-kbd-macro
281 :active last-kbd-macro]
283 ["%_Append to Last Macro" (start-kbd-macro t)
284 :active (and (not defining-kbd-macro) last-kbd-macro)]
285 ["%_Query User During Macro" kbd-macro-query
286 :active defining-kbd-macro]
287 ["Enter %_Recursive Edit During Macro" (kbd-macro-query t)
288 :active defining-kbd-macro]
290 ["E%_xecute Last Macro on Region Lines"
291 :active (and last-kbd-macro (region-exists-p))]
293 ["%_Name Last Macro..." name-last-kbd-macro
294 :active last-kbd-macro]
295 ["Assign Last Macro to %_Key..." assign-last-kbd-macro-to-key
296 :active (and last-kbd-macro
297 (fboundp 'assign-last-kbd-macro-to-key))]
299 ["%_Edit Macro..." edit-kbd-macro]
300 ["Edit %_Last Macro" edit-last-kbd-macro
301 :active last-kbd-macro]
303 ["%_Insert Named Macro into Buffer..." insert-kbd-macro]
304 ["Read Macro from Re%_gion" read-kbd-macro
305 :active (region-exists-p)]
309 ["D%_ynamic Abbrev Expand" dabbrev-expand]
310 ["Dynamic Abbrev %_Complete" dabbrev-completion]
311 ["Dynamic Abbrev Complete in %_All Buffers" (dabbrev-completion 16)]
314 ["%_Define Global Abbrev for " add-global-abbrev
315 :suffix (abbrev-string-to-be-defined nil)
317 ["Define %_Mode-Specific Abbrev for " add-mode-abbrev
318 :suffix (abbrev-string-to-be-defined nil)
320 ["Define Global Ex%_pansion for " inverse-add-global-abbrev
321 :suffix (inverse-abbrev-string-to-be-defined 1)
323 ["Define Mode-Specific Expa%_nsion for " inverse-add-mode-abbrev
324 :suffix (inverse-abbrev-string-to-be-defined 1)
327 ["E%_xpand Abbrev" expand-abbrev]
328 ["Expand Abbrevs in Re%_gion" expand-region-abbrevs
329 :active (region-exists-p)]
330 ["%_Unexpand Last Abbrev" unexpand-abbrev
331 :active (and (stringp last-abbrev-text)
332 (> last-abbrev-location 0))]
334 ["%_Kill All Abbrevs" kill-all-abbrevs]
335 ["%_Insert All Abbrevs into Buffer" insert-abbrevs]
336 ["%_List Abbrevs" list-abbrevs]
338 ["%_Edit Abbrevs" edit-abbrevs]
339 ["%_Redefine Abbrevs from Buffer" edit-abbrevs-redefine
340 :active (eq major-mode 'edit-abbrevs-mode)]
342 ["%_Save Abbrevs As..." write-abbrev-file]
343 ["L%_oad Abbrevs..." read-abbrev-file]
346 ["%_Copy to Register..." copy-to-register :active (region-exists-p)]
347 ["%_Paste Register..." insert-register]
349 ["%_Save Point to Register" point-to-register]
350 ["%_Jump to Register" register-to-point]
353 ["%_Kill Rectangle" kill-rectangle]
354 ["%_Yank Rectangle" yank-rectangle]
355 ["Rectangle %_to Register" copy-rectangle-to-register]
356 ["Rectangle %_from Register" insert-register]
357 ["%_Clear Rectangle" clear-rectangle]
358 ["%_Open Rectangle" open-rectangle]
359 ["%_Prefix Rectangle..." string-rectangle]
360 ["Rectangle %_Mousing"
361 (customize-set-variable 'mouse-track-rectangle-p
362 (not mouse-track-rectangle-p))
363 :style toggle :selected mouse-track-rectangle-p]
366 ["%_Lines" sort-lines :active (region-exists-p)]
367 ["%_Paragraphs" sort-paragraphs :active (region-exists-p)]
368 ["P%_ages" sort-pages :active (region-exists-p)]
369 ["%_Columns" sort-columns :active (region-exists-p)]
370 ["%_Regexp..." sort-regexp-fields :active (region-exists-p)]
373 ["%_Line" center-line]
374 ["%_Paragraph" center-paragraph]
375 ["%_Region" center-region :active (region-exists-p)]
378 ["%_As Previous Line" indent-relative]
379 ["%_To Column..." indent-to-column]
381 ["%_Region" indent-region :active (region-exists-p)]
382 ["%_Balanced Expression" indent-sexp]
383 ["%_C Expression" indent-c-exp]
386 ["%_Buffer" ispell-buffer
387 :active (fboundp 'ispell-buffer)]
389 ["%_Word" ispell-word]
390 ["%_Complete Word" ispell-complete-word]
391 ["%_Region" ispell-region]
397 ["Read Mail %_1 (VM)..." vm
398 :active (fboundp 'vm)]
399 ["Read Mail %_2 (MH)..." (mh-rmail t)
400 :active (fboundp 'mh-rmail)]
401 ["Send %_Mail..." compose-mail
402 :active (fboundp 'compose-mail)]
403 ["Usenet %_News" gnus
404 :active (fboundp 'gnus)]
405 ["Browse the %_Web" w3
406 :active (fboundp 'w3)])
411 (if (or (not (boundp 'grep-history)) (null grep-history))
414 (submenu-generate-accelerator-spec
415 (mapcar #'(lambda (string)
417 (list 'grep string)))
418 (menu-truncate-list grep-history 10)))))
419 (append menu '("---") items))))
420 ["%_Grep..." grep :active (fboundp 'grep)]
421 ["%_Kill Grep" kill-compilation
422 :active (and (fboundp 'kill-compilation)
423 (fboundp 'compilation-find-buffer)
424 (let ((buffer (condition-case nil
425 (compilation-find-buffer)
427 (and buffer (get-buffer-process buffer))))]
429 ["Grep %_All Files in Current Directory..."
433 (cons (concat grep-command " *")
434 (length grep-command))))
435 (call-interactively 'grep)))
436 :active (fboundp 'grep)]
437 ["Grep %_C and C Header Files in Current Directory..."
441 (cons (concat grep-command " *.[chCH]"
442 ; i wanted to also use *.cc and *.hh.
443 ; see long comment below under Perl.
445 (length grep-command))))
446 (call-interactively 'grep)))
447 :active (fboundp 'grep)]
448 ["Grep C Hea%_der Files in Current Directory..."
452 (cons (concat grep-command " *.[hH]"
453 ; i wanted to also use *.hh.
454 ; see long comment below under Perl.
456 (length grep-command))))
457 (call-interactively 'grep)))
458 :active (fboundp 'grep)]
459 ["Grep %_E-Lisp Files in Current Directory..."
463 (cons (concat grep-command " *.el")
464 (length grep-command))))
465 (call-interactively 'grep)))
466 :active (fboundp 'grep)]
467 ["Grep %_Perl Files in Current Directory..."
471 (cons (concat grep-command " *.pl"
472 ; i wanted to use this:
474 ; but grep complains if it can't
475 ; match anything in a glob, and
476 ; that screws other things up.
477 ; perhaps we need to first scan
478 ; each separate glob in the directory
479 ; to see if there are any files in
480 ; that glob, and if not, omit it.
482 (length grep-command))))
483 (call-interactively 'grep)))
484 :active (fboundp 'grep)]
485 ["Grep %_HTML Files in Current Directory..."
489 (cons (concat grep-command " *.*htm*")
490 (length grep-command))))
491 (call-interactively 'grep)))
492 :active (fboundp 'grep)]
494 ["%_Next Match" next-error
495 :active (and (fboundp 'compilation-errors-exist-p)
496 (compilation-errors-exist-p))]
497 ["Pre%_vious Match" previous-error
498 :active (and (fboundp 'compilation-errors-exist-p)
499 (compilation-errors-exist-p))]
500 ["%_First Match" first-error
501 :active (and (fboundp 'compilation-errors-exist-p)
502 (compilation-errors-exist-p))]
503 ["G%_oto Match" compile-goto-error
504 :active (and (fboundp 'compilation-errors-exist-p)
505 (compilation-errors-exist-p))]
507 ["%_Set Grep Command..."
510 (customize-set-variable
512 (read-shell-command "Default Grep Command: " grep-command)))
513 :active (fboundp 'grep)
519 (if (or (not (boundp 'compile-history)) (null compile-history))
522 (submenu-generate-accelerator-spec
523 (mapcar #'(lambda (string)
525 (list 'compile string)))
526 (menu-truncate-list compile-history 10)))))
527 (append menu '("---") items))))
528 ["%_Compile..." compile :active (fboundp 'compile)]
529 ["%_Repeat Compilation" recompile :active (fboundp 'recompile)]
530 ["%_Kill Compilation" kill-compilation
531 :active (and (fboundp 'kill-compilation)
532 (fboundp 'compilation-find-buffer)
533 (let ((buffer (condition-case nil
534 (compilation-find-buffer)
536 (and buffer (get-buffer-process buffer))))]
538 ["%_Next Error" next-error
539 :active (and (fboundp 'compilation-errors-exist-p)
540 (compilation-errors-exist-p))]
541 ["Pre%_vious Error" previous-error
542 :active (and (fboundp 'compilation-errors-exist-p)
543 (compilation-errors-exist-p))]
544 ["%_First Error" first-error
545 :active (and (fboundp 'compilation-errors-exist-p)
546 (compilation-errors-exist-p))]
547 ["G%_oto Error" compile-goto-error
548 :active (and (fboundp 'compilation-errors-exist-p)
549 (compilation-errors-exist-p))]
553 :active (fboundp 'gdb)]
555 :active (fboundp 'dbx)])
558 :active (fboundp 'shell)]
559 ["S%_hell Command..." shell-command
560 :active (fboundp 'shell-command)]
561 ["Shell Command on %_Region..." shell-command-on-region
562 :active (and (fboundp 'shell-command-on-region) (region-exists-p))])
565 ["%_Find Tag..." find-tag]
566 ["Find %_Other Window..." find-tag-other-window]
567 ["%_Next Tag..." (find-tag nil)]
568 ["N%_ext Other Window..." (find-tag-other-window nil)]
569 ["Next %_File" next-file]
571 ["Tags %_Search..." tags-search]
572 ["Tags %_Replace..." tags-query-replace]
573 ["%_Continue Search/Replace" tags-loop-continue]
575 ["%_Pop stack" pop-tag-mark]
576 ["%_Apropos..." tags-apropos]
578 ["%_Set Tags Table File..." visit-tags-table]
584 ["%_3-Month Calendar" calendar
585 :active (fboundp 'calendar)]
587 :active (fboundp 'diary)]
588 ["%_Holidays" holidays
589 :active (fboundp 'holidays)]
590 ;; we're all pagans at heart ...
591 ["%_Phases of the Moon" phases-of-moon
592 :active (fboundp 'phases-of-moon)]
593 ["%_Sunrise/Sunset" sunrise-sunset
594 :active (fboundp 'sunrise-sunset)])
598 :active (fboundp 'xmine)]
600 :active (fboundp 'tetris)]
602 :active (fboundp 'sokoban)]
603 ["Quote from %_Zippy" yow
604 :active (fboundp 'yow)]
605 ["%_Psychoanalyst" doctor
606 :active (fboundp 'doctor)]
607 ["Ps%_ychoanalyze Zippy!" psychoanalyze-pinhead
608 :active (fboundp 'psychoanalyze-pinhead)]
609 ["%_Random Flames" flame
610 :active (fboundp 'flame)]
611 ["%_Dunnet (Adventure)" dunnet
612 :active (fboundp 'dunnet)]
613 ["Towers of %_Hanoi" hanoi
614 :active (fboundp 'hanoi)]
615 ["Game of %_Life" life
616 :active (fboundp 'life)]
617 ["M%_ultiplication Puzzle" mpuz
618 :active (fboundp 'mpuz)])
624 ("%_Advanced (Customize)"
625 ("%_Emacs" :filter (lambda (&rest junk)
626 (cdr (custom-menu-create 'emacs))))
627 ["%_Group..." customize-group]
628 ["%_Variable..." customize-variable]
629 ["%_Face..." customize-face]
630 ["%_Saved..." customize-saved]
631 ["Se%_t..." customize-customized]
632 ["%_Apropos..." customize-apropos]
633 ["%_Browse..." customize-browse])
635 ("%_Add Download Site"
636 :filter (lambda (&rest junk)
637 (submenu-generate-accelerator-spec
638 (package-get-download-menu))))
639 ["%_Update Package Index" package-get-update-base]
640 ["%_List and Install" pui-list-packages]
641 ["U%_pdate Installed Packages" package-get-update-all]
642 ;; hack-o-matic, we can't force a load of package-base here
643 ;; since it triggers dialog box interactions which we can't
644 ;; deal with while using a menu
646 :filter (lambda (&rest junk)
648 (submenu-generate-accelerator-spec
649 (cdr (custom-menu-create 'packages)))
650 '(["Please load Package Index"
651 (lamda (&rest junk) ()) nil]))))
653 ["%_Help" (Info-goto-node "(xemacs)Packages")])
655 ("%_Keyboard and Mouse"
657 (customize-set-variable 'abbrev-mode
658 (not (default-value 'abbrev-mode)))
660 :selected (default-value 'abbrev-mode)]
661 ["%_Delete Key Deletes Selection"
662 (customize-set-variable 'pending-delete-mode (not pending-delete-mode))
664 :selected (and (boundp 'pending-delete-mode) pending-delete-mode)
665 :active (boundp 'pending-delete-mode)]
666 ["%_Yank/Kill Interact With Clipboard"
667 (if (eq interprogram-cut-function 'own-clipboard)
669 (customize-set-variable 'interprogram-cut-function nil)
670 (customize-set-variable 'interprogram-paste-function nil))
671 (customize-set-variable 'interprogram-cut-function 'own-clipboard)
672 (customize-set-variable 'interprogram-paste-function 'get-clipboard))
674 :selected (eq interprogram-cut-function 'own-clipboard)]
677 (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual))
678 (customize-set-variable 'overwrite-mode overwrite-mode))
679 :style toggle :selected overwrite-mode]
680 ("`%_kill-line' Behavior..."
682 (customize-set-variable 'kill-whole-line 'always)
683 :style radio :selected (eq kill-whole-line 'always)]
684 ["Kill to %_End of Line"
685 (customize-set-variable 'kill-whole-line nil)
686 :style radio :selected (eq kill-whole-line nil)]
687 ["Kill Whole Line at %_Beg, Otherwise to End"
688 (customize-set-variable 'kill-whole-line t)
689 :style radio :selected (eq kill-whole-line t)])
690 ["Size for %_Block-Movement Commands..."
691 (customize-set-variable 'block-movement-size
692 (read-number "Block Movement Size: "
693 t block-movement-size))]
697 (customize-set-variable 'viper-mode viper-mode))
698 :style toggle :selected (and (boundp 'viper-mode) viper-mode)
699 :active (fboundp 'toggle-viper-mode)]
701 (customize-set-variable 'zmacs-regions (not zmacs-regions))
702 :style toggle :selected zmacs-regions]
704 ["%_Set Key..." global-set-key]
705 ["%_Unset Key..." global-unset-key]
707 ["%_Case Sensitive Search"
708 (customize-set-variable 'case-fold-search
709 (setq case-fold-search (not case-fold-search)))
710 :style toggle :selected (not case-fold-search)]
711 ["Case Matching %_Replace"
712 (customize-set-variable 'case-replace (not case-replace))
713 :style toggle :selected case-replace]
715 ("%_Newline at End of File..."
717 (customize-set-variable 'require-final-newline nil)
718 :style radio :selected (not require-final-newline)]
720 (customize-set-variable 'require-final-newline t)
721 :style radio :selected (eq require-final-newline t)]
723 (customize-set-variable 'require-final-newline 'ask)
724 :style radio :selected (and require-final-newline
725 (not (eq require-final-newline t)))])
726 ["Add Newline When Moving Past %_End"
727 (customize-set-variable 'next-line-add-newlines
728 (not next-line-add-newlines))
729 :style toggle :selected next-line-add-newlines]
731 ["%_Mouse Paste at Text Cursor"
732 (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point))
733 :style toggle :selected mouse-yank-at-point]
735 (customize-set-variable 'mouse-avoidance-mode
736 (if mouse-avoidance-mode nil 'banish))
738 :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode)
739 :active (and (boundp 'mouse-avoidance-mode)
740 (device-on-window-system-p))]
742 (customize-set-variable 'strokes-mode (not strokes-mode))
744 :selected (and (boundp 'strokes-mode) strokes-mode)
745 :active (and (boundp 'strokes-mode)
746 (device-on-window-system-p))]
749 ["This Buffer %_Read Only" (toggle-read-only)
750 :style toggle :selected buffer-read-only]
751 ["%_Teach Extended Commands"
752 (customize-set-variable 'teach-extended-commands-p
753 (not teach-extended-commands-p))
754 :style toggle :selected teach-extended-commands-p]
756 (customize-set-variable 'debug-on-error (not debug-on-error))
757 :style toggle :selected debug-on-error]
759 (customize-set-variable 'debug-on-quit (not debug-on-quit))
760 :style toggle :selected debug-on-quit]
762 (customize-set-variable 'debug-on-signal (not debug-on-signal))
763 :style toggle :selected debug-on-signal]
767 ["Set Printer %_Name for Generic Print Support..."
768 (customize-set-variable
770 (read-string "Set printer name: " printer-name))]
772 ["Command-Line %_Switches for `lpr'/`lp'..."
773 ;; better to directly open a customization buffer, since the value
774 ;; must be a list of strings, which is somewhat complex to prompt for.
775 (customize-variable 'lpr-switches)
776 (boundp 'lpr-switches)]
777 ("%_Pretty-Print Paper Size"
779 (customize-set-variable 'ps-paper-type 'letter)
781 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter))
782 :active (boundp 'ps-paper-type)]
784 (customize-set-variable 'ps-paper-type 'letter-small)
786 :selected (and (boundp 'ps-paper-type)
787 (eq ps-paper-type 'letter-small))
788 :active (boundp 'ps-paper-type)]
790 (customize-set-variable 'ps-paper-type 'legal)
792 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'legal))
793 :active (boundp 'ps-paper-type)]
795 (customize-set-variable 'ps-paper-type 'statement)
797 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'statement))
798 :active (boundp 'ps-paper-type)]
800 (customize-set-variable 'ps-paper-type 'executive)
802 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'executive))
803 :active (boundp 'ps-paper-type)]
805 (customize-set-variable 'ps-paper-type 'tabloid)
807 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'tabloid))
808 :active (boundp 'ps-paper-type)]
810 (customize-set-variable 'ps-paper-type 'ledger)
812 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'ledger))
813 :active (boundp 'ps-paper-type)]
815 (customize-set-variable 'ps-paper-type 'a3)
817 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a3))
818 :active (boundp 'ps-paper-type)]
820 (customize-set-variable 'ps-paper-type 'a4)
822 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4))
823 :active (boundp 'ps-paper-type)]
825 (customize-set-variable 'ps-paper-type 'a4small)
827 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4small))
828 :active (boundp 'ps-paper-type)]
830 (customize-set-variable 'ps-paper-type 'b4)
832 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b4))
833 :active (boundp 'ps-paper-type)]
835 (customize-set-variable 'ps-paper-type 'b5)
837 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b5))
838 :active (boundp 'ps-paper-type)]
841 (cond (ps-print-color-p
842 (customize-set-variable 'ps-print-color-p nil)
843 ;; I'm wondering whether all this muck is useful.
844 (and (boundp 'original-face-background)
845 original-face-background
846 (set-face-background 'default original-face-background)))
848 (customize-set-variable 'ps-print-color-p t)
849 (setq original-face-background
850 (face-background-instance 'default))
851 (set-face-background 'default "white")))
853 :selected (and (boundp 'ps-print-color-p) ps-print-color-p)
854 :active (boundp 'ps-print-color-p)])
856 ("%_Compose Mail With"
857 ["Default Emacs Mailer"
858 (customize-set-variable 'mail-user-agent 'sendmail-user-agent)
860 :selected (eq mail-user-agent 'sendmail-user-agent)]
862 (customize-set-variable 'mail-user-agent 'mh-e-user-agent)
864 :selected (eq mail-user-agent 'mh-e-user-agent)
865 :active (get 'mh-e-user-agent 'composefunc)]
867 (customize-set-variable 'mail-user-agent 'message-user-agent)
869 :selected (eq mail-user-agent 'message-user-agent)
870 :active (get 'message-user-agent 'composefunc)]
872 ["Set My %_Email Address..."
873 (customize-set-variable
875 (read-string "Set email address: " user-mail-address))]
876 ["Set %_Machine Email Name..."
877 (customize-set-variable
879 (read-string "Set machine email name: " mail-host-address))]
880 ["Set %_SMTP Server..."
883 (customize-set-variable
884 'smtpmail-smtp-server
885 (read-string "Set SMTP server: " smtpmail-smtp-server)))
886 :active (and (boundp 'send-mail-function)
887 (eq send-mail-function 'smtpmail-send-it))]
891 (customize-set-variable 'smtpmail-debug-info
892 (not smtpmail-debug-info)))
894 :selected (and (boundp 'smtpmail-debug-info) smtpmail-debug-info)
895 :active (and (boundp 'send-mail-function)
896 (eq send-mail-function 'smtpmail-send-it))]
900 (customize-set-variable 'browse-url-browser-function 'browse-url-w3)
902 :selected (and (boundp 'browse-url-browser-function)
903 (eq browse-url-browser-function 'browse-url-w3))
904 :active (and (boundp 'browse-url-browser-function)
905 (fboundp 'browse-url-w3)
906 (fboundp 'w3-fetch))]
908 (customize-set-variable 'browse-url-browser-function
909 'browse-url-netscape)
911 :selected (and (boundp 'browse-url-browser-function)
912 (eq browse-url-browser-function 'browse-url-netscape))
913 :active (and (boundp 'browse-url-browser-function)
914 (fboundp 'browse-url-netscape))]
916 (customize-set-variable 'browse-url-browser-function
919 :selected (and (boundp 'browse-url-browser-function)
920 (eq browse-url-browser-function 'browse-url-mosaic))
921 :active (and (boundp 'browse-url-browser-function)
922 (fboundp 'browse-url-mosaic))]
924 (customize-set-variable 'browse-url-browser-function 'browse-url-cci)
926 :selected (and (boundp 'browse-url-browser-function)
927 (eq browse-url-browser-function 'browse-url-cci))
928 :active (and (boundp 'browse-url-browser-function)
929 (fboundp 'browse-url-cci))]
931 (customize-set-variable 'browse-url-browser-function
932 'browse-url-iximosaic)
934 :selected (and (boundp 'browse-url-browser-function)
935 (eq browse-url-browser-function 'browse-url-iximosaic))
936 :active (and (boundp 'browse-url-browser-function)
937 (fboundp 'browse-url-iximosaic))]
939 (customize-set-variable 'browse-url-browser-function
940 'browse-url-lynx-xterm)
942 :selected (and (boundp 'browse-url-browser-function)
943 (eq browse-url-browser-function 'browse-url-lynx-xterm))
944 :active (and (boundp 'browse-url-browser-function)
945 (fboundp 'browse-url-lynx-xterm))]
947 (customize-set-variable 'browse-url-browser-function
948 'browse-url-lynx-emacs)
950 :selected (and (boundp 'browse-url-browser-function)
951 (eq browse-url-browser-function 'browse-url-lynx-emacs))
952 :active (and (boundp 'browse-url-browser-function)
953 (fboundp 'browse-url-lynx-emacs))]
955 (customize-set-variable 'browse-url-browser-function
958 :selected (and (boundp 'browse-url-browser-function)
959 (eq browse-url-browser-function 'browse-url-grail))
960 :active (and (boundp 'browse-url-browser-function)
961 (fboundp 'browse-url-grail))]
963 (customize-set-variable 'browse-url-browser-function
966 :selected (and (boundp 'browse-url-browser-function)
967 (eq browse-url-browser-function 'browse-url-kfm))
968 :active (and (boundp 'browse-url-browser-function)
969 (fboundp 'browse-url-kfm))]
975 ,@(if (featurep 'scrollbar)
977 (customize-set-variable 'scrollbars-visible-p
978 (not scrollbars-visible-p))
980 :selected scrollbars-visible-p]))
981 ;; I don't think this is of any interest. - dverna apr. 98
982 ;; #### I beg to differ! Many FSFmacs converts hate the 3D
983 ;; modeline, and it was perfectly fine to be able to turn them
984 ;; off through the Options menu. I would have uncommented this
985 ;; source, but the code for saving options would not save the
986 ;; modeline 3D-ness. Grrr. --hniksic
989 ;; (if (zerop (specifier-instance modeline-shadow-thickness))
990 ;; (set-specifier modeline-shadow-thickness 2)
991 ;; (set-specifier modeline-shadow-thickness 0))
992 ;; (redraw-modeline t))
994 ;; :selected (let ((thickness
995 ;; (specifier-instance modeline-shadow-thickness)))
996 ;; (and (integerp thickness)
997 ;; (> thickness 0)))]
999 (progn;; becomes buffer-local
1000 (setq truncate-lines (not truncate-lines))
1001 (customize-set-variable 'truncate-lines truncate-lines))
1003 :selected truncate-lines]
1004 ["%_Blinking Cursor"
1005 (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode))
1007 :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)
1008 :active (boundp 'blink-cursor-mode)]
1012 (customize-set-variable 'bar-cursor nil)
1013 (force-cursor-redisplay))
1015 :selected (null bar-cursor)]
1016 ["Bar Cursor (%_1 Pixel)"
1018 (customize-set-variable 'bar-cursor t)
1019 (force-cursor-redisplay))
1021 :selected (eq bar-cursor t)]
1022 ["Bar Cursor (%_2 Pixels)"
1024 (customize-set-variable 'bar-cursor 2)
1025 (force-cursor-redisplay))
1027 :selected (and bar-cursor (not (eq bar-cursor t)))]
1031 (customize-set-variable 'line-number-mode (not line-number-mode))
1033 :style toggle :selected line-number-mode]
1036 (customize-set-variable 'column-number-mode
1037 (not column-number-mode))
1039 :style toggle :selected column-number-mode]
1041 ("\"Other %_Window\" Location"
1042 ["%_Always in Same Frame"
1043 (customize-set-variable
1044 'get-frame-for-buffer-default-instance-limit nil)
1046 :selected (null get-frame-for-buffer-default-instance-limit)]
1047 ["Other Frame (%_2 Frames Max)"
1048 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 2)
1050 :selected (eq 2 get-frame-for-buffer-default-instance-limit)]
1051 ["Other Frame (%_3 Frames Max)"
1052 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 3)
1054 :selected (eq 3 get-frame-for-buffer-default-instance-limit)]
1055 ["Other Frame (%_4 Frames Max)"
1056 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 4)
1058 :selected (eq 4 get-frame-for-buffer-default-instance-limit)]
1059 ["Other Frame (%_5 Frames Max)"
1060 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 5)
1062 :selected (eq 5 get-frame-for-buffer-default-instance-limit)]
1063 ["Always Create %_New Frame"
1064 (customize-set-variable 'get-frame-for-buffer-default-instance-limit 0)
1066 :selected (eq 0 get-frame-for-buffer-default-instance-limit)]
1068 ["%_Temp Buffers Always in Same Frame"
1069 (customize-set-variable 'temp-buffer-show-function
1070 'show-temp-buffer-in-current-frame)
1072 :selected (eq temp-buffer-show-function
1073 'show-temp-buffer-in-current-frame)]
1074 ["Temp Buffers %_Like Other Buffers"
1075 (customize-set-variable 'temp-buffer-show-function nil)
1077 :selected (null temp-buffer-show-function)]
1079 ["%_Make Current Frame Gnuserv Target"
1080 (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil t))
1082 :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t))
1083 :active (boundp 'gnuserv-frame)]
1087 ["%_Frame-Local Font Menu"
1088 (customize-set-variable 'font-menu-this-frame-only-p
1089 (not font-menu-this-frame-only-p))
1091 :selected (and (boundp 'font-menu-this-frame-only-p)
1092 font-menu-this-frame-only-p)]
1093 ["%_Alt/Meta Selects Menu Items"
1094 (if (eq menu-accelerator-enabled 'menu-force)
1095 (customize-set-variable 'menu-accelerator-enabled nil)
1096 (customize-set-variable 'menu-accelerator-enabled 'menu-force))
1098 :selected (eq menu-accelerator-enabled 'menu-force)]
1100 ["Buffers Menu %_Length..."
1101 (customize-set-variable
1102 'buffers-menu-max-size
1103 ;; would it be better to open a customization buffer ?
1106 "Enter number of buffers to display (or 0 for unlimited): ")))
1107 (if (eq val 0) nil val)))]
1108 ["%_Multi-Operation Buffers Sub-Menus"
1109 (customize-set-variable 'complex-buffers-menu-p
1110 (not complex-buffers-menu-p))
1112 :selected complex-buffers-menu-p]
1113 ["S%_ubmenus for Buffer Groups"
1114 (customize-set-variable 'buffers-menu-submenus-for-groups-p
1115 (not buffers-menu-submenus-for-groups-p))
1117 :selected buffers-menu-submenus-for-groups-p]
1118 ["%_Verbose Buffer Menu Entries"
1119 (if (eq buffers-menu-format-buffer-line-function
1120 'slow-format-buffers-menu-line)
1121 (customize-set-variable 'buffers-menu-format-buffer-line-function
1122 'format-buffers-menu-line)
1123 (customize-set-variable 'buffers-menu-format-buffer-line-function
1124 'slow-format-buffers-menu-line))
1126 :selected (eq buffers-menu-format-buffer-line-function
1127 'slow-format-buffers-menu-line)]
1128 ("Buffers Menu %_Sorting"
1129 ["%_Most Recently Used"
1131 (customize-set-variable 'buffers-menu-sort-function nil)
1132 (customize-set-variable 'buffers-menu-grouping-function nil))
1134 :selected (null buffers-menu-sort-function)]
1137 (customize-set-variable 'buffers-menu-sort-function
1138 'sort-buffers-menu-alphabetically)
1139 (customize-set-variable 'buffers-menu-grouping-function nil))
1141 :selected (eq 'sort-buffers-menu-alphabetically
1142 buffers-menu-sort-function)]
1143 ["%_By Major Mode, Then Alphabetically"
1145 (customize-set-variable
1146 'buffers-menu-sort-function
1147 'sort-buffers-menu-by-mode-then-alphabetically)
1148 (customize-set-variable
1149 'buffers-menu-grouping-function
1150 'group-buffers-menu-by-mode-then-alphabetically))
1152 :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically
1153 buffers-menu-sort-function)])
1155 ["%_Ignore Scaled Fonts"
1156 (customize-set-variable 'font-menu-ignore-scaled-fonts
1157 (not font-menu-ignore-scaled-fonts))
1159 :selected (and (boundp 'font-menu-ignore-scaled-fonts)
1160 font-menu-ignore-scaled-fonts)]
1162 ,@(if (featurep 'toolbar)
1165 (customize-set-variable 'toolbar-visible-p
1166 (not toolbar-visible-p))
1168 :selected toolbar-visible-p]
1170 (customize-set-variable 'toolbar-captioned-p
1171 (not toolbar-captioned-p))
1173 :selected toolbar-captioned-p]
1174 ("%_Default Location"
1176 (customize-set-variable 'default-toolbar-position 'top)
1178 :selected (eq default-toolbar-position 'top)]
1180 (customize-set-variable 'default-toolbar-position 'bottom)
1182 :selected (eq default-toolbar-position 'bottom)]
1184 (customize-set-variable 'default-toolbar-position 'left)
1186 :selected (eq default-toolbar-position 'left)]
1188 (customize-set-variable 'default-toolbar-position 'right)
1190 :selected (eq default-toolbar-position 'right)]
1193 ,@(if (featurep 'gutter)
1195 ["Buffers Tab %_Visible"
1196 (customize-set-variable 'gutter-buffers-tab-visible-p
1197 (not gutter-buffers-tab-visible-p))
1199 :selected gutter-buffers-tab-visible-p]
1200 ("%_Default Location"
1202 (customize-set-variable 'default-gutter-position 'top)
1204 :selected (eq default-gutter-position 'top)]
1206 (customize-set-variable 'default-gutter-position 'bottom)
1208 :selected (eq default-gutter-position 'bottom)]
1210 (customize-set-variable 'default-gutter-position 'left)
1212 :selected (eq default-gutter-position 'left)]
1214 (customize-set-variable 'default-gutter-position 'right)
1216 :selected (eq default-gutter-position 'right)]
1220 ("S%_yntax Highlighting"
1222 (progn;; becomes buffer local
1224 (customize-set-variable 'font-lock-mode font-lock-mode))
1226 :selected (and (boundp 'font-lock-mode) font-lock-mode)
1227 :active (boundp 'font-lock-mode)]
1229 (customize-set-variable 'font-lock-auto-fontify
1230 (not font-lock-auto-fontify))
1232 :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify)
1233 :active (fboundp 'font-lock-mode)]
1237 (require 'font-lock)
1238 (font-lock-use-default-fonts)
1239 (customize-set-variable 'font-lock-use-fonts t)
1240 (customize-set-variable 'font-lock-use-colors nil)
1243 :selected (and (boundp 'font-lock-use-fonts) font-lock-use-fonts)
1244 :active (fboundp 'font-lock-mode)]
1247 (require 'font-lock)
1248 (font-lock-use-default-colors)
1249 (customize-set-variable 'font-lock-use-colors t)
1250 (customize-set-variable 'font-lock-use-fonts nil)
1253 :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors)
1254 :active (boundp 'font-lock-mode)]
1258 (require 'font-lock)
1259 (if (or (and (not (integerp font-lock-maximum-decoration))
1260 (not (eq t font-lock-maximum-decoration)))
1261 (and (integerp font-lock-maximum-decoration)
1262 (<= font-lock-maximum-decoration 0)))
1264 (customize-set-variable 'font-lock-maximum-decoration nil)
1265 (font-lock-recompute-variables)))
1267 :active (fboundp 'font-lock-mode)
1268 :selected (and (boundp 'font-lock-maximium-decoration)
1269 (or (and (not (integerp font-lock-maximum-decoration))
1270 (not (eq t font-lock-maximum-decoration)))
1271 (and (integerp font-lock-maximum-decoration)
1272 (<= font-lock-maximum-decoration 0))))]
1275 (require 'font-lock)
1276 (if (and (integerp font-lock-maximum-decoration)
1277 (= 1 font-lock-maximum-decoration))
1279 (customize-set-variable 'font-lock-maximum-decoration 1)
1280 (font-lock-recompute-variables)))
1282 :active (fboundp 'font-lock-mode)
1283 :selected (and (boundp 'font-lock-maximium-decoration)
1284 (integerp font-lock-maximum-decoration)
1285 (= 1 font-lock-maximum-decoration))]
1288 (require 'font-lock)
1289 (if (and (integerp font-lock-maximum-decoration)
1290 (= 2 font-lock-maximum-decoration))
1292 (customize-set-variable 'font-lock-maximum-decoration 2)
1293 (font-lock-recompute-variables)))
1295 :active (fboundp 'font-lock-mode)
1296 :selected (and (boundp 'font-lock-maximum-decoration)
1297 (integerp font-lock-maximum-decoration)
1298 (= 2 font-lock-maximum-decoration))]
1301 (require 'font-lock)
1302 (if (or (eq font-lock-maximum-decoration t)
1303 (and (integerp font-lock-maximum-decoration)
1304 (>= font-lock-maximum-decoration 3)))
1306 (customize-set-variable 'font-lock-maximum-decoration t)
1307 (font-lock-recompute-variables)))
1309 :active (fboundp 'font-lock-mode)
1310 :selected (and (boundp 'font-lock-maximum-decoration)
1311 (or (eq font-lock-maximum-decoration t)
1312 (and (integerp font-lock-maximum-decoration)
1313 (>= font-lock-maximum-decoration 3))))]
1316 (progn;; becomes buffer local
1318 (customize-set-variable 'lazy-shot-mode lazy-shot-mode)
1319 ;; this shouldn't be necessary so there has to
1320 ;; be a redisplay bug lurking somewhere (or
1321 ;; possibly another event handler bug)
1323 :active (and (boundp 'font-lock-mode) (boundp 'lazy-shot-mode)
1326 :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)]
1328 (progn;; becomes buffer local
1330 (customize-set-variable 'fast-lock-mode fast-lock-mode)
1331 ;; this shouldn't be necessary so there has to
1332 ;; be a redisplay bug lurking somewhere (or
1333 ;; possibly another event handler bug)
1335 :active (and (boundp 'font-lock-mode) (boundp 'fast-lock-mode)
1338 :selected (and (boundp 'fast-lock-mode) fast-lock-mode)]
1340 ("Pa%_ren Highlighting"
1342 (customize-set-variable 'paren-mode nil)
1344 :selected (and (boundp 'paren-mode) (not paren-mode))
1345 :active (boundp 'paren-mode)]
1347 (customize-set-variable 'paren-mode 'blink-paren)
1349 :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren))
1350 :active (boundp 'paren-mode)]
1352 (customize-set-variable 'paren-mode 'paren)
1354 :selected (and (boundp 'paren-mode) (eq paren-mode 'paren))
1355 :active (boundp 'paren-mode)]
1357 (customize-set-variable 'paren-mode 'sexp)
1359 :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp))
1360 :active (boundp 'paren-mode)]
1361 ;; ["Nes%_ted Shading"
1362 ;; (customize-set-variable 'paren-mode 'nested)
1364 ;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested))
1365 ;; :active (boundp 'paren-mode)]
1368 ["Edit Fa%_ces..." (customize-face nil)]
1369 ("Fo%_nt" :filter font-menu-family-constructor)
1370 ("Si%_ze" :filter font-menu-size-constructor)
1371 ;; ("Weig%_ht" :filter font-menu-weight-constructor)
1373 ["%_Edit Init (.emacs) File"
1374 ;; #### there should be something that holds the name that the init
1375 ;; file should be created as, when it's not present.
1376 (progn (find-file (or user-init-file "~/.emacs"))
1378 ["%_Save Options to .emacs File" customize-save-customized]
1382 :filter buffers-menu-filter
1383 ["Go To %_Previous Buffer" switch-to-other-buffer]
1384 ["Go To %_Buffer..." switch-to-buffer]
1386 ["%_List All Buffers" list-buffers]
1387 ["%_Delete Buffer" kill-this-buffer
1388 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
1392 nil ; the partition: menus after this are flushright
1395 ["%_About XEmacs..." about-xemacs]
1397 ["XEmacs %_News" view-emacs-news]
1398 ["%_Obtaining XEmacs" describe-distribution]
1400 ("%_Info (Online Docs)"
1401 ["%_Info Contents" info]
1402 ["Lookup %_Key Binding..." Info-goto-emacs-key-command-node]
1403 ["Lookup %_Command..." Info-goto-emacs-command-node]
1404 ["Lookup %_Function..." Info-elisp-ref]
1405 ["Lookup %_Topic..." Info-query])
1407 ["%_FAQ (local)" xemacs-local-faq]
1408 ["FAQ via %_WWW" xemacs-www-faq
1409 :active (boundp 'browse-url-browser-function)]
1410 ["%_Home Page" xemacs-www-page
1411 :active (boundp 'browse-url-browser-function)])
1413 :filter tutorials-menu-filter)
1416 (find-file (locate-data-file "sample.emacs"))
1417 :active (locate-data-file "sample.emacs")]
1418 ["Sample .%_Xdefaults"
1419 (find-file (locate-data-file "sample.Xdefaults"))
1420 :active (locate-data-file "sample.Xdefaults")]
1421 ["Sample e%_nriched"
1422 (find-file (locate-data-file "enriched.doc"))
1423 :active (locate-data-file "enriched.doc")])
1424 ("%_Commands & Keys"
1425 ["%_Mode" describe-mode]
1426 ["%_Apropos..." hyper-apropos]
1427 ["Apropos %_Docs..." apropos-documentation]
1429 ["%_Key..." describe-key]
1430 ["%_Bindings" describe-bindings]
1431 ["%_Mouse Bindings" describe-pointer]
1432 ["%_Recent Keys" view-lossage]
1434 ["%_Function..." describe-function]
1435 ["%_Variable..." describe-variable]
1436 ["%_Locate Command..." where-is])
1438 ["%_Recent Messages" view-lossage]
1440 ["%_Current Installation Info" describe-installation
1441 :active (boundp 'Installation-string)]
1442 ["%_No Warranty" describe-no-warranty]
1443 ["XEmacs %_License" describe-copying]
1444 ["Find %_Packages" finder-by-keyword]
1445 ["View %_Splash Screen" xemacs-splash-buffer]
1446 ["%_Unix Manual..." manual-entry])
1447 ["Send %_Bug Report..." report-emacs-bug
1448 :active (fboundp 'report-emacs-bug)]))))
1451 (defun maybe-add-init-button ()
1453 Adds `Load .emacs' button to menubar when starting up with -q."
1454 (when (and (not load-user-init-file-p)
1455 (file-exists-p (expand-file-name ".emacs" "~")))
1460 (mapc #'(lambda (buf)
1461 (with-current-buffer buf
1462 (delete-menu-item '("Load .emacs"))))
1464 (load-user-init-file))
1468 (add-hook 'before-init-hook 'maybe-add-init-button)
1473 (defvar put-buffer-names-in-file-menu t)
1476 ;;; The Bookmarks menu
1478 (defun bookmark-menu-filter (&rest ignore)
1479 (let ((definedp (and (boundp 'bookmark-alist)
1483 '("%_Jump to Bookmark"
1484 :filter (lambda (&rest junk)
1485 (mapcar #'(lambda (bmk)
1486 `[,bmk (bookmark-jump ',bmk)])
1487 (bookmark-all-names))))
1488 ["%_Jump to Bookmark" nil nil])
1489 ["Set %_Bookmark" bookmark-set
1490 :active (fboundp 'bookmark-set)]
1492 ["Insert %_Contents" bookmark-menu-insert
1493 :active (fboundp 'bookmark-menu-insert)]
1494 ["Insert L%_ocation" bookmark-menu-locate
1495 :active (fboundp 'bookmark-menu-locate)]
1497 ["%_Rename Bookmark" bookmark-menu-rename
1498 :active (fboundp 'bookmark-menu-rename)]
1500 '("%_Delete Bookmark"
1501 :filter (lambda (&rest junk)
1502 (mapcar #'(lambda (bmk)
1503 `[,bmk (bookmark-delete ',bmk)])
1504 (bookmark-all-names))))
1505 ["%_Delete Bookmark" nil nil])
1506 ["%_Edit Bookmark List" bookmark-bmenu-list ,definedp]
1508 ["%_Save Bookmarks" bookmark-save ,definedp]
1509 ["Save Bookmarks %_As..." bookmark-write ,definedp]
1510 ["%_Load a Bookmark File" bookmark-load
1511 :active (fboundp 'bookmark-load)])))
1513 ;;; The Buffers menu
1515 (defgroup buffers-menu nil
1516 "Customization of `Buffers' menu."
1519 (defvar buffers-menu-omit-chars-list '(?b ?p ?l))
1521 (defcustom buffers-menu-max-size 25
1522 "*Maximum number of entries which may appear on the \"Buffers\" menu.
1523 If this is 10, then only the ten most-recently-selected buffers will be
1524 shown. If this is nil, then all buffers will be shown. Setting this to
1525 a large number or nil will slow down menu responsiveness."
1526 :type '(choice (const :tag "Show all" nil)
1528 :group 'buffers-menu)
1530 (defcustom complex-buffers-menu-p nil
1531 "*If non-nil, the buffers menu will contain several commands.
1532 Commands will be presented as submenus of each buffer line. If this
1533 is false, then there will be only one command: select that buffer."
1535 :group 'buffers-menu)
1537 (defcustom buffers-menu-submenus-for-groups-p nil
1538 "*If non-nil, the buffers menu will contain one submenu per group of buffers.
1539 The grouping function is specified in `buffers-menu-grouping-function'.
1540 If this is an integer, do not build submenus if the number of buffers
1541 is not larger than this value."
1542 :type '(choice (const :tag "No Subgroups" nil)
1543 (integer :tag "Max. submenus" 10)
1544 (sexp :format "%t\n" :tag "Allow Subgroups" :value t))
1545 :group 'buffers-menu)
1547 (defcustom buffers-menu-switch-to-buffer-function 'switch-to-buffer
1548 "*The function to call to select a buffer from the buffers menu.
1549 `switch-to-buffer' is a good choice, as is `pop-to-buffer'."
1550 :type '(radio (function-item switch-to-buffer)
1551 (function-item pop-to-buffer)
1552 (function :tag "Other"))
1553 :group 'buffers-menu)
1555 (defcustom buffers-menu-omit-function 'buffers-menu-omit-invisible-buffers
1556 "*If non-nil, a function specifying the buffers to omit from the buffers menu.
1557 This is passed a buffer and should return non-nil if the buffer should be
1558 omitted. The default value `buffers-menu-omit-invisible-buffers' omits
1559 buffers that are normally considered \"invisible\" (those whose name
1560 begins with a space)."
1561 :type '(choice (const :tag "None" nil)
1563 :group 'buffers-menu)
1565 (defcustom buffers-menu-format-buffer-line-function 'format-buffers-menu-line
1566 "*The function to call to return a string to represent a buffer in
1567 the buffers menu. The function is passed a buffer and a number
1568 (starting with 1) indicating which buffer line in the menu is being
1569 processed and should return a string containing an accelerator
1570 spec. (Check out `menu-item-generate-accelerator-spec' as a convenient
1571 way of generating the accelerator specs.) The default value
1572 `format-buffers-menu-line' just returns the name of the buffer and
1573 uses the number as the accelerator. Also check out
1574 `slow-format-buffers-menu-line' which returns a whole bunch of info
1577 Note: Gross Compatibility Hack: Older versions of this function prototype
1578 only expected one argument, not two. We deal gracefully with such
1579 functions by simply calling them with one argument and leaving out the
1580 line number. However, this may go away at any time, so make sure to
1581 update all of your functions of this type."
1583 :group 'buffers-menu)
1585 (defcustom buffers-menu-sort-function
1586 'sort-buffers-menu-by-mode-then-alphabetically
1587 "*If non-nil, a function to sort the list of buffers in the buffers menu.
1588 It will be passed two arguments (two buffers to compare) and should return
1589 t if the first is \"less\" than the second. One possible value is
1590 `sort-buffers-menu-alphabetically'; another is
1591 `sort-buffers-menu-by-mode-then-alphabetically'."
1592 :type '(choice (const :tag "None" nil)
1594 :group 'buffers-menu)
1596 (defcustom buffers-menu-grouping-function
1597 'group-buffers-menu-by-mode-then-alphabetically
1598 "*If non-nil, a function to group buffers in the buffers menu together.
1599 It will be passed two arguments, successive members of the sorted buffers
1600 list after being passed through `buffers-menu-sort-function'. It should
1601 return non-nil if the second buffer begins a new group. The return value
1602 should be the name of the old group, which may be used in hierarchical
1603 buffers menus. The last invocation of the function contains nil as the
1604 second argument, so that the name of the last group can be determined.
1606 The sensible values of this function are dependent on the value specified
1607 for `buffers-menu-sort-function'."
1608 :type '(choice (const :tag "None" nil)
1610 :group 'buffers-menu)
1612 (defun sort-buffers-menu-alphabetically (buf1 buf2)
1613 "For use as a value of `buffers-menu-sort-function'.
1614 Sorts the buffers in alphabetical order by name, but puts buffers beginning
1615 with a star at the end of the list."
1616 (let* ((nam1 (buffer-name buf1))
1617 (nam2 (buffer-name buf2))
1618 (inv1p (not (null (string-match "\\` " nam1))))
1619 (inv2p (not (null (string-match "\\` " nam2))))
1620 (star1p (not (null (string-match "\\`*" nam1))))
1621 (star2p (not (null (string-match "\\`*" nam2)))))
1622 (cond ((not (eq inv1p inv2p))
1624 ((not (eq star1p star2p))
1627 (string-lessp nam1 nam2)))))
1629 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
1630 "For use as a value of `buffers-menu-sort-function'.
1631 Sorts first by major mode and then alphabetically by name, but puts buffers
1632 beginning with a star at the end of the list."
1633 (let* ((nam1 (buffer-name buf1))
1634 (nam2 (buffer-name buf2))
1635 (inv1p (not (null (string-match "\\` " nam1))))
1636 (inv2p (not (null (string-match "\\` " nam2))))
1637 (star1p (not (null (string-match "\\`*" nam1))))
1638 (star2p (not (null (string-match "\\`*" nam2))))
1639 (mode1 (symbol-value-in-buffer 'major-mode buf1))
1640 (mode2 (symbol-value-in-buffer 'major-mode buf2)))
1641 (cond ((not (eq inv1p inv2p))
1643 ((not (eq star1p star2p))
1645 ((and star1p star2p (string-lessp nam1 nam2)))
1646 ((string-lessp mode1 mode2)
1648 ((string-lessp mode2 mode1)
1651 (string-lessp nam1 nam2)))))
1653 ;; this version is too slow on some machines.
1654 ;; (vintage 1990, that is)
1655 (defun slow-format-buffers-menu-line (buffer n)
1656 "For use as a value of `buffers-menu-format-buffer-line-function'.
1657 This returns a string containing a bunch of info about the buffer."
1658 (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list)
1659 (format "%s%s %-19s %6s %-15s %s"
1660 (if (buffer-modified-p buffer) "*" " ")
1661 (if (symbol-value-in-buffer 'buffer-read-only buffer)
1663 (buffer-name buffer)
1664 (buffer-size buffer)
1665 (symbol-value-in-buffer 'mode-name buffer)
1666 (or (buffer-file-name buffer) ""))))
1668 (defun format-buffers-menu-line (buffer n)
1669 "For use as a value of `buffers-menu-format-buffer-line-function'.
1670 This just returns the buffer's name."
1671 (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list)
1672 (buffer-name buffer)))
1674 (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
1675 "For use as a value of `buffers-menu-grouping-function'.
1676 This groups buffers by major mode. It only really makes sense if
1677 `buffers-menu-sorting-function' is
1678 `sort-buffers-menu-by-mode-then-alphabetically'."
1679 (cond ((string-match "\\`*" (buffer-name buf1))
1680 (and (null buf2) "*Misc*"))
1682 (string-match "\\`*" (buffer-name buf2))
1683 (not (eq (symbol-value-in-buffer 'major-mode buf1)
1684 (symbol-value-in-buffer 'major-mode buf2))))
1685 (symbol-value-in-buffer 'mode-name buf1))
1688 (defun buffer-menu-save-buffer (buffer)
1693 (defun buffer-menu-write-file (buffer)
1696 (write-file (read-file-name
1697 (format "Write %s to file: "
1698 (buffer-name (current-buffer)))))))
1700 (defsubst build-buffers-menu-internal (buffers)
1701 (let (name line (n 0))
1708 ; #### a truly Kyle-friendly hack.
1709 (let ((fn buffers-menu-format-buffer-line-function))
1710 (if (= (function-max-args fn) 1)
1712 (funcall fn buffer n))))
1713 (if complex-buffers-menu-p
1716 (vector "S%_witch to Buffer"
1717 (list buffers-menu-switch-to-buffer-function
1718 (setq name (buffer-name buffer)))
1720 (if (eq buffers-menu-switch-to-buffer-function
1722 (vector "Switch to Buffer, Other %_Frame"
1723 (list 'switch-to-buffer-other-frame
1724 (setq name (buffer-name buffer)))
1727 (if (and (buffer-modified-p buffer)
1728 (buffer-file-name buffer))
1729 (vector "%_Save Buffer"
1730 (list 'buffer-menu-save-buffer name) t)
1731 ["%_Save Buffer" nil nil]
1733 (vector "Save %_As..."
1734 (list 'buffer-menu-write-file name) t)
1735 (vector "%_Delete Buffer" (list 'kill-buffer name)
1737 ;; #### We don't want buffer names to be translated,
1738 ;; #### so we put the buffer name in the suffix.
1739 ;; #### Also, avoid losing with non-ASCII buffer names.
1740 ;; #### We still lose, however, if complex-buffers-menu-p. --mrb
1742 (list buffers-menu-switch-to-buffer-function
1743 (buffer-name buffer))
1747 (defun buffers-menu-filter (menu)
1748 "This is the menu filter for the top-level buffers \"Buffers\" menu.
1749 It dynamically creates a list of buffers to use as the contents of the menu.
1750 Only the most-recently-used few buffers will be listed on the menu, for
1751 efficiency reasons. You can control how many buffers will be shown by
1752 setting `buffers-menu-max-size'. You can control the text of the menu
1753 items by redefining the function `format-buffers-menu-line'."
1754 (let ((buffers (delete-if buffers-menu-omit-function (buffer-list))))
1755 (and (integerp buffers-menu-max-size)
1756 (> buffers-menu-max-size 1)
1757 (> (length buffers) buffers-menu-max-size)
1758 ;; shorten list of buffers (not with submenus!)
1759 (not (and buffers-menu-grouping-function
1760 buffers-menu-submenus-for-groups-p))
1761 (setcdr (nthcdr buffers-menu-max-size buffers) nil))
1762 (if buffers-menu-sort-function
1763 (setq buffers (sort buffers buffers-menu-sort-function)))
1764 (if (and buffers-menu-grouping-function
1765 buffers-menu-submenus-for-groups-p
1766 (or (not (integerp buffers-menu-submenus-for-groups-p))
1767 (> (length buffers) buffers-menu-submenus-for-groups-p)))
1768 (let (groups groupnames current-group)
1771 (let ((groupname (funcall buffers-menu-grouping-function
1772 (car sublist) (cadr sublist))))
1773 (setq current-group (cons (car sublist) current-group))
1776 (setq groups (cons (nreverse current-group)
1778 (setq groupnames (cons groupname groupnames))
1779 (setq current-group nil)))))
1783 #'(lambda (groupname group)
1784 (cons groupname (build-buffers-menu-internal group)))
1785 (nreverse groupnames)
1786 (nreverse groups))))
1787 (if buffers-menu-grouping-function
1792 (cond ((funcall buffers-menu-grouping-function
1793 (car sublist) (cadr sublist))
1794 (list (car sublist) t))
1795 (t (list (car sublist)))))
1797 ;; remove a trailing separator.
1798 (and (>= (length buffers) 2)
1799 (let ((lastcdr (nthcdr (- (length buffers) 2) buffers)))
1800 (if (eq t (cadr lastcdr))
1801 (setcdr lastcdr nil))))))
1802 (setq buffers (build-buffers-menu-internal buffers)))
1803 (append menu buffers)
1806 (defun language-environment-menu-filter (menu)
1807 "This is the menu filter for the \"Language Environment\" submenu."
1809 (mapcar (lambda (env-sym)
1811 `[ ,(concat (menu-item-generate-accelerator-spec n)
1812 (capitalize (symbol-name env-sym)))
1813 (set-language-environment ',env-sym)])
1814 language-environment-list)))
1817 ;;; The Options menu
1819 ;; We'll keep those variables here for a while, in order to provide a
1820 ;; function for porting the old options file that a user may own to Custom.
1822 (defvar options-save-faces nil
1823 "*Non-nil value means save-options will save information about faces.
1824 A nil value means save-options will not save face information.
1825 Set this non-nil only if you use M-x edit-faces to change face
1826 settings. If you use M-x customize-face or the \"Browse Faces...\"
1827 menu entry, you will see a button in the Customize Face buffer that you
1828 can use to permanently save your face changes.
1830 M-x edit-faces is deprecated. Support for it and this variable will
1831 be discontinued in a future release.")
1833 (defvar save-options-init-file nil
1834 "File into which to save forms to load the options file (nil for .emacs).
1835 Normally this is nil, which means save into your .emacs file (the value
1836 of `user-init-file'.")
1838 (defvar save-options-file ".xemacs-options"
1839 "File to save options into.
1840 This file is loaded from your .emacs file.
1841 If this is a relative filename, it is put into the same directory as your
1848 (defun tutorials-menu-filter (menu-items)
1850 (if (featurep 'mule)
1852 (assoc current-language-environment language-info-alist))
1853 `([,(concat "%_Default (" current-language-environment ")")
1854 help-with-tutorial]))
1855 '(["%_English" help-with-tutorial]))
1856 (submenu-generate-accelerator-spec
1857 (if (featurep 'mule)
1859 (mapcan #'(lambda (lang)
1860 (let ((tut (assq 'tutorial lang)))
1862 (not (string= (car lang) "ASCII"))
1863 ;; skip current language, since we already
1864 ;; included it first
1865 (not (string= (car lang)
1866 current-language-environment))
1868 (help-with-tutorial nil ,(cdr tut))]))))
1869 language-info-alist))
1870 ;; Non mule tutorials.
1871 (mapcar #'(lambda (lang)
1873 (help-with-tutorial ,(format "TUTORIAL.%s"
1875 tutorial-supported-languages))))
1878 (set-menubar default-menubar)
1883 (defconst default-popup-menu
1885 ["%_Undo" advertised-undo
1886 :active (and (not (eq buffer-undo-list t))
1887 (or buffer-undo-list pending-undo-list))
1888 :suffix (if (or (eq last-command 'undo)
1889 (eq last-command 'advertised-undo))
1891 ["Cu%_t" kill-primary-selection
1892 :active (selection-owner-p)]
1893 ["%_Copy" copy-primary-selection
1894 :active (selection-owner-p)]
1895 ["%_Paste" yank-clipboard-selection
1896 :active (selection-exists-p 'CLIPBOARD)]
1897 ["%_Delete" delete-primary-selection
1898 :active (selection-owner-p)]
1900 ["Select %_Block" mark-paragraph]
1901 ["Sp%_lit Window" split-window-vertically]
1902 ["U%_nsplit Window" delete-other-windows]
1905 (defvar global-popup-menu nil
1906 "The global popup menu. This is present in all modes.
1907 See the function `popup-menu' for a description of menu syntax.")
1909 (defvar mode-popup-menu nil
1910 "The mode-specific popup menu. Automatically buffer local.
1911 This is appended to the default items in `global-popup-menu'.
1912 See the function `popup-menu' for a description of menu syntax.")
1913 (make-variable-buffer-local 'mode-popup-menu)
1915 ;; In an effort to avoid massive menu clutter, this mostly worthless menu is
1916 ;; superseded by any local popup menu...
1917 (setq-default mode-popup-menu default-popup-menu)
1919 (defvar activate-popup-menu-hook nil
1920 "Function or functions run before a mode-specific popup menu is made visible.
1921 These functions are called with no arguments, and should interrogate and
1922 modify the value of `global-popup-menu' or `mode-popup-menu' as desired.
1923 Note: this hook is only run if you use `popup-mode-menu' for activating the
1924 global and mode-specific commands; if you have your own binding for button3,
1925 this hook won't be run.")
1927 (defun popup-mode-menu ()
1928 "Pop up a menu of global and mode-specific commands.
1929 The menu is computed by combining `global-popup-menu' and `mode-popup-menu'."
1931 (run-hooks 'activate-popup-menu-hook)
1933 (cond ((and global-popup-menu mode-popup-menu)
1934 ;; Merge global-popup-menu and mode-popup-menu
1935 (check-menu-syntax mode-popup-menu)
1936 (let* ((title (car mode-popup-menu))
1937 (items (cdr mode-popup-menu))
1939 ;; Strip keywords from local menu for attaching them at the top
1941 (keywordp (car items)))
1942 ;; Push both keyword and its argument.
1943 (push (pop items) mode-filters)
1944 (push (pop items) mode-filters))
1945 (setq mode-filters (nreverse mode-filters))
1946 ;; If mode-filters contains a keyword already present in
1947 ;; `global-popup-menu', you will probably lose.
1948 (append (list (car global-popup-menu))
1950 (cdr global-popup-menu)
1952 (if popup-menu-titles (list title))
1953 (if popup-menu-titles '("---" "---"))
1958 (error "No menu defined in this buffer"))))))
1960 (defun popup-buffer-menu (event)
1961 "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked."
1963 (let ((window (and (event-over-text-area-p event) (event-window event)))
1966 (error "Pointer must be in a normal window"))
1967 (select-window window)
1969 (setq bmenu (assoc "%_Buffers" current-menubar)))
1971 (setq bmenu (assoc "%_Buffers" default-menubar)))
1973 (error "Can't find the Buffers menu"))
1974 (popup-menu bmenu)))
1976 (defun popup-menubar-menu (event)
1977 "Pop up a copy of menu that also appears in the menubar."
1979 (let ((window (and (event-over-text-area-p event) (event-window event)))
1982 (error "Pointer must be in a normal window"))
1983 (select-window window)
1984 (and current-menubar (run-hooks 'activate-menubar-hook))
1985 ;; #### Instead of having to copy this just to safely get rid of
1986 ;; any nil what we should really do is fix up the internal menubar
1987 ;; code to just ignore nil if generating a popup menu
1988 (setq popup-menubar (delete nil (copy-sequence (or current-menubar
1990 (popup-menu (cons "%_Menubar Menu" popup-menubar))
1993 (global-set-key 'button3 'popup-mode-menu)
1994 ;; shift button3 and shift button2 are reserved for Hyperbole
1995 (global-set-key '(meta control button3) 'popup-buffer-menu)
1996 ;; The following command is way too dangerous with Custom.
1997 ;; (global-set-key '(meta shift button3) 'popup-menubar-menu)
1999 ;; Here's a test of the cool new menu features (from Stig).
2001 ;;(setq mode-popup-menu
2002 ;; '("Test Popup Menu"
2004 ;; ["this item won't appear because of the menu filter" ding t]
2009 ;; "--:singleDashedLine"
2010 ;; "singleDashedLine"
2011 ;; "--:doubleDashedLine"
2012 ;; "doubleDashedLine"
2015 ;; "--:shadowEtchedIn"
2017 ;; "--:shadowEtchedOut"
2018 ;; "shadowEtchedOut"
2019 ;; "--:shadowDoubleEtchedIn"
2020 ;; "shadowDoubleEtchedIn"
2021 ;; "--:shadowDoubleEtchedOut"
2022 ;; "shadowDoubleEtchedOut"
2023 ;; "--:shadowEtchedInDash"
2024 ;; "shadowEtchedInDash"
2025 ;; "--:shadowEtchedOutDash"
2026 ;; "shadowEtchedOutDash"
2027 ;; "--:shadowDoubleEtchedInDash"
2028 ;; "shadowDoubleEtchedInDash"
2029 ;; "--:shadowDoubleEtchedOutDash"
2030 ;; "shadowDoubleEtchedOutDash"
2033 (defun xemacs-splash-buffer ()
2034 "Redisplay XEmacs splash screen in a buffer."
2036 (let ((buffer (get-buffer-create "*Splash*"))
2039 (setq buffer-read-only t)
2040 (erase-buffer buffer)
2041 (setq tmout (display-splash-frame))
2043 (make-local-hook 'kill-buffer-hook)
2044 (add-hook 'kill-buffer-hook
2046 (disable-timeout ,tmout))
2048 (pop-to-buffer buffer)
2049 (delete-other-windows)))
2052 ;;; backwards compatibility
2053 (provide 'x-menubar)
2054 (provide 'menubar-items)
2056 ;;; menubar-items.el ends here.