;;; menu-bar.el --- define a default menu bar
;; Copyright (C) 1993, 1994, 1995, 2000, 2001, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006, 2007 Free Software Foundation, Inc.
;; Author: RMS
;; Maintainer: FSF
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
(defvar menu-bar-tools-menu (make-sparse-keymap "Tools"))
(define-key global-map [menu-bar tools] (cons "Tools" menu-bar-tools-menu))
;; This definition is just to show what this looks like.
-;; It gets overridden below when menu-bar-update-buffers is called.
+;; It gets modified in place when menu-bar-update-buffers is called.
+(defvar global-buffers-menu-map (make-sparse-keymap "Buffers"))
(define-key global-map [menu-bar buffer]
- (cons "Buffers" (make-sparse-keymap "Buffers")))
+ (cons "Buffers" global-buffers-menu-map))
(defvar menu-bar-options-menu (make-sparse-keymap "Options"))
(define-key global-map [menu-bar options]
(cons "Options" menu-bar-options-menu))
(define-key menu-bar-file-menu [separator-save]
'(menu-item "--"))
+(defun menu-find-file-existing ()
+ "Edit the existing file FILENAME."
+ (interactive)
+ (let* ((mustmatch (not (and (fboundp 'x-uses-old-gtk-dialog)
+ (x-uses-old-gtk-dialog))))
+ (filename (car (find-file-read-args "Find file: " mustmatch))))
+ (if mustmatch
+ (find-file-existing filename)
+ (find-file filename))))
+
+
(define-key menu-bar-file-menu [kill-buffer]
'(menu-item "Close" kill-this-buffer
:enable (kill-this-buffer-enabled-p)
:enable (menu-bar-non-minibuffer-window-p)
:help "Read a directory, to operate on its files"))
(define-key menu-bar-file-menu [open-file]
- '(menu-item "Open File..." find-file-existing
+ '(menu-item "Open File..." menu-find-file-existing
:enable (menu-bar-non-minibuffer-window-p)
:help "Read an existing file into an Emacs buffer"))
(define-key menu-bar-file-menu [new-file]
(define-key menu-bar-search-menu [i-search]
- (list 'menu-item "Incremental Search" menu-bar-i-search-menu
- :help "Incremental Search finds partial matches while you type the search string.\nIt is most convenient from the keyboard. Try it!"))
+ (list 'menu-item "Incremental Search" menu-bar-i-search-menu))
(define-key menu-bar-search-menu [separator-tag-isearch]
'(menu-item "--"))
;;; Assemble the top-level Edit menu items.
(define-key menu-bar-edit-menu [props]
- '(menu-item "Text Properties" facemenu-menu
- :help "Change properties of text in region"))
+ '(menu-item "Text Properties" facemenu-menu))
(define-key menu-bar-edit-menu [fill]
'(menu-item "Fill" fill-region
'(menu-item "--"))
(define-key menu-bar-edit-menu [bookmark]
- '(menu-item "Bookmarks" menu-bar-bookmark-map
- :help "Record positions and jump between them"))
+ '(menu-item "Bookmarks" menu-bar-bookmark-map))
(defvar menu-bar-goto-menu (make-sparse-keymap "Go To"))
"Delete the text in region between mark and current position"))
(defvar yank-menu (cons "Select Yank" nil))
(fset 'yank-menu (cons 'keymap yank-menu))
-(define-key menu-bar-edit-menu [select-paste]
- '(menu-item "Select and Paste" yank-menu
+(define-key menu-bar-edit-menu [paste-from-menu]
+ '(menu-item "Paste from kill menu" yank-menu
:enable (and (cdr yank-menu) (not buffer-read-only))
- :help "Paste (yank) text cut or copied earlier"))
+ :help "Choose a string from the kill ring and paste it"))
(define-key menu-bar-edit-menu [paste]
'(menu-item "Paste" yank
:enable (and
:enable (and (not buffer-read-only)
(not (eq t buffer-undo-list))
(if (eq last-command 'undo)
- pending-undo-list
+ (listp pending-undo-list)
(consp buffer-undo-list)))
:help "Undo last operation"))
(defun clipboard-yank ()
"Insert the clipboard contents, or the last stretch of killed text."
- (interactive)
+ (interactive "*")
(let ((x-select-enable-clipboard t))
(yank)))
(let ((set (or (get ',variable 'custom-set) 'set-default))
(get (or (get ',variable 'custom-get) 'default-value)))
(funcall set ',variable (not (funcall get ',variable))))))
- (message ,message "enabled")
- (message ,message "disabled"))
+ (message ,message "enabled globally")
+ (message ,message "disabled globally"))
;; The function `customize-mark-as-set' must only be called when
;; a variable is set interactively, as the purpose is to mark it as
;; a candidate for "Save Options", and we do not want to save options
;;; Assemble all the top-level items of the "Options" menu
(define-key menu-bar-options-menu [customize]
- (list 'menu-item "Customize Emacs" menu-bar-custom-menu
- :help "Full customization of every Emacs feature"))
+ (list 'menu-item "Customize Emacs" menu-bar-custom-menu))
(defun menu-bar-options-save ()
"Save current values of Options menu items using Custom."
(menu-bar-make-toggle toggle-indicate-empty-lines indicate-empty-lines
"Empty Line Indicators"
"Indicating of empty lines %s"
- "Indicate trailing empty lines in fringe"))
+ "Indicate trailing empty lines in fringe, globally"))
(defun menu-bar-showhide-fringe-menu-customize ()
"Show customization buffer for `fringe-mode'."
:visible (display-graphic-p)
:button (:radio . (eq fringe-mode nil))))
-(defun menu-bar-showhide-fringe-menu-customize-left ()
- "Display fringes only on the left of each window."
- (interactive)
- (require 'fringe)
- (customize-set-variable 'fringe-mode '(nil . 0)))
-
-(define-key menu-bar-showhide-fringe-menu [left]
- '(menu-item "On the Left" menu-bar-showhide-fringe-menu-customize-left
- :help "Fringe only on the left side"
- :visible (display-graphic-p)
- :button (:radio . (equal fringe-mode '(nil . 0)))))
-
(defun menu-bar-showhide-fringe-menu-customize-right ()
"Display fringes only on the right of each window."
(interactive)
:visible (display-graphic-p)
:button (:radio . (equal fringe-mode '(0 . nil)))))
+(defun menu-bar-showhide-fringe-menu-customize-left ()
+ "Display fringes only on the left of each window."
+ (interactive)
+ (require 'fringe)
+ (customize-set-variable 'fringe-mode '(nil . 0)))
+
+(define-key menu-bar-showhide-fringe-menu [left]
+ '(menu-item "On the Left" menu-bar-showhide-fringe-menu-customize-left
+ :help "Fringe only on the left side"
+ :visible (display-graphic-p)
+ :button (:radio . (equal fringe-mode '(nil . 0)))))
+
(defun menu-bar-showhide-fringe-menu-customize-disable ()
"Do not display window fringes."
(interactive)
(define-key menu-bar-showhide-menu [showhide-fringe]
(list 'menu-item "Fringe" menu-bar-showhide-fringe-menu
- :visible `(display-graphic-p)
- :help "Select fringe mode"))
+ :visible `(display-graphic-p)))
(defvar menu-bar-showhide-scroll-bar-menu (make-sparse-keymap "Scroll-bar"))
(define-key menu-bar-showhide-menu [showhide-scroll-bar]
(list 'menu-item "Scroll-bar" menu-bar-showhide-scroll-bar-menu
- :visible `(display-graphic-p)
- :help "Select scroll-bar mode"))
+ :visible `(display-graphic-p)))
(define-key menu-bar-showhide-menu [showhide-tooltip-mode]
(list 'menu-item "Tooltips" 'tooltip-mode
- :help "Toggle tooltips on/off"
+ :help "Turn tooltips on/off"
:visible `(and (display-graphic-p) (fboundp 'x-show-tip))
:button `(:toggle . tooltip-mode)))
(define-key menu-bar-showhide-menu [menu-bar-mode]
'(menu-item "Menu-bar" menu-bar-mode
- :help "Toggle menu-bar on/off"
+ :help "Turn menu-bar on/off"
:button (:toggle . menu-bar-mode)))
(define-key menu-bar-showhide-menu [showhide-tool-bar]
:button `(:toggle . tool-bar-mode)))
(define-key menu-bar-options-menu [showhide]
- (list 'menu-item "Show/Hide" menu-bar-showhide-menu
- :help "Toggle on/off various display features"))
+ (list 'menu-item "Show/Hide" menu-bar-showhide-menu))
(define-key menu-bar-options-menu [showhide-separator]
'("--"))
;; Most of the MULE menu actually does make sense in unibyte mode,
;; e.g. language selection.
;;; ':visible 'default-enable-multibyte-characters
- ':help "Default language, encodings, input method"))
+ ))
;(setq menu-bar-final-items (cons 'mule menu-bar-final-items))
;(define-key menu-bar-options-menu [preferences]
; (list 'menu-item "Preferences" menu-bar-preferences-menu
(define-key menu-bar-options-menu [case-fold-search]
(menu-bar-make-toggle toggle-case-fold-search case-fold-search
- "Case-Insensitive Search"
- "Case-Insensitive Search %s"
- "Ignore letter-case in search"))
+ "Case-Insensitive Search"
+ "Case-Insensitive Search %s"
+ "Globally ignore letter-case in search"))
(defun menu-bar-text-mode-auto-fill ()
(interactive)
(define-key menu-bar-games-menu [zone]
'(menu-item "Zone Out" zone
:help "Play tricks with Emacs display when Emacs is idle"))
-(define-key menu-bar-games-menu [yow]
- '(menu-item "Random Quotation" yow
- :help "Display a random Zippy quotation"))
(define-key menu-bar-games-menu [tetris]
'(menu-item "Tetris" tetris))
(define-key menu-bar-games-menu [solitaire]
'(menu-item "Programmable Calculator" calc
:help "Invoke the Emacs built-in full scientific calculator"))
(define-key menu-bar-tools-menu [calendar]
- '(menu-item "Display Calendar" calendar))
+ '(menu-item "Calendar" calendar
+ :help "Invoke the Emacs built-in calendar"))
(define-key menu-bar-tools-menu [separator-net]
'("--"))
(define-key menu-bar-tools-menu [directory-search]
- '(menu-item "Directory Search" eudc-tools-menu
- :help "Query directory servers via LDAP, CCSO PH/QI or BBDB"))
+ '(menu-item "Directory Search" eudc-tools-menu))
(define-key menu-bar-tools-menu [compose-mail]
(list
'menu-item `(format "Send Mail (with %s)" (send-mail-item-name))
(define-key menu-bar-tools-menu [separator-vc]
'("--"))
-(defvar vc-menu-map (make-sparse-keymap "Version Control"))
(define-key menu-bar-tools-menu [pcl-cvs]
- '(menu-item "PCL-CVS" cvs-global-menu
- :help "Module-level interface to CVS"))
-(define-key menu-bar-tools-menu [vc]
- (list 'menu-item "Version Control" vc-menu-map
- :help "Interface to RCS, CVS, SCCS"))
+ '(menu-item "PCL-CVS" cvs-global-menu))
+(define-key menu-bar-tools-menu [vc] nil) ;Create the place for the VC menu.
(define-key menu-bar-tools-menu [separator-compare]
'("--"))
(define-key menu-bar-tools-menu [ediff-misc]
- '(menu-item "Ediff Miscellanea" menu-bar-ediff-misc-menu
- :help "Ediff manual, customization, sessions, etc."))
+ '(menu-item "Ediff Miscellanea" menu-bar-ediff-misc-menu))
(define-key menu-bar-tools-menu [epatch]
'(menu-item "Apply Patch" menu-bar-epatch-menu))
(define-key menu-bar-tools-menu [ediff-merge]
- '(menu-item "Merge" menu-bar-ediff-merge-menu
- :help "Merge different revisions of files/directories"))
+ '(menu-item "Merge" menu-bar-ediff-merge-menu))
(define-key menu-bar-tools-menu [compare]
- '(menu-item "Compare (Ediff)" menu-bar-ediff-menu
- :help "Display differences between files/directories"))
-
+ '(menu-item "Compare (Ediff)" menu-bar-ediff-menu))
(define-key menu-bar-tools-menu [separator-spell]
'("--"))
'(menu-item "Compile..." compile
:help "Invoke compiler or Make, view compilation errors"))
(define-key menu-bar-tools-menu [grep]
- '(menu-item "Search Files (with grep)..." grep
- :help "Search files for strings or regexps (with grep)"))
+ '(menu-item "Search Files (Grep)..." grep
+ :help "Search files for strings or regexps (with Grep)"))
\f
;; The "Help" menu items
:help "Keyboard layout for specific input method"))
(define-key menu-bar-describe-menu [describe-language-environment]
(list 'menu-item "Describe Language Environment"
- describe-language-environment-map
- :help "Show multilingual settings for a specific language"))
+ describe-language-environment-map))
(define-key menu-bar-describe-menu [separator-desc-mule]
'("--"))
(define-key menu-bar-describe-menu [list-keybindings]
'(menu-item "List Key Bindings" describe-bindings
- :help "Display a list of all current keybindings"))
+ :help "Display all current keybindings (keyboard shortcuts)"))
(define-key menu-bar-describe-menu [describe-current-display-table]
'(menu-item "Describe Display Table" describe-current-display-table
:help "Describe the current display table"))
'(menu-item "Describe Buffer Modes" describe-mode
:help "Describe this buffer's major and minor mode"))
-(defvar menu-bar-apropos-menu (make-sparse-keymap "Apropos"))
+(defvar menu-bar-search-documentation-menu
+ (make-sparse-keymap "Search Documentation"))
(defun menu-bar-read-lispref ()
"Display the Emacs Lisp Reference manual in Info mode."
(interactive)
(info "elisp")
(Info-index topic))
-(define-key menu-bar-apropos-menu [apropos-documentation]
+(define-key menu-bar-search-documentation-menu [search-documentation-strings]
'(menu-item "Search Documentation Strings..." apropos-documentation
:help
"Find functions and variables whose doc strings match a regexp"))
-(define-key menu-bar-apropos-menu [apropos]
+(define-key menu-bar-search-documentation-menu [find-any-object-by-name]
'(menu-item "Find Any Object by Name..." apropos
:help "Find symbols of any kind whose names match a regexp"))
-(define-key menu-bar-apropos-menu [apropos-value]
+(define-key menu-bar-search-documentation-menu [find-option-by-value]
'(menu-item "Find Options by Value..." apropos-value
:help "Find variables whose values match a regexp"))
-(define-key menu-bar-apropos-menu [apropos-variables]
+(define-key menu-bar-search-documentation-menu [find-options-by-name]
'(menu-item "Find Options by Name..." apropos-variable
:help "Find variables whose names match a regexp"))
-(define-key menu-bar-apropos-menu [apropos-commands]
+(define-key menu-bar-search-documentation-menu [find-commands-by-name]
'(menu-item "Find Commands by Name..." apropos-command
:help "Find commands whose names match a regexp"))
-(define-key menu-bar-apropos-menu [sep1]
+(define-key menu-bar-search-documentation-menu [sep1]
'("--"))
-(define-key menu-bar-apropos-menu [elisp-index-search]
+(define-key menu-bar-search-documentation-menu [lookup-command-in-manual]
+ '(menu-item "Look Up Command in User Manual..." Info-goto-emacs-command-node
+ :help "Display manual section that describes a command"))
+(define-key menu-bar-search-documentation-menu [lookup-key-in-manual]
+ '(menu-item "Look Up Key in User Manual..." Info-goto-emacs-key-command-node
+ :help "Display manual section that describes a key"))
+(define-key menu-bar-search-documentation-menu [lookup-subject-in-elisp-manual]
'(menu-item "Look Up Subject in ELisp Manual..." elisp-index-search
:help "Find description of a subject in Emacs Lisp manual"))
-(define-key menu-bar-apropos-menu [emacs-index-search]
+(define-key menu-bar-search-documentation-menu [lookup-subject-in-emacs-manual]
'(menu-item "Look Up Subject in User Manual..." emacs-index-search
:help "Find description of a subject in Emacs User manual"))
-(define-key menu-bar-apropos-menu [emacs-glossary]
+(define-key menu-bar-search-documentation-menu [emacs-terminology]
'(menu-item "Emacs Terminology" search-emacs-glossary
:help "Display the Glossary section of the Emacs manual"))
(define-key menu-bar-manuals-menu [order-emacs-manuals]
'(menu-item "Ordering Manuals" view-order-manuals
:help "How to order manuals from the Free Software Foundation"))
-(define-key menu-bar-manuals-menu [info]
+(define-key menu-bar-manuals-menu [lookup-subject-in-all-manuals]
+ '(menu-item "Lookup Subject in all manuals..." info-apropos
+ :help "Find description of a subject in all installed manuals"))
+(define-key menu-bar-manuals-menu [other-manuals]
'(menu-item "All Other Manuals (Info)" Info-directory
:help "Read any of the installed manuals"))
-(define-key menu-bar-manuals-menu [info-elisp]
+(define-key menu-bar-manuals-menu [emacs-lisp-reference]
'(menu-item "Emacs Lisp Reference" menu-bar-read-lispref
:help "Read the Emacs Lisp Reference manual"))
-(define-key menu-bar-manuals-menu [info-elintro]
+(define-key menu-bar-manuals-menu [emac-lisp-intro]
'(menu-item "Introduction to Emacs Lisp" menu-bar-read-lispintro
:help "Read the Introduction to Emacs Lisp Programming"))
-(define-key menu-bar-manuals-menu [sep3]
- '("--"))
-(define-key menu-bar-manuals-menu [command]
- '(menu-item "Find Command in Manual..." Info-goto-emacs-command-node
- :help "Display manual section that describes a command"))
-(define-key menu-bar-manuals-menu [key]
- '(menu-item "Find Key in Manual..." Info-goto-emacs-key-command-node
- :help "Display manual section that describes a key"))
-(define-key menu-bar-help-menu [eliza]
+(define-key menu-bar-help-menu [emacs-psychotherapist]
'(menu-item "Emacs Psychotherapist" doctor
:help "Our doctor will help you feel better"))
(define-key menu-bar-help-menu [sep4]
(define-key menu-bar-help-menu [describe-copying]
'(menu-item "Copying Conditions" describe-copying
:help "Show the Emacs license (GPL)"))
-(define-key menu-bar-help-menu [describe-distribution]
+(define-key menu-bar-help-menu [about-gnu-project]
+ '(menu-item "About GNU" describe-project
+ :help "About the GNU System, GNU Project, and GNU/Linux"))
+(define-key menu-bar-help-menu [getting-new-versions]
'(menu-item "Getting New Versions" describe-distribution
:help "How to get latest versions of Emacs"))
-(define-key menu-bar-help-menu [more]
- '(menu-item "Find Extra Packages"
- menu-bar-help-extra-packages
- :help "Where to find some extra packages and possible updates"))
+(define-key menu-bar-help-menu [external-packages]
+ '(menu-item "External Packages" menu-bar-help-extra-packages
+ :help "Lisp packages distributed separately for use in Emacs"))
(defun menu-bar-help-extra-packages ()
"Display help about some additional packages available for Emacs."
(interactive)
(view-file (expand-file-name "MORE.STUFF"
data-directory))
(goto-address)))
-(define-key menu-bar-help-menu [about]
+(define-key menu-bar-help-menu [about-emacs]
'(menu-item "About Emacs" display-splash-screen
:help "Display version number, copyright info, and basic help"))
(define-key menu-bar-help-menu [sep2]
'("--"))
-(define-key menu-bar-help-menu [finder-by-keyword]
+(define-key menu-bar-help-menu [find-emacs-packages]
'(menu-item "Find Emacs Packages" finder-by-keyword
:help "Find packages and features by keyword"))
-(define-key menu-bar-help-menu [manuals]
- (list 'menu-item "More Manuals" menu-bar-manuals-menu
- :help "Search and browse on-line manuals"))
+(define-key menu-bar-help-menu [more-manuals]
+ (list 'menu-item "More Manuals" menu-bar-manuals-menu))
(define-key menu-bar-help-menu [emacs-manual]
'(menu-item "Read the Emacs Manual" info-emacs-manual
:help "Full documentation of Emacs features"))
(define-key menu-bar-help-menu [describe]
- (list 'menu-item "Describe" menu-bar-describe-menu
- :help "Describe commands, variables, keys"))
-(define-key menu-bar-help-menu [apropos]
- (list 'menu-item "Search Documentation" menu-bar-apropos-menu
- :help "Look up terms, find commands, options, etc. (Apropos)"))
+ (list 'menu-item "Describe" menu-bar-describe-menu))
+(define-key menu-bar-help-menu [search-documentation]
+ (list 'menu-item "Search Documentation" menu-bar-search-documentation-menu))
(define-key menu-bar-help-menu [sep1]
'("--"))
-(define-key menu-bar-help-menu [report-emacs-bug]
+(define-key menu-bar-help-menu [send-emacs-bug-report]
'(menu-item "Send Bug Report..." report-emacs-bug
:help "Send e-mail to Emacs maintainers"))
-(define-key menu-bar-help-menu [emacs-problems]
- '(menu-item "Emacs Known Problems" view-emacs-problems))
+(define-key menu-bar-help-menu [emacs-known-problems]
+ '(menu-item "Emacs Known Problems" view-emacs-problems
+ :help "Read about known problems with Emacs"))
(define-key menu-bar-help-menu [emacs-news]
'(menu-item "Emacs News" view-emacs-news
:help "New features of this version"))
(define-key menu-bar-help-menu [emacs-faq]
- '(menu-item "Emacs FAQ" view-emacs-FAQ))
+ '(menu-item "Emacs FAQ" view-emacs-FAQ
+ :help "Frequently asked (and answered) questions about Emacs"))
(defun help-with-tutorial-spec-language ()
"Use the Emacs tutorial, specifying which language you want."
(defun menu-bar-menu-frame-live-and-visible-p ()
"Return non-nil if the menu frame is alive and visible.
The menu frame is the frame for which we are updating the menu."
- (let ((menu-frame (if (display-multi-frame-p) menu-updating-frame
- (selected-frame))))
+ (let ((menu-frame (or menu-updating-frame (selected-frame))))
(and (frame-live-p menu-frame)
(frame-visible-p menu-frame))))
See the documentation of `menu-bar-menu-frame-live-and-visible-p'
for the definition of the menu frame."
- (let ((menu-frame (if (display-multi-frame-p) menu-updating-frame
- (selected-frame))))
+ (let ((menu-frame (or menu-updating-frame (selected-frame))))
(not (window-minibuffer-p (frame-selected-window menu-frame)))))
-(defun kill-this-buffer () ; for the menubar
+(defun kill-this-buffer () ; for the menu bar
"Kill the current buffer."
(interactive)
(kill-buffer (current-buffer)))
(put 'menu-bar-select-yank 'apropos-inhibit t)
(defun menu-bar-select-yank ()
+ "Insert the stretch of previously-killed text selected from menu.
+The menu shows all the killed text sequences stored in `kill-ring'."
(interactive "*")
(push-mark (point))
(insert last-command-event))
(or force (frame-or-buffer-changed-p))
(let ((buffers (buffer-list))
(frames (frame-list))
- buffers-menu frames-menu)
+ buffers-menu)
;; If requested, list only the N most recently selected buffers.
(if (and (integerp buffers-menu-max-size)
(> buffers-menu-max-size 1))
name))))
;; Compute the maximum length of any name.
(dolist (buf buffer-list)
- (unless (eq ?\ (aref (cdr buf) 0))
+ (unless (eq ?\s (aref (cdr buf) 0))
(setq menu-bar-update-buffers-maxbuf
(max menu-bar-update-buffers-maxbuf
(length (cdr buf))))))
;; Set ALIST to an alist of the form
;; ITEM-STRING . BUFFER
(dolist (buf buffer-list)
- (unless (eq ?\ (aref (cdr buf) 0))
+ (unless (eq ?\s (aref (cdr buf) 0))
(push (menu-bar-update-buffers-1 buf) alist)))
;; Now make the actual list of items, and add
;; some miscellaneous buffer commands to the end.
"Next Buffer"
'next-buffer
:help "Switch to the \"next\" buffer in a cyclic order")
- (list 'prev-buffer
+ (list 'previous-buffer
'menu-item
"Previous Buffer"
- 'prev-buffer
+ 'previous-buffer
:help "Switch to the \"previous\" buffer in a cyclic order")
(list 'select-named-buffer
'menu-item
'menu-item
"List All Buffers"
'list-buffers
- :help "Pop up a window listing all emacs buffers"
+ :help "Pop up a window listing all Emacs buffers"
))))
(setq buffers-menu
(nconc buffers-menu menu-bar-buffers-menu-command-entries))
- (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu)))
- (define-key (current-global-map) [menu-bar buffer]
- ;; Call copy-sequence so the string is not pure.
- (cons (copy-sequence "Buffers") buffers-menu)))))
+ ;; We used to "(define-key (current-global-map) [menu-bar buffer]"
+ ;; but that did not do the right thing when the [menu-bar buffer]
+ ;; entry above had been moved (e.g. to a parent keymap).
+ (setcdr global-buffers-menu-map (cons "Select Buffer" buffers-menu)))))
(add-hook 'menu-bar-update-hook 'menu-bar-update-buffers)
(provide 'menu-bar)
-;;; arch-tag: 6e6a3c22-4ec4-4d3d-8190-583f8ef94ced
+;; arch-tag: 6e6a3c22-4ec4-4d3d-8190-583f8ef94ced
;;; menu-bar.el ends here