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 (defun Menubar-items-truncate-history (list count label-length)
58 "Truncate a history LIST to first COUNT items.
59 Return a list of (label value) lists with labels truncated to last
60 LABEL-LENGTH characters of value."
62 (if (<= (length x) label-length)
65 (concat "..." (substring x (- label-length))) x)))
66 (if (<= (length list) count)
68 (butlast list (- (length list) count)))))
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
132 ; (purecopy-menubar ;purespace is dead
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 ,@(if (valid-specifier-tag-p 'msprinter)
151 '(["Page Set%_up..." generic-page-setup]))
152 ["%_Print" generic-print-buffer
153 :active (or (valid-specifier-tag-p 'msprinter)
154 (and (not (eq system-type 'windows-nt))
155 (fboundp 'lpr-region)))
156 :suffix (if (region-active-p) "Selection..."
157 (if put-buffer-names-in-file-menu (concat (buffer-name) "...")
159 ,@(unless (valid-specifier-tag-p 'msprinter)
160 '(["Prett%_y-Print" ps-print-buffer-with-faces
161 :active (fboundp 'ps-print-buffer-with-faces)
162 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]))
164 ["%_Revert Buffer" revert-buffer
165 :active (or buffer-file-name revert-buffer-function)
166 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
167 ["Re%_cover File..." recover-file]
168 ["Recover S%_ession..." recover-session]
170 ["E%_xit XEmacs" save-buffers-kill-emacs]
174 ["%_Undo" advertised-undo
175 :active (and (not (eq buffer-undo-list t))
176 (or buffer-undo-list pending-undo-list))
177 :suffix (if (or (eq last-command 'undo)
178 (eq last-command 'advertised-undo))
181 :included (fboundp 'redo)
182 :active (not (or (eq buffer-undo-list t)
183 (eq last-buffer-undo-list nil)
184 (not (or (eq last-buffer-undo-list buffer-undo-list)
185 (and (null (car-safe buffer-undo-list))
186 (eq last-buffer-undo-list
187 (cdr-safe buffer-undo-list)))))
188 (or (eq buffer-undo-list pending-undo-list)
189 (eq (cdr buffer-undo-list) pending-undo-list))))
190 :suffix (if (eq last-command 'redo) "More" "")]
192 ["Cu%_t" kill-primary-selection
193 :active (selection-owner-p)]
194 ["%_Copy" copy-primary-selection
195 :active (selection-owner-p)]
196 ["%_Paste" yank-clipboard-selection
197 :active (selection-exists-p 'CLIPBOARD)]
198 ["%_Delete" delete-primary-selection
199 :active (selection-owner-p)]
201 ["Select %_All" mark-whole-buffer]
202 ["Select Pa%_ge" mark-page]
204 ["%_Find..." make-search-dialog]
205 ["R%_eplace..." query-replace]
206 ["Replace (Rege%_xp)..." query-replace-regexp]
207 ["%_List Matching Lines..." list-matching-lines]
208 ,@(when (featurep 'mule)
210 ("%_Multilingual (\"Mule\")"
211 ("%_Describe Language Support")
212 ("%_Set Language Environment")
214 ["T%_oggle Input Method" toggle-input-method]
215 ["Select %_Input Method" set-input-method]
216 ["D%_escribe Input Method" describe-input-method]
218 ["Describe Current %_Coding Systems"
219 describe-current-coding-system]
220 ["Set Coding System of %_Buffer File..."
221 set-buffer-file-coding-system]
222 ;; not implemented yet
223 ["Set Coding System of %_Terminal..."
224 set-terminal-coding-system :active nil]
225 ;; not implemented yet
226 ["Set Coding System of %_Keyboard..."
227 set-keyboard-coding-system :active nil]
228 ["Set Coding System of %_Process..."
229 set-buffer-process-coding-system
230 :active (get-buffer-process (current-buffer))]
232 ["Show Cha%_racter Table" view-charset-by-menu]
233 ;; not implemented yet
234 ["Show Dia%_gnosis for MULE" mule-diag :active nil]
235 ["Show \"%_hello\" in Many Languages" view-hello-file]))
240 ["%_New Frame" make-frame]
241 ["Frame on Other Displa%_y..." make-frame-on-display
242 :active (fboundp 'make-frame-on-display)]
243 ["%_Delete Frame" delete-frame
244 :active (not (eq (next-frame (selected-frame) 'nomini 'window-system)
247 ["%_Split Window" split-window-vertically]
248 ["S%_plit Window (Side by Side)" split-window-horizontally]
249 ["%_Un-Split (Keep This)" delete-other-windows
250 :active (not (one-window-p t))]
251 ["Un-Split (Keep %_Others)" delete-window
252 :active (not (one-window-p t))]
255 ["%_Narrow to Region" narrow-to-region :active (region-exists-p)]
256 ["Narrow to %_Page" narrow-to-page]
257 ["Narrow to %_Defun" narrow-to-defun]
259 ["%_Widen" widen :active (or (/= (point-min) 1)
260 (/= (point-max) (1+ (buffer-size))))]
263 ["Show Message %_Log" show-message-log]
265 ["%_Goto Line..." goto-line]
266 ["%_What Line" what-line]
268 :filter bookmark-menu-filter)
270 ["%_Jump to Previous Mark" (set-mark-command t)
275 ["Repeat %_Last Complex Command..." repeat-complex-command]
276 ["E%_valuate Lisp Expression..." eval-expression]
277 ["Execute %_Named Command..." execute-extended-command]
279 ["Start %_Macro Recording" start-kbd-macro
280 :included (not defining-kbd-macro)]
281 ["End %_Macro Recording" end-kbd-macro
282 :included defining-kbd-macro]
283 ["E%_xecute Last Macro" call-last-kbd-macro
284 :active last-kbd-macro]
286 ["%_Append to Last Macro" (start-kbd-macro t)
287 :active (and (not defining-kbd-macro) last-kbd-macro)]
288 ["%_Query User During Macro" kbd-macro-query
289 :active defining-kbd-macro]
290 ["Enter %_Recursive Edit During Macro" (kbd-macro-query t)
291 :active defining-kbd-macro]
293 ["E%_xecute Last Macro on Region Lines"
294 :active (and last-kbd-macro (region-exists-p))]
296 ["%_Name Last Macro..." name-last-kbd-macro
297 :active last-kbd-macro]
298 ["Assign Last Macro to %_Key..." assign-last-kbd-macro-to-key
299 :active (and last-kbd-macro
300 (fboundp 'assign-last-kbd-macro-to-key))]
302 ["%_Edit Macro..." edit-kbd-macro]
303 ["Edit %_Last Macro" edit-last-kbd-macro
304 :active last-kbd-macro]
306 ["%_Insert Named Macro into Buffer..." insert-kbd-macro]
307 ["Read Macro from Re%_gion" read-kbd-macro
308 :active (region-exists-p)]
312 ["D%_ynamic Abbrev Expand" dabbrev-expand]
313 ["Dynamic Abbrev %_Complete" dabbrev-completion]
314 ["Dynamic Abbrev Complete in %_All Buffers" (dabbrev-completion 16)]
317 ["%_Define Global Abbrev for " add-global-abbrev
318 :suffix (abbrev-string-to-be-defined nil)
320 ["Define %_Mode-Specific Abbrev for " add-mode-abbrev
321 :suffix (abbrev-string-to-be-defined nil)
323 ["Define Global Ex%_pansion for " inverse-add-global-abbrev
324 :suffix (inverse-abbrev-string-to-be-defined 1)
326 ["Define Mode-Specific Expa%_nsion for " inverse-add-mode-abbrev
327 :suffix (inverse-abbrev-string-to-be-defined 1)
330 ["E%_xpand Abbrev" expand-abbrev]
331 ["Expand Abbrevs in Re%_gion" expand-region-abbrevs
332 :active (region-exists-p)]
333 ["%_Unexpand Last Abbrev" unexpand-abbrev
334 :active (and (stringp last-abbrev-text)
335 (> last-abbrev-location 0))]
337 ["%_Kill All Abbrevs" kill-all-abbrevs]
338 ["%_Insert All Abbrevs into Buffer" insert-abbrevs]
339 ["%_List Abbrevs" list-abbrevs]
341 ["%_Edit Abbrevs" edit-abbrevs]
342 ["%_Redefine Abbrevs from Buffer" edit-abbrevs-redefine
343 :active (eq major-mode 'edit-abbrevs-mode)]
345 ["%_Save Abbrevs As..." write-abbrev-file]
346 ["L%_oad Abbrevs..." read-abbrev-file]
349 ["%_Copy to Register..." copy-to-register :active (region-exists-p)]
350 ["%_Paste Register..." insert-register]
352 ["%_Save Point to Register" point-to-register]
353 ["%_Jump to Register" register-to-point]
356 ["%_Kill Rectangle" kill-rectangle]
357 ["%_Yank Rectangle" yank-rectangle]
358 ["Rectangle %_to Register" copy-rectangle-to-register]
359 ["Rectangle %_from Register" insert-register]
360 ["%_Clear Rectangle" clear-rectangle]
361 ["%_Open Rectangle" open-rectangle]
362 ["%_Prefix Rectangle..." string-rectangle]
363 ["Rectangle %_Mousing"
364 (customize-set-variable 'mouse-track-rectangle-p
365 (not mouse-track-rectangle-p))
366 :style toggle :selected mouse-track-rectangle-p]
369 ["%_Lines in Region" sort-lines :active (region-exists-p)]
370 ["%_Paragraphs in Region" sort-paragraphs :active (region-exists-p)]
371 ["P%_ages in Region" sort-pages :active (region-exists-p)]
372 ["%_Columns in Region" sort-columns :active (region-exists-p)]
373 ["%_Regexp..." sort-regexp-fields :active (region-exists-p)]
376 ["%_Upcase Region" upcase-region :active (region-exists-p)]
377 ["%_Downcase Region" downcase-region :active (region-exists-p)]
378 ["%_Capitalize Region" capitalize-region :active (region-exists-p)]
379 ["%_Title-Case Region" capitalize-region-as-title
380 :active (region-exists-p)]
383 ["%_Line" center-line]
384 ["%_Paragraph" center-paragraph]
385 ["%_Region" center-region :active (region-exists-p)]
388 ["%_As Previous Line" indent-relative]
389 ["%_To Column..." indent-to-column]
391 ["%_Region" indent-region :active (region-exists-p)]
392 ["%_Balanced Expression" indent-sexp]
393 ["%_C Expression" indent-c-exp]
396 ["%_Buffer" ispell-buffer
397 :active (fboundp 'ispell-buffer)]
399 ["%_Word" ispell-word]
400 ["%_Complete Word" ispell-complete-word]
401 ["%_Region" ispell-region]
407 ("%_Add Download Site"
408 :filter (lambda (&rest junk)
409 (submenu-generate-accelerator-spec
410 (package-get-download-menu))))
411 ["%_Update Package Index" package-get-update-base]
412 ["%_List and Install" pui-list-packages]
413 ["U%_pdate Installed Packages" package-get-update-all]
414 ;; hack-o-matic, we can't force a load of package-base here
415 ;; since it triggers dialog box interactions which we can't
416 ;; deal with while using a menu
418 :filter (lambda (&rest junk)
420 (submenu-generate-accelerator-spec
421 (cdr (custom-menu-create 'packages)))
422 '("Please load Package Index"))))
424 ["%_Help" (Info-goto-node "(xemacs)Packages")])
426 ["Read Mail %_1 (VM)..." vm
427 :active (fboundp 'vm)]
428 ["Read Mail %_2 (MH)..." (mh-rmail t)
429 :active (fboundp 'mh-rmail)]
430 ["Send %_Mail..." compose-mail
431 :active (fboundp 'compose-mail)]
432 ["Usenet %_News" gnus
433 :active (fboundp 'gnus)]
434 ["Browse the %_Web" w3
435 :active (fboundp 'w3)])
440 (if (or (not (boundp 'grep-history)) (null grep-history))
443 (submenu-generate-accelerator-spec
444 (mapcar #'(lambda (label-value)
445 (vector (first label-value)
446 (list 'grep (second label-value))))
447 (Menubar-items-truncate-history
448 grep-history 10 50)))))
449 (append menu '("---") items))))
450 ["%_Grep..." grep :active (fboundp 'grep)]
451 ["%_Kill Grep" kill-compilation
452 :active (and (fboundp 'kill-compilation)
453 (fboundp 'compilation-find-buffer)
454 (let ((buffer (condition-case nil
455 (compilation-find-buffer)
457 (and buffer (get-buffer-process buffer))))]
459 ["Grep %_All Files in Current Directory..."
463 (cons (concat grep-command " *")
464 (length grep-command))))
465 (call-interactively 'grep)))
466 :active (fboundp 'grep)]
467 ["Grep %_C and C Header Files in Current Directory..."
471 (cons (concat grep-command " *.[chCH]"
472 ; i wanted to also use *.cc and *.hh.
473 ; see long comment below under Perl.
475 (length grep-command))))
476 (call-interactively 'grep)))
477 :active (fboundp 'grep)]
478 ["Grep C Hea%_der Files in Current Directory..."
482 (cons (concat grep-command " *.[hH]"
483 ; i wanted to also use *.hh.
484 ; see long comment below under Perl.
486 (length grep-command))))
487 (call-interactively 'grep)))
488 :active (fboundp 'grep)]
489 ["Grep %_E-Lisp Files in Current Directory..."
493 (cons (concat grep-command " *.el")
494 (length grep-command))))
495 (call-interactively 'grep)))
496 :active (fboundp 'grep)]
497 ["Grep %_Perl Files in Current Directory..."
501 (cons (concat grep-command " *.pl"
502 ; i wanted to use this:
504 ; but grep complains if it can't
505 ; match anything in a glob, and
506 ; that screws other things up.
507 ; perhaps we need to first scan
508 ; each separate glob in the directory
509 ; to see if there are any files in
510 ; that glob, and if not, omit it.
512 (length grep-command))))
513 (call-interactively 'grep)))
514 :active (fboundp 'grep)]
515 ["Grep %_HTML Files in Current Directory..."
519 (cons (concat grep-command " *.*htm*")
520 (length grep-command))))
521 (call-interactively 'grep)))
522 :active (fboundp 'grep)]
524 ["%_Next Match" next-error
525 :active (and (fboundp 'compilation-errors-exist-p)
526 (compilation-errors-exist-p))]
527 ["Pre%_vious Match" previous-error
528 :active (and (fboundp 'compilation-errors-exist-p)
529 (compilation-errors-exist-p))]
530 ["%_First Match" first-error
531 :active (and (fboundp 'compilation-errors-exist-p)
532 (compilation-errors-exist-p))]
533 ["G%_oto Match" compile-goto-error
534 :active (and (fboundp 'compilation-errors-exist-p)
535 (compilation-errors-exist-p))]
537 ["%_Set Grep Command..."
540 (customize-set-variable
542 (read-shell-command "Default Grep Command: " grep-command)))
543 :active (fboundp 'grep)
549 (if (or (not (boundp 'compile-history)) (null compile-history))
552 (submenu-generate-accelerator-spec
553 (mapcar #'(lambda (label-value)
554 (vector (first label-value)
555 (list 'compile (second label-value))))
556 (Menubar-items-truncate-history
557 compile-history 10 50)))))
558 (append menu '("---") items))))
559 ["%_Compile..." compile :active (fboundp 'compile)]
560 ["%_Repeat Compilation" recompile :active (fboundp 'recompile)]
561 ["%_Kill Compilation" kill-compilation
562 :active (and (fboundp 'kill-compilation)
563 (fboundp 'compilation-find-buffer)
564 (let ((buffer (condition-case nil
565 (compilation-find-buffer)
567 (and buffer (get-buffer-process buffer))))]
569 ["%_Next Error" next-error
570 :active (and (fboundp 'compilation-errors-exist-p)
571 (compilation-errors-exist-p))]
572 ["Pre%_vious Error" previous-error
573 :active (and (fboundp 'compilation-errors-exist-p)
574 (compilation-errors-exist-p))]
575 ["%_First Error" first-error
576 :active (and (fboundp 'compilation-errors-exist-p)
577 (compilation-errors-exist-p))]
578 ["G%_oto Error" compile-goto-error
579 :active (and (fboundp 'compilation-errors-exist-p)
580 (compilation-errors-exist-p))]
584 :active (fboundp 'gdb)]
586 :active (fboundp 'dbx)])
589 :active (fboundp 'shell)]
590 ["S%_hell Command..." shell-command
591 :active (fboundp 'shell-command)]
592 ["Shell Command on %_Region..." shell-command-on-region
593 :active (and (fboundp 'shell-command-on-region) (region-exists-p))])
596 ["%_Find Tag..." find-tag]
597 ["Find %_Other Window..." find-tag-other-window]
598 ["%_Next Tag..." (find-tag nil)]
599 ["N%_ext Other Window..." (find-tag-other-window nil)]
600 ["Next %_File" next-file]
602 ["Tags %_Search..." tags-search]
603 ["Tags %_Replace..." tags-query-replace]
604 ["%_Continue Search/Replace" tags-loop-continue]
606 ["%_Pop stack" pop-tag-mark]
607 ["%_Apropos..." tags-apropos]
609 ["%_Set Tags Table File..." visit-tags-table]
615 ["%_3-Month Calendar" calendar
616 :active (fboundp 'calendar)]
618 :active (fboundp 'diary)]
619 ["%_Holidays" holidays
620 :active (fboundp 'holidays)]
621 ;; we're all pagans at heart ...
622 ["%_Phases of the Moon" phases-of-moon
623 :active (fboundp 'phases-of-moon)]
624 ["%_Sunrise/Sunset" sunrise-sunset
625 :active (fboundp 'sunrise-sunset)])
629 :active (fboundp 'xmine)]
631 :active (fboundp 'tetris)]
633 :active (fboundp 'sokoban)]
634 ["Quote from %_Zippy" yow
635 :active (fboundp 'yow)]
636 ["%_Psychoanalyst" doctor
637 :active (fboundp 'doctor)]
638 ["Ps%_ychoanalyze Zippy!" psychoanalyze-pinhead
639 :active (fboundp 'psychoanalyze-pinhead)]
640 ["%_Random Flames" flame
641 :active (fboundp 'flame)]
642 ["%_Dunnet (Adventure)" dunnet
643 :active (fboundp 'dunnet)]
644 ["Towers of %_Hanoi" hanoi
645 :active (fboundp 'hanoi)]
646 ["Game of %_Life" life
647 :active (fboundp 'life)]
648 ["M%_ultiplication Puzzle" mpuz
649 :active (fboundp 'mpuz)])
655 ("%_Advanced (Customize)"
656 ("%_Emacs" :filter (lambda (&rest junk)
657 (cdr (custom-menu-create 'emacs))))
658 ["%_Group..." customize-group]
659 ["%_Variable..." customize-variable]
660 ["%_Face..." customize-face]
661 ["%_Saved..." customize-saved]
662 ["Se%_t..." customize-customized]
663 ["%_Apropos..." customize-apropos]
664 ["%_Browse..." customize-browse])
667 ["This Buffer %_Read Only" (toggle-read-only)
668 :style toggle :selected buffer-read-only]
669 ["%_Yank/Kill Interact With Clipboard"
670 (if (eq interprogram-cut-function 'own-clipboard)
672 (customize-set-variable 'interprogram-cut-function nil)
673 (customize-set-variable 'interprogram-paste-function nil))
674 (customize-set-variable 'interprogram-cut-function 'own-clipboard)
675 (customize-set-variable 'interprogram-paste-function 'get-clipboard))
677 :selected (eq interprogram-cut-function 'own-clipboard)]
680 (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual))
681 (customize-set-variable 'overwrite-mode overwrite-mode))
682 :style toggle :selected overwrite-mode]
684 (customize-set-variable 'abbrev-mode
685 (not (default-value 'abbrev-mode)))
687 :selected (default-value 'abbrev-mode)]
689 (customize-set-variable 'zmacs-regions (not zmacs-regions))
690 :style toggle :selected zmacs-regions]
692 ["%_Case Sensitive Search"
693 (customize-set-variable 'case-fold-search
694 (setq case-fold-search (not case-fold-search)))
695 :style toggle :selected (not case-fold-search)]
696 ["Case %_Matching Replace"
697 (customize-set-variable 'case-replace (not case-replace))
698 :style toggle :selected case-replace]
700 ("%_Newline at End of File..."
702 (customize-set-variable 'require-final-newline nil)
703 :style radio :selected (not require-final-newline)]
705 (customize-set-variable 'require-final-newline t)
706 :style radio :selected (eq require-final-newline t)]
708 (customize-set-variable 'require-final-newline 'ask)
709 :style radio :selected (and require-final-newline
710 (not (eq require-final-newline t)))])
711 ["Add Newline When Moving Past %_End"
712 (customize-set-variable 'next-line-add-newlines
713 (not next-line-add-newlines))
714 :style toggle :selected next-line-add-newlines])
715 ("%_Keyboard and Mouse"
716 ["%_Delete Key Deletes Selection"
717 (customize-set-variable 'pending-delete-mode (not pending-delete-mode))
719 :selected (and (boundp 'pending-delete-mode) pending-delete-mode)
720 :active (boundp 'pending-delete-mode)]
721 ["`%_kill-line' Kills Whole Line at %_Beg"
722 (customize-set-variable 'kill-whole-line (not kill-whole-line))
724 :selected kill-whole-line]
725 ["Size for %_Block-Movement Commands..."
726 (customize-set-variable 'block-movement-size
727 (read-number "Block Movement Size: "
728 t block-movement-size))]
732 (customize-set-variable 'viper-mode viper-mode))
733 :style toggle :selected (and (boundp 'viper-mode) viper-mode)
734 :active (fboundp 'toggle-viper-mode)]
736 ["S%_hifted Motion Keys Select Region"
737 (customize-set-variable 'shifted-motion-keys-select-region
738 (not shifted-motion-keys-select-region))
740 :selected shifted-motion-keys-select-region]
741 ["%_After Shifted Motion, Unshifted Motion Keys Deselect"
742 (customize-set-variable 'unshifted-motion-keys-deselect-region
743 (not unshifted-motion-keys-deselect-region))
745 :selected unshifted-motion-keys-deselect-region]
747 ["%_Set Key..." global-set-key]
748 ["%_Unset Key..." global-unset-key]
750 ["%_Mouse Paste at Text Cursor (not Clicked Location)"
751 (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point))
752 :style toggle :selected mouse-yank-at-point]
754 ["%_Teach Extended Commands"
755 (customize-set-variable 'teach-extended-commands-p
756 (not teach-extended-commands-p))
757 :style toggle :selected teach-extended-commands-p]
760 ["Set Printer %_Name for Generic Print Support..."
761 (customize-set-variable
763 (read-string "Set printer name: " printer-name))]
765 ["Command-Line %_Switches for `lpr'/`lp'..."
766 ;; better to directly open a customization buffer, since the value
767 ;; must be a list of strings, which is somewhat complex to prompt for.
768 (customize-variable 'lpr-switches)
769 (boundp 'lpr-switches)]
770 ("%_Pretty-Print Paper Size"
772 (customize-set-variable 'ps-paper-type 'letter)
774 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'letter))
775 :active (boundp 'ps-paper-type)]
777 (customize-set-variable 'ps-paper-type 'letter-small)
779 :selected (and (boundp 'ps-paper-type)
780 (eq ps-paper-type 'letter-small))
781 :active (boundp 'ps-paper-type)]
783 (customize-set-variable 'ps-paper-type 'legal)
785 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'legal))
786 :active (boundp 'ps-paper-type)]
788 (customize-set-variable 'ps-paper-type 'statement)
790 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'statement))
791 :active (boundp 'ps-paper-type)]
793 (customize-set-variable 'ps-paper-type 'executive)
795 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'executive))
796 :active (boundp 'ps-paper-type)]
798 (customize-set-variable 'ps-paper-type 'tabloid)
800 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'tabloid))
801 :active (boundp 'ps-paper-type)]
803 (customize-set-variable 'ps-paper-type 'ledger)
805 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'ledger))
806 :active (boundp 'ps-paper-type)]
808 (customize-set-variable 'ps-paper-type 'a3)
810 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a3))
811 :active (boundp 'ps-paper-type)]
813 (customize-set-variable 'ps-paper-type 'a4)
815 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4))
816 :active (boundp 'ps-paper-type)]
818 (customize-set-variable 'ps-paper-type 'a4small)
820 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'a4small))
821 :active (boundp 'ps-paper-type)]
823 (customize-set-variable 'ps-paper-type 'b4)
825 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b4))
826 :active (boundp 'ps-paper-type)]
828 (customize-set-variable 'ps-paper-type 'b5)
830 :selected (and (boundp 'ps-paper-type) (eq ps-paper-type 'b5))
831 :active (boundp 'ps-paper-type)]
834 (cond (ps-print-color-p
835 (customize-set-variable 'ps-print-color-p nil)
836 ;; I'm wondering whether all this muck is useful.
837 (and (boundp 'original-face-background)
838 original-face-background
839 (set-face-background 'default original-face-background)))
841 (customize-set-variable 'ps-print-color-p t)
842 (setq original-face-background
843 (face-background-instance 'default))
844 (set-face-background 'default "white")))
846 :selected (and (boundp 'ps-print-color-p) ps-print-color-p)
847 :active (boundp 'ps-print-color-p)])
849 ("%_Compose Mail With"
850 ["Default Emacs Mailer"
851 (customize-set-variable 'mail-user-agent 'sendmail-user-agent)
853 :selected (eq mail-user-agent 'sendmail-user-agent)]
855 (customize-set-variable 'mail-user-agent 'mh-e-user-agent)
857 :selected (eq mail-user-agent 'mh-e-user-agent)
858 :active (get 'mh-e-user-agent 'composefunc)]
860 (customize-set-variable 'mail-user-agent 'message-user-agent)
862 :selected (eq mail-user-agent 'message-user-agent)
863 :active (get 'message-user-agent 'composefunc)]
865 ["Set My %_Email Address..."
866 (customize-set-variable
868 (read-string "Set email address: " user-mail-address))]
869 ["Set %_Machine Email Name..."
870 (customize-set-variable
872 (read-string "Set machine email name: " mail-host-address))]
873 ["Set %_SMTP Server..."
876 (customize-set-variable
877 'smtpmail-smtp-server
878 (read-string "Set SMTP server: " smtpmail-smtp-server)))
879 :active (and (boundp 'send-mail-function)
880 (eq send-mail-function 'smtpmail-send-it))]
884 (customize-set-variable 'smtpmail-debug-info
885 (not smtpmail-debug-info)))
887 :selected (and (boundp 'smtpmail-debug-info) smtpmail-debug-info)
888 :active (and (boundp 'send-mail-function)
889 (eq send-mail-function 'smtpmail-send-it))]
893 (customize-set-variable 'browse-url-browser-function 'browse-url-w3)
895 :selected (and (boundp 'browse-url-browser-function)
896 (eq browse-url-browser-function 'browse-url-w3))
897 :active (and (boundp 'browse-url-browser-function)
898 (fboundp 'browse-url-w3)
899 (fboundp 'w3-fetch))]
900 ["Emacs-%_W3 (gnudoit)"
901 (customize-set-variable 'browse-url-browser-function 'browse-url-w3-gnudoit)
903 :selected (and (boundp 'browse-url-browser-function)
904 (eq browse-url-browser-function
905 'browse-url-w3-gnudoit))
906 :active (and (boundp 'browse-url-browser-function)
907 (fboundp 'browse-url-w3-gnudoit))]
909 (customize-set-variable 'browse-url-browser-function
910 'browse-url-netscape)
912 :selected (and (boundp 'browse-url-browser-function)
913 (eq browse-url-browser-function 'browse-url-netscape))
914 :active (and (boundp 'browse-url-browser-function)
915 (fboundp 'browse-url-netscape))]
917 (customize-set-variable 'browse-url-browser-function
920 :selected (and (boundp 'browse-url-browser-function)
921 (eq browse-url-browser-function 'browse-url-mosaic))
922 :active (and (boundp 'browse-url-browser-function)
923 (fboundp 'browse-url-mosaic))]
925 (customize-set-variable 'browse-url-browser-function 'browse-url-cci)
927 :selected (and (boundp 'browse-url-browser-function)
928 (eq browse-url-browser-function 'browse-url-cci))
929 :active (and (boundp 'browse-url-browser-function)
930 (fboundp 'browse-url-cci))]
932 (customize-set-variable 'browse-url-browser-function
933 'browse-url-iximosaic)
935 :selected (and (boundp 'browse-url-browser-function)
936 (eq browse-url-browser-function 'browse-url-iximosaic))
937 :active (and (boundp 'browse-url-browser-function)
938 (fboundp 'browse-url-iximosaic))]
940 (customize-set-variable 'browse-url-browser-function
941 'browse-url-lynx-xterm)
943 :selected (and (boundp 'browse-url-browser-function)
944 (eq browse-url-browser-function 'browse-url-lynx-xterm))
945 :active (and (boundp 'browse-url-browser-function)
946 (fboundp 'browse-url-lynx-xterm))]
948 (customize-set-variable 'browse-url-browser-function
949 'browse-url-lynx-emacs)
951 :selected (and (boundp 'browse-url-browser-function)
952 (eq browse-url-browser-function 'browse-url-lynx-emacs))
953 :active (and (boundp 'browse-url-browser-function)
954 (fboundp 'browse-url-lynx-emacs))]
956 (customize-set-variable 'browse-url-browser-function
959 :selected (and (boundp 'browse-url-browser-function)
960 (eq browse-url-browser-function 'browse-url-grail))
961 :active (and (boundp 'browse-url-browser-function)
962 (fboundp 'browse-url-grail))]
964 (customize-set-variable 'browse-url-browser-function
967 :selected (and (boundp 'browse-url-browser-function)
968 (eq browse-url-browser-function 'browse-url-kde))
969 :active (and (boundp 'browse-url-browser-function)
970 (fboundp 'browse-url-kde))]
972 (customize-set-variable 'browse-url-browser-function
975 :selected (and (boundp 'browse-url-browser-function)
976 (eq browse-url-browser-function 'browse-url-mozilla))
977 :active (and (boundp 'browse-url-browser-function)
978 (fboundp 'browse-url-mozilla))]
980 (customize-set-variable 'browse-url-browser-function
983 :selected (and (boundp 'browse-url-browser-function)
984 (eq browse-url-browser-function 'browse-url-galeon))
985 :active (and (boundp 'browse-url-browser-function)
986 (fboundp 'browse-url-galeon))]
988 (customize-set-variable 'browse-url-browser-function
991 :selected (and (boundp 'browse-url-browser-function)
992 (eq browse-url-browser-function 'browse-url-opera))
993 :active (and (boundp 'browse-url-browser-function)
994 (fboundp 'browse-url-opera))]
996 (customize-set-variable 'browse-url-browser-function
999 :selected (and (boundp 'browse-url-browser-function)
1000 (eq browse-url-browser-function 'browse-url-mmm))
1001 :active (and (boundp 'browse-url-browser-function)
1002 (fboundp 'browse-url-mmm))]
1003 ["MS-Windows Default %_Browser"
1004 (customize-set-variable 'browse-url-browser-function
1005 'browse-url-default-windows-browser)
1007 :selected (and (boundp 'browse-url-browser-function)
1008 (eq browse-url-browser-function
1009 'browse-url-default-windows-browser))
1010 :active (and (boundp 'browse-url-browser-function)
1011 (fboundp 'mswindows-shell-execute)
1012 (fboundp 'browse-url-default-windows-browser))]
1013 ["G%_eneric Browser"
1014 (customize-set-variable 'browse-url-browser-function
1015 'browse-url-generic)
1017 :selected (and (boundp 'browse-url-browser-function)
1018 (eq browse-url-browser-function 'browse-url-generic))
1019 :active (and (boundp 'browse-url-browser-function)
1020 (boundp 'browse-url-generic-program)
1021 browse-url-generic-program
1022 (fboundp 'browse-url-generic))]
1024 ("%_Troubleshooting"
1026 (customize-set-variable 'debug-on-error (not debug-on-error))
1027 :style toggle :selected debug-on-error]
1029 (customize-set-variable 'debug-on-quit (not debug-on-quit))
1030 :style toggle :selected debug-on-quit]
1031 ["Debug on S%_ignal"
1032 (customize-set-variable 'debug-on-signal (not debug-on-signal))
1033 :style toggle :selected debug-on-signal]
1034 ["%_Stack Trace on Error"
1035 (customize-set-variable 'stack-trace-on-error
1036 (not stack-trace-on-error))
1037 :style toggle :selected stack-trace-on-error]
1038 ["Stack Trace on Si%_gnal"
1039 (customize-set-variable 'stack-trace-on-signal
1040 (not stack-trace-on-signal))
1041 :style toggle :selected stack-trace-on-signal]
1045 ,@(if (featurep 'scrollbar)
1047 (customize-set-variable 'scrollbars-visible-p
1048 (not scrollbars-visible-p))
1050 :selected scrollbars-visible-p]))
1051 ["%_Wrap Long Lines"
1052 (progn;; becomes buffer-local
1053 (setq truncate-lines (not truncate-lines))
1054 (customize-set-variable 'truncate-lines truncate-lines))
1056 :selected (not truncate-lines)]
1059 (customize-set-variable 'modeline-3d-p
1060 (not modeline-3d-p))
1062 :selected modeline-3d-p]
1063 ("Modeline %_Horizontal Scrolling"
1065 (customize-set-variable 'modeline-scrolling-method nil)
1067 :selected (not modeline-scrolling-method)]
1069 (customize-set-variable 'modeline-scrolling-method t)
1071 :selected (eq modeline-scrolling-method t)]
1073 (customize-set-variable 'modeline-scrolling-method 'scrollbar)
1075 :selected (eq modeline-scrolling-method 'scrollbar)]
1077 ,@(if (featurep 'toolbar)
1079 ["%_Toolbars Visible"
1080 (customize-set-variable 'toolbar-visible-p
1081 (not toolbar-visible-p))
1083 :selected toolbar-visible-p]
1084 ["Toolbars Ca%_ptioned"
1085 (customize-set-variable 'toolbar-captioned-p
1086 (not toolbar-captioned-p))
1088 :active toolbar-visible-p
1089 :selected toolbar-captioned-p]
1090 ("Default Toolba%_r Location"
1092 (customize-set-variable 'default-toolbar-position 'top)
1094 :active toolbar-visible-p
1095 :selected (eq default-toolbar-position 'top)]
1097 (customize-set-variable 'default-toolbar-position 'bottom)
1099 :active toolbar-visible-p
1100 :selected (eq default-toolbar-position 'bottom)]
1102 (customize-set-variable 'default-toolbar-position 'left)
1104 :active toolbar-visible-p
1105 :selected (eq default-toolbar-position 'left)]
1107 (customize-set-variable 'default-toolbar-position 'right)
1109 :active toolbar-visible-p
1110 :selected (eq default-toolbar-position 'right)]
1113 ,@(if (featurep 'gutter)
1115 ["B%_uffers Tab Visible"
1116 (customize-set-variable 'gutter-buffers-tab-visible-p
1117 (not gutter-buffers-tab-visible-p))
1119 :selected gutter-buffers-tab-visible-p]
1120 ("Default %_Gutter Location"
1122 (customize-set-variable 'default-gutter-position 'top)
1124 :selected (eq default-gutter-position 'top)]
1126 (customize-set-variable 'default-gutter-position 'bottom)
1128 :selected (eq default-gutter-position 'bottom)]
1130 (customize-set-variable 'default-gutter-position 'left)
1132 :selected (eq default-gutter-position 'left)]
1134 (customize-set-variable 'default-gutter-position 'right)
1136 :selected (eq default-gutter-position 'right)]
1140 ["%_Blinking Cursor"
1141 (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode))
1143 :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)
1144 :active (boundp 'blink-cursor-mode)]
1147 (customize-set-variable 'bar-cursor nil)
1148 (force-cursor-redisplay))
1150 :selected (null bar-cursor)]
1151 ["Bar Cursor (%_1 Pixel)"
1153 (customize-set-variable 'bar-cursor t)
1154 (force-cursor-redisplay))
1156 :selected (eq bar-cursor t)]
1157 ["Bar Cursor (%_2 Pixels)"
1159 (customize-set-variable 'bar-cursor 2)
1160 (force-cursor-redisplay))
1162 :selected (and bar-cursor (not (eq bar-cursor t)))]
1164 ("Pa%_ren Highlighting"
1166 (customize-set-variable 'paren-mode nil)
1168 :selected (and (boundp 'paren-mode) (not paren-mode))
1169 :active (boundp 'paren-mode)]
1171 (customize-set-variable 'paren-mode 'blink-paren)
1173 :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren))
1174 :active (boundp 'paren-mode)]
1176 (customize-set-variable 'paren-mode 'paren)
1178 :selected (and (boundp 'paren-mode) (eq paren-mode 'paren))
1179 :active (boundp 'paren-mode)]
1181 (customize-set-variable 'paren-mode 'sexp)
1183 :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp))
1184 :active (boundp 'paren-mode)]
1185 ;; ["Nes%_ted Shading"
1186 ;; (customize-set-variable 'paren-mode 'nested)
1188 ;; :selected (and (boundp 'paren-mode) (eq paren-mode 'nested))
1189 ;; :active (boundp 'paren-mode)]
1194 (customize-set-variable 'line-number-mode (not line-number-mode))
1196 :style toggle :selected line-number-mode]
1199 (customize-set-variable 'column-number-mode
1200 (not column-number-mode))
1202 :style toggle :selected column-number-mode]
1204 ("\"Other %_Window\" Location"
1205 ["%_Always in Same Frame"
1206 (customize-set-variable
1207 'get-frame-for-buffer-default-instance-limit nil)
1209 :selected (null get-frame-for-buffer-default-instance-limit)]
1210 ["Other Frame (%_2 Frames Max)"
1211 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
1214 :selected (eq 2 get-frame-for-buffer-default-instance-limit)]
1215 ["Other Frame (%_3 Frames Max)"
1216 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
1219 :selected (eq 3 get-frame-for-buffer-default-instance-limit)]
1220 ["Other Frame (%_4 Frames Max)"
1221 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
1224 :selected (eq 4 get-frame-for-buffer-default-instance-limit)]
1225 ["Other Frame (%_5 Frames Max)"
1226 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
1229 :selected (eq 5 get-frame-for-buffer-default-instance-limit)]
1230 ["Always Create %_New Frame"
1231 (customize-set-variable 'get-frame-for-buffer-default-instance-limit
1234 :selected (eq 0 get-frame-for-buffer-default-instance-limit)]
1236 ["%_Temp Buffers Always in Same Frame"
1237 (customize-set-variable 'temp-buffer-show-function
1238 'show-temp-buffer-in-current-frame)
1240 :selected (eq temp-buffer-show-function
1241 'show-temp-buffer-in-current-frame)]
1242 ["Temp Buffers %_Like Other Buffers"
1243 (customize-set-variable 'temp-buffer-show-function nil)
1245 :selected (null temp-buffer-show-function)]
1247 ["%_Make Current Frame Gnuserv Target"
1248 (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil
1251 :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t))
1252 :active (boundp 'gnuserv-frame)]
1256 ["%_Frame-Local Font Menu"
1257 (customize-set-variable 'font-menu-this-frame-only-p
1258 (not font-menu-this-frame-only-p))
1260 :selected (and (boundp 'font-menu-this-frame-only-p)
1261 font-menu-this-frame-only-p)]
1262 ["%_Alt/Meta Selects Menu Items"
1263 (if (eq menu-accelerator-enabled 'menu-force)
1264 (customize-set-variable 'menu-accelerator-enabled nil)
1265 (customize-set-variable 'menu-accelerator-enabled 'menu-force))
1267 :selected (eq menu-accelerator-enabled 'menu-force)]
1269 ["Buffers Menu %_Length..."
1270 (customize-set-variable
1271 'buffers-menu-max-size
1272 ;; would it be better to open a customization buffer ?
1275 "Enter number of buffers to display (or 0 for unlimited): ")))
1276 (if (eq val 0) nil val)))]
1277 ["%_Multi-Operation Buffers Sub-Menus"
1278 (customize-set-variable 'complex-buffers-menu-p
1279 (not complex-buffers-menu-p))
1281 :selected complex-buffers-menu-p]
1282 ["S%_ubmenus for Buffer Groups"
1283 (customize-set-variable 'buffers-menu-submenus-for-groups-p
1284 (not buffers-menu-submenus-for-groups-p))
1286 :selected buffers-menu-submenus-for-groups-p]
1287 ["%_Verbose Buffer Menu Entries"
1288 (if (eq buffers-menu-format-buffer-line-function
1289 'slow-format-buffers-menu-line)
1290 (customize-set-variable 'buffers-menu-format-buffer-line-function
1291 'format-buffers-menu-line)
1292 (customize-set-variable 'buffers-menu-format-buffer-line-function
1293 'slow-format-buffers-menu-line))
1295 :selected (eq buffers-menu-format-buffer-line-function
1296 'slow-format-buffers-menu-line)]
1297 ("Buffers Menu %_Sorting"
1298 ["%_Most Recently Used"
1300 (customize-set-variable 'buffers-menu-sort-function nil)
1301 (customize-set-variable 'buffers-menu-grouping-function nil))
1303 :selected (null buffers-menu-sort-function)]
1306 (customize-set-variable 'buffers-menu-sort-function
1307 'sort-buffers-menu-alphabetically)
1308 (customize-set-variable 'buffers-menu-grouping-function nil))
1310 :selected (eq 'sort-buffers-menu-alphabetically
1311 buffers-menu-sort-function)]
1312 ["%_By Major Mode, Then Alphabetically"
1314 (customize-set-variable
1315 'buffers-menu-sort-function
1316 'sort-buffers-menu-by-mode-then-alphabetically)
1317 (customize-set-variable
1318 'buffers-menu-grouping-function
1319 'group-buffers-menu-by-mode-then-alphabetically))
1321 :selected (eq 'sort-buffers-menu-by-mode-then-alphabetically
1322 buffers-menu-sort-function)])
1324 ["%_Ignore Scaled Fonts"
1325 (customize-set-variable 'font-menu-ignore-scaled-fonts
1326 (not font-menu-ignore-scaled-fonts))
1328 :selected (and (boundp 'font-menu-ignore-scaled-fonts)
1329 font-menu-ignore-scaled-fonts)]
1331 ("S%_yntax Highlighting"
1333 (progn;; becomes buffer local
1335 (customize-set-variable 'font-lock-mode font-lock-mode))
1337 :selected (and (boundp 'font-lock-mode) font-lock-mode)
1338 :active (boundp 'font-lock-mode)]
1340 (customize-set-variable 'font-lock-auto-fontify
1341 (not font-lock-auto-fontify))
1343 :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify)
1344 :active (fboundp 'font-lock-mode)]
1346 ["Force %_Rehighlight in this Buffer"
1347 (customize-set-variable 'font-lock-auto-fontify
1348 (not font-lock-auto-fontify))
1350 :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify)
1351 :active (fboundp 'font-lock-mode)]
1355 (require 'font-lock)
1356 (font-lock-use-default-fonts)
1357 (customize-set-variable 'font-lock-use-fonts t)
1358 (customize-set-variable 'font-lock-use-colors nil)
1361 :selected (and (boundp 'font-lock-use-fonts) font-lock-use-fonts)
1362 :active (fboundp 'font-lock-mode)]
1365 (require 'font-lock)
1366 (font-lock-use-default-colors)
1367 (customize-set-variable 'font-lock-use-colors t)
1368 (customize-set-variable 'font-lock-use-fonts nil)
1371 :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors)
1372 :active (boundp 'font-lock-mode)]
1376 (require 'font-lock)
1377 (if (or (and (not (integerp font-lock-maximum-decoration))
1378 (not (eq t font-lock-maximum-decoration)))
1379 (and (integerp font-lock-maximum-decoration)
1380 (<= font-lock-maximum-decoration 0)))
1382 (customize-set-variable 'font-lock-maximum-decoration nil)
1383 (font-lock-recompute-variables)))
1385 :active (fboundp 'font-lock-mode)
1386 :selected (and (boundp 'font-lock-maximum-decoration)
1387 (or (and (not (integerp font-lock-maximum-decoration))
1388 (not (eq t font-lock-maximum-decoration)))
1389 (and (integerp font-lock-maximum-decoration)
1390 (<= font-lock-maximum-decoration 0))))]
1393 (require 'font-lock)
1394 (if (and (integerp font-lock-maximum-decoration)
1395 (= 1 font-lock-maximum-decoration))
1397 (customize-set-variable 'font-lock-maximum-decoration 1)
1398 (font-lock-recompute-variables)))
1400 :active (fboundp 'font-lock-mode)
1401 :selected (and (boundp 'font-lock-maximum-decoration)
1402 (integerp font-lock-maximum-decoration)
1403 (= 1 font-lock-maximum-decoration))]
1406 (require 'font-lock)
1407 (if (and (integerp font-lock-maximum-decoration)
1408 (= 2 font-lock-maximum-decoration))
1410 (customize-set-variable 'font-lock-maximum-decoration 2)
1411 (font-lock-recompute-variables)))
1413 :active (fboundp 'font-lock-mode)
1414 :selected (and (boundp 'font-lock-maximum-decoration)
1415 (integerp font-lock-maximum-decoration)
1416 (= 2 font-lock-maximum-decoration))]
1419 (require 'font-lock)
1420 (if (or (eq font-lock-maximum-decoration t)
1421 (and (integerp font-lock-maximum-decoration)
1422 (>= font-lock-maximum-decoration 3)))
1424 (customize-set-variable 'font-lock-maximum-decoration t)
1425 (font-lock-recompute-variables)))
1427 :active (fboundp 'font-lock-mode)
1428 :selected (and (boundp 'font-lock-maximum-decoration)
1429 (or (eq font-lock-maximum-decoration t)
1430 (and (integerp font-lock-maximum-decoration)
1431 (>= font-lock-maximum-decoration 3))))]
1434 (progn;; becomes buffer local
1436 (customize-set-variable 'lazy-lock-mode lazy-lock-mode)
1437 ;; this shouldn't be necessary so there has to
1438 ;; be a redisplay bug lurking somewhere (or
1439 ;; possibly another event handler bug)
1441 :active (and (boundp 'font-lock-mode) (boundp 'lazy-lock-mode)
1444 :selected (and (boundp 'lazy-lock-mode) lazy-lock-mode)]
1446 (progn;; becomes buffer local
1448 (customize-set-variable 'lazy-shot-mode lazy-shot-mode)
1449 ;; this shouldn't be necessary so there has to
1450 ;; be a redisplay bug lurking somewhere (or
1451 ;; possibly another event handler bug)
1453 :active (and (boundp 'font-lock-mode) (boundp 'lazy-shot-mode)
1456 :selected (and (boundp 'lazy-shot-mode) lazy-shot-mode)]
1458 (progn;; becomes buffer local
1460 (customize-set-variable 'fast-lock-mode fast-lock-mode)
1461 ;; this shouldn't be necessary so there has to
1462 ;; be a redisplay bug lurking somewhere (or
1463 ;; possibly another event handler bug)
1465 :active (and (boundp 'font-lock-mode) (boundp 'fast-lock-mode)
1468 :selected (and (boundp 'fast-lock-mode) fast-lock-mode)]
1470 ("%_Font" :filter font-menu-family-constructor)
1471 ("Font Si%_ze" :filter font-menu-size-constructor)
1472 ;; ("Font Weig%_ht" :filter font-menu-weight-constructor)
1473 ["Edit Fa%_ces..." (customize-face nil)]
1476 ;; #### there should be something that holds the name that the init
1477 ;; file should be created as, when it's not present.
1478 (progn (find-file (or user-init-file "~/.xemacs/init.el"))
1479 (or (eq major-mode 'emacs-lisp-mode)
1480 (emacs-lisp-mode)))]
1481 ["%_Save Options to Init File" customize-save-customized]
1485 :filter buffers-menu-filter
1486 ["Go To %_Previous Buffer" switch-to-other-buffer]
1487 ["Go To %_Buffer..." switch-to-buffer]
1489 ["%_List All Buffers" list-buffers]
1490 ["%_Delete Buffer" kill-this-buffer
1491 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
1495 nil ; the partition: menus after this are flushright
1498 ["%_About XEmacs..." about-xemacs]
1500 ["What's %_New in XEmacs" view-emacs-news]
1501 ["%_Obtaining XEmacs" describe-distribution]
1503 ("%_Info (Online Docs)"
1504 ["%_Info Contents" info]
1505 ["Lookup %_Key Binding..." Info-goto-emacs-key-command-node]
1506 ["Lookup %_Command..." Info-goto-emacs-command-node]
1507 ["Lookup %_Function..." Info-elisp-ref]
1508 ["Lookup %_Topic..." Info-query])
1510 ["%_FAQ (local)" xemacs-local-faq]
1511 ["FAQ via %_WWW" xemacs-www-faq
1512 :active (fboundp 'browse-url)]
1513 ["%_Home Page" xemacs-www-page
1514 :active (fboundp 'browse-url)])
1516 :filter tutorials-menu-filter)
1519 (find-file (locate-data-file "sample.init.el"))
1520 :active (locate-data-file "sample.init.el")]
1522 (find-file (locate-data-file "sample.gtkrc"))
1523 :included (featurep 'gtk)
1524 :active (locate-data-file "sample.gtkrc")]
1525 ["Sample .%_Xdefaults"
1526 (find-file (locate-data-file "sample.Xdefaults"))
1527 :included (featurep 'x)
1528 :active (locate-data-file "sample.Xdefaults")]
1529 ["Sample %_enriched"
1530 (find-file (locate-data-file "enriched.doc"))
1531 :active (locate-data-file "enriched.doc")])
1532 ("%_Commands & Keys"
1533 ["%_Mode" describe-mode]
1534 ["%_Apropos..." hyper-apropos]
1535 ["Apropos %_Docs..." apropos-documentation]
1537 ["%_Key..." describe-key]
1538 ["%_Bindings" describe-bindings]
1539 ["%_Mouse Bindings" describe-pointer]
1540 ["%_Recent Keys" view-lossage]
1542 ["%_Function..." describe-function]
1543 ["%_Variable..." describe-variable]
1544 ["%_Locate Command..." where-is])
1546 ["%_Recent Messages" view-lossage]
1548 ["%_Current Installation Info" describe-installation
1549 :active (boundp 'Installation-string)]
1550 ["%_No Warranty" describe-no-warranty]
1551 ["XEmacs %_License" describe-copying]
1552 ["Find %_Packages" finder-by-keyword]
1553 ["View %_Splash Screen" xemacs-splash-buffer]
1554 ["%_Unix Manual..." manual-entry])
1555 ["Send %_Bug Report..." report-xemacs-bug
1556 :active (fboundp 'report-xemacs-bug)])))
1559 (defun maybe-add-init-button ()
1561 Adds `Load .emacs' button to menubar when starting up with -q."
1562 (when (and (not load-user-init-file-p)
1563 (file-exists-p (expand-file-name ".emacs" "~")))
1568 (mapc #'(lambda (buf)
1569 (with-current-buffer buf
1570 (delete-menu-item '("Load .emacs"))))
1572 (load-user-init-file))
1576 (add-hook 'before-init-hook 'maybe-add-init-button)
1581 (defvar put-buffer-names-in-file-menu t)
1584 ;;; The Bookmarks menu
1586 (defun bookmark-menu-filter (&rest ignore)
1587 (declare (special bookmark-alist))
1588 (let ((definedp (and (boundp 'bookmark-alist)
1592 '("%_Jump to Bookmark"
1593 :filter (lambda (&rest junk)
1594 (submenu-generate-accelerator-spec
1595 (mapcar #'(lambda (bmk)
1596 `[,bmk (bookmark-jump ',bmk)])
1597 (bookmark-all-names)))))
1598 ["%_Jump to Bookmark" nil nil])
1599 ["Set %_Bookmark" bookmark-set
1600 :active (fboundp 'bookmark-set)]
1602 ["Insert %_Contents" bookmark-menu-insert
1603 :active (fboundp 'bookmark-menu-insert)]
1604 ["Insert L%_ocation" bookmark-menu-locate
1605 :active (fboundp 'bookmark-menu-locate)]
1607 ["%_Rename Bookmark" bookmark-menu-rename
1608 :active (fboundp 'bookmark-menu-rename)]
1610 '("%_Delete Bookmark"
1611 :filter (lambda (&rest junk)
1612 (submenu-generate-accelerator-spec
1613 (mapcar #'(lambda (bmk)
1614 `[,bmk (bookmark-delete ',bmk)])
1615 (bookmark-all-names)))))
1616 ["%_Delete Bookmark" nil nil])
1617 ["%_Edit Bookmark List" bookmark-bmenu-list ,definedp]
1619 ["%_Save Bookmarks" bookmark-save ,definedp]
1620 ["Save Bookmarks %_As..." bookmark-write ,definedp]
1621 ["%_Load a Bookmark File" bookmark-load
1622 :active (fboundp 'bookmark-load)])))
1624 ;;; The Buffers menu
1626 (defgroup buffers-menu nil
1627 "Customization of `Buffers' menu."
1630 (defvar buffers-menu-omit-chars-list '(?b ?p ?l ?d))
1632 (defcustom buffers-menu-max-size 25
1633 "*Maximum number of entries which may appear on the \"Buffers\" menu.
1634 If this is 10, then only the ten most-recently-selected buffers will be
1635 shown. If this is nil, then all buffers will be shown. Setting this to
1636 a large number or nil will slow down menu responsiveness."
1637 :type '(choice (const :tag "Show all" nil)
1639 :group 'buffers-menu)
1641 (defcustom complex-buffers-menu-p nil
1642 "*If non-nil, the buffers menu will contain several commands.
1643 Commands will be presented as submenus of each buffer line. If this
1644 is false, then there will be only one command: select that buffer."
1646 :group 'buffers-menu)
1648 (defcustom buffers-menu-submenus-for-groups-p nil
1649 "*If non-nil, the buffers menu will contain one submenu per group of buffers.
1650 The grouping function is specified in `buffers-menu-grouping-function'.
1651 If this is an integer, do not build submenus if the number of buffers
1652 is not larger than this value."
1653 :type '(choice (const :tag "No Subgroups" nil)
1654 (integer :tag "Max. submenus" 10)
1655 (sexp :format "%t\n" :tag "Allow Subgroups" :value t))
1656 :group 'buffers-menu)
1658 (defcustom buffers-menu-switch-to-buffer-function 'switch-to-buffer
1659 "*The function to call to select a buffer from the buffers menu.
1660 `switch-to-buffer' is a good choice, as is `pop-to-buffer'."
1661 :type '(radio (function-item switch-to-buffer)
1662 (function-item pop-to-buffer)
1663 (function :tag "Other"))
1664 :group 'buffers-menu)
1666 (defcustom buffers-menu-omit-function 'buffers-menu-omit-invisible-buffers
1667 "*If non-nil, a function specifying the buffers to omit from the buffers menu.
1668 This is passed a buffer and should return non-nil if the buffer should be
1669 omitted. The default value `buffers-menu-omit-invisible-buffers' omits
1670 buffers that are normally considered \"invisible\" (those whose name
1671 begins with a space)."
1672 :type '(choice (const :tag "None" nil)
1674 :group 'buffers-menu)
1676 (defcustom buffers-menu-format-buffer-line-function 'format-buffers-menu-line
1677 "*The function to call to return a string to represent a buffer in
1678 the buffers menu. The function is passed a buffer and a number
1679 (starting with 1) indicating which buffer line in the menu is being
1680 processed and should return a string containing an accelerator
1681 spec. (Check out `menu-item-generate-accelerator-spec' as a convenient
1682 way of generating the accelerator specs.) The default value
1683 `format-buffers-menu-line' just returns the name of the buffer and
1684 uses the number as the accelerator. Also check out
1685 `slow-format-buffers-menu-line' which returns a whole bunch of info
1688 Note: Gross Compatibility Hack: Older versions of this function prototype
1689 only expected one argument, not two. We deal gracefully with such
1690 functions by simply calling them with one argument and leaving out the
1691 line number. However, this may go away at any time, so make sure to
1692 update all of your functions of this type."
1694 :group 'buffers-menu)
1696 (defcustom buffers-menu-sort-function
1697 'sort-buffers-menu-by-mode-then-alphabetically
1698 "*If non-nil, a function to sort the list of buffers in the buffers menu.
1699 It will be passed two arguments (two buffers to compare) and should return
1700 t if the first is \"less\" than the second. One possible value is
1701 `sort-buffers-menu-alphabetically'; another is
1702 `sort-buffers-menu-by-mode-then-alphabetically'."
1703 :type '(choice (const :tag "None" nil)
1705 :group 'buffers-menu)
1707 (defcustom buffers-menu-grouping-function
1708 'group-buffers-menu-by-mode-then-alphabetically
1709 "*If non-nil, a function to group buffers in the buffers menu together.
1710 It will be passed two arguments, successive members of the sorted buffers
1711 list after being passed through `buffers-menu-sort-function'. It should
1712 return non-nil if the second buffer begins a new group. The return value
1713 should be the name of the old group, which may be used in hierarchical
1714 buffers menus. The last invocation of the function contains nil as the
1715 second argument, so that the name of the last group can be determined.
1717 The sensible values of this function are dependent on the value specified
1718 for `buffers-menu-sort-function'."
1719 :type '(choice (const :tag "None" nil)
1721 :group 'buffers-menu)
1723 (defun sort-buffers-menu-alphabetically (buf1 buf2)
1724 "For use as a value of `buffers-menu-sort-function'.
1725 Sorts the buffers in alphabetical order by name, but puts buffers beginning
1726 with a star at the end of the list."
1727 (let* ((nam1 (buffer-name buf1))
1728 (nam2 (buffer-name buf2))
1729 (inv1p (not (null (string-match "\\` " nam1))))
1730 (inv2p (not (null (string-match "\\` " nam2))))
1731 (star1p (not (null (string-match "\\`*" nam1))))
1732 (star2p (not (null (string-match "\\`*" nam2)))))
1733 (cond ((not (eq inv1p inv2p))
1735 ((not (eq star1p star2p))
1738 (string-lessp nam1 nam2)))))
1740 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
1741 "For use as a value of `buffers-menu-sort-function'.
1742 Sorts first by major mode and then alphabetically by name, but puts buffers
1743 beginning with a star at the end of the list."
1744 (let* ((nam1 (buffer-name buf1))
1745 (nam2 (buffer-name buf2))
1746 (inv1p (not (null (string-match "\\` " nam1))))
1747 (inv2p (not (null (string-match "\\` " nam2))))
1748 (star1p (not (null (string-match "\\`*" nam1))))
1749 (star2p (not (null (string-match "\\`*" nam2))))
1750 (mode1 (symbol-value-in-buffer 'major-mode buf1))
1751 (mode2 (symbol-value-in-buffer 'major-mode buf2)))
1752 (cond ((not (eq inv1p inv2p))
1754 ((not (eq star1p star2p))
1756 ((and star1p star2p (string-lessp nam1 nam2)))
1757 ((string-lessp mode1 mode2)
1759 ((string-lessp mode2 mode1)
1762 (string-lessp nam1 nam2)))))
1764 ;; this version is too slow on some machines.
1765 ;; (vintage 1990, that is)
1766 (defun slow-format-buffers-menu-line (buffer n)
1767 "For use as a value of `buffers-menu-format-buffer-line-function'.
1768 This returns a string containing a bunch of info about the buffer."
1769 (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list)
1770 (format "%s%s %-19s %6s %-15s %s"
1771 (if (buffer-modified-p buffer) "*" " ")
1772 (if (symbol-value-in-buffer 'buffer-read-only buffer)
1774 (buffer-name buffer)
1775 (buffer-size buffer)
1776 (symbol-value-in-buffer 'mode-name buffer)
1777 (or (buffer-file-name buffer) ""))))
1779 (defun format-buffers-menu-line (buffer n)
1780 "For use as a value of `buffers-menu-format-buffer-line-function'.
1781 This just returns the buffer's name."
1782 (concat (menu-item-generate-accelerator-spec n buffers-menu-omit-chars-list)
1783 (buffer-name buffer)))
1785 (defun group-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
1786 "For use as a value of `buffers-menu-grouping-function'.
1787 This groups buffers by major mode. It only really makes sense if
1788 `buffers-menu-sorting-function' is
1789 `sort-buffers-menu-by-mode-then-alphabetically'."
1790 (cond ((string-match "\\`*" (buffer-name buf1))
1791 (and (null buf2) "*Misc*"))
1793 (string-match "\\`*" (buffer-name buf2))
1794 (not (eq (symbol-value-in-buffer 'major-mode buf1)
1795 (symbol-value-in-buffer 'major-mode buf2))))
1796 (symbol-value-in-buffer 'mode-name buf1))
1799 (defun buffer-menu-save-buffer (buffer)
1804 (defun buffer-menu-write-file (buffer)
1807 (write-file (read-file-name
1808 (format "Write %s to file: "
1809 (buffer-name (current-buffer)))))))
1811 (defsubst build-buffers-menu-internal (buffers)
1812 (let (name line (n 0))
1819 ; #### a truly Kyle-friendly hack.
1820 (let ((fn buffers-menu-format-buffer-line-function))
1821 (if (= (function-max-args fn) 1)
1823 (funcall fn buffer n))))
1824 (if complex-buffers-menu-p
1827 (vector "S%_witch to Buffer"
1828 (list buffers-menu-switch-to-buffer-function
1829 (setq name (buffer-name buffer)))
1831 (if (eq buffers-menu-switch-to-buffer-function
1833 (vector "Switch to Buffer, Other %_Frame"
1834 (list 'switch-to-buffer-other-frame
1835 (setq name (buffer-name buffer)))
1838 (if (and (buffer-modified-p buffer)
1839 (buffer-file-name buffer))
1840 (vector "%_Save Buffer"
1841 (list 'buffer-menu-save-buffer name) t)
1842 ["%_Save Buffer" nil nil]
1844 (vector "Save %_As..."
1845 (list 'buffer-menu-write-file name) t)
1846 (vector "%_Delete Buffer" (list 'kill-buffer name)
1848 ;; #### We don't want buffer names to be translated,
1849 ;; #### so we put the buffer name in the suffix.
1850 ;; #### Also, avoid losing with non-ASCII buffer names.
1851 ;; #### We still lose, however, if complex-buffers-menu-p. --mrb
1853 (list buffers-menu-switch-to-buffer-function
1854 (buffer-name buffer))
1858 (defun buffers-menu-filter (menu)
1859 "This is the menu filter for the top-level buffers \"Buffers\" menu.
1860 It dynamically creates a list of buffers to use as the contents of the menu.
1861 Only the most-recently-used few buffers will be listed on the menu, for
1862 efficiency reasons. You can control how many buffers will be shown by
1863 setting `buffers-menu-max-size'. You can control the text of the menu
1864 items by redefining the function `format-buffers-menu-line'."
1865 (let ((buffers (delete-if buffers-menu-omit-function (buffer-list))))
1866 (and (integerp buffers-menu-max-size)
1867 (> buffers-menu-max-size 1)
1868 (> (length buffers) buffers-menu-max-size)
1869 ;; shorten list of buffers (not with submenus!)
1870 (not (and buffers-menu-grouping-function
1871 buffers-menu-submenus-for-groups-p))
1872 (setcdr (nthcdr buffers-menu-max-size buffers) nil))
1873 (if buffers-menu-sort-function
1874 (setq buffers (sort buffers buffers-menu-sort-function)))
1875 (if (and buffers-menu-grouping-function
1876 buffers-menu-submenus-for-groups-p
1877 (or (not (integerp buffers-menu-submenus-for-groups-p))
1878 (> (length buffers) buffers-menu-submenus-for-groups-p)))
1879 (let (groups groupnames current-group)
1882 (let ((groupname (funcall buffers-menu-grouping-function
1883 (car sublist) (cadr sublist))))
1884 (setq current-group (cons (car sublist) current-group))
1887 (setq groups (cons (nreverse current-group)
1889 (setq groupnames (cons groupname groupnames))
1890 (setq current-group nil)))))
1894 #'(lambda (groupname group)
1895 (cons groupname (build-buffers-menu-internal group)))
1896 (nreverse groupnames)
1897 (nreverse groups))))
1898 (if buffers-menu-grouping-function
1903 (cond ((funcall buffers-menu-grouping-function
1904 (car sublist) (cadr sublist))
1905 (list (car sublist) t))
1906 (t (list (car sublist)))))
1908 ;; remove a trailing separator.
1909 (and (>= (length buffers) 2)
1910 (let ((lastcdr (nthcdr (- (length buffers) 2) buffers)))
1911 (if (eq t (cadr lastcdr))
1912 (setcdr lastcdr nil))))))
1913 (setq buffers (build-buffers-menu-internal buffers)))
1914 (append menu buffers)
1917 (defun language-environment-menu-filter (menu)
1918 "This is the menu filter for the \"Language Environment\" submenu."
1919 (declare (special language-environment-list))
1921 (mapcar (lambda (env-sym)
1923 `[ ,(concat (menu-item-generate-accelerator-spec n)
1924 (capitalize (symbol-name env-sym)))
1925 (set-language-environment ',env-sym)])
1926 language-environment-list)))
1929 ;;; The Options menu
1931 ;; We'll keep those variables here for a while, in order to provide a
1932 ;; function for porting the old options file that a user may own to Custom.
1934 (defvar options-save-faces nil
1935 "*Non-nil value means save-options will save information about faces.
1936 A nil value means save-options will not save face information.
1937 Set this non-nil only if you use M-x edit-faces to change face
1938 settings. If you use M-x customize-face or the \"Browse Faces...\"
1939 menu entry, you will see a button in the Customize Face buffer that you
1940 can use to permanently save your face changes.
1942 M-x edit-faces is deprecated. Support for it and this variable will
1943 be discontinued in a future release.")
1945 (defvar save-options-init-file nil
1946 "File into which to save forms to load the options file (nil for .emacs).
1947 Normally this is nil, which means save into your .emacs file (the value
1948 of `user-init-file'.")
1950 (defvar save-options-file ".xemacs-options"
1951 "File to save options into.
1952 This file is loaded from your .emacs file.
1953 If this is a relative filename, it is put into the same directory as your
1960 (defun tutorials-menu-filter (menu-items)
1961 (declare (special language-info-alist
1962 current-language-environment
1963 tutorial-supported-languages))
1965 (if (featurep 'mule)
1967 (assoc current-language-environment language-info-alist))
1968 `([,(concat "%_Default (" current-language-environment ")")
1969 help-with-tutorial]))
1970 '(["%_English" help-with-tutorial]))
1971 (submenu-generate-accelerator-spec
1972 (if (featurep 'mule)
1974 (mapcan #'(lambda (lang)
1975 (let ((tut (assq 'tutorial lang)))
1977 (not (string= (car lang) "ASCII"))
1978 ;; skip current language, since we already
1979 ;; included it first
1980 (not (string= (car lang)
1981 current-language-environment))
1983 (help-with-tutorial nil ,(cdr tut))]))))
1984 language-info-alist)
1985 ;; Non mule tutorials.
1986 (mapcar #'(lambda (lang)
1988 (help-with-tutorial ,(format "TUTORIAL.%s"
1990 tutorial-supported-languages)))))
1992 (set-menubar default-menubar)
1997 (defconst default-popup-menu
1999 ["%_Undo" advertised-undo
2000 :active (and (not (eq buffer-undo-list t))
2001 (or buffer-undo-list pending-undo-list))
2002 :suffix (if (or (eq last-command 'undo)
2003 (eq last-command 'advertised-undo))
2005 ["Cu%_t" kill-primary-selection
2006 :active (selection-owner-p)]
2007 ["%_Copy" copy-primary-selection
2008 :active (selection-owner-p)]
2009 ["%_Paste" yank-clipboard-selection
2010 :active (selection-exists-p 'CLIPBOARD)]
2011 ["%_Delete" delete-primary-selection
2012 :active (selection-owner-p)]
2014 ["Select %_Block" mark-paragraph]
2015 ["Sp%_lit Window" split-window-vertically]
2016 ["U%_nsplit Window" delete-other-windows]
2019 ;; In an effort to avoid massive menu clutter, this mostly worthless menu is
2020 ;; superseded by any local popup menu...
2021 (setq-default mode-popup-menu default-popup-menu)
2026 (defun xemacs-splash-buffer ()
2027 "Redisplay XEmacs splash screen in a buffer."
2029 (let ((buffer (get-buffer-create "*Splash*"))
2032 (setq buffer-read-only t)
2033 (erase-buffer buffer)
2034 (setq tmout (display-splash-frame))
2036 (make-local-hook 'kill-buffer-hook)
2037 (add-hook 'kill-buffer-hook
2039 (disable-timeout ,tmout))
2041 (pop-to-buffer buffer)
2042 (delete-other-windows)))
2045 ;;; backwards compatibility
2046 (provide 'x-menubar)
2047 (provide 'menubar-items)
2049 ;;; menubar-items.el ends here.