(cdr elt)))
buf)))
-;; Used to cache the menu entries for commands in the Buffers menu
-(defvar menu-bar-buffers-menu-command-entries nil)
+(defvar menu-bar-buffers-menu-command-entries
+ (list '(command-separator "--")
+ (list 'next-buffer
+ 'menu-item
+ "Next Buffer"
+ 'next-buffer
+ :help "Switch to the \"next\" buffer in a cyclic order")
+ (list 'previous-buffer
+ 'menu-item
+ "Previous Buffer"
+ 'previous-buffer
+ :help "Switch to the \"previous\" buffer in a cyclic order")
+ (list 'select-named-buffer
+ 'menu-item
+ "Select Named Buffer..."
+ 'switch-to-buffer
+ :help "Prompt for a buffer name, and select that buffer in the current window")
+ (list 'list-all-buffers
+ 'menu-item
+ "List All Buffers"
+ 'list-buffers
+ :help "Pop up a window listing all Emacs buffers"))
+ "Entries to be included at the end of the \"Buffers\" menu.")
(defvar menu-bar-select-buffer-function 'switch-to-buffer
"Function to select the buffer chosen from the `Buffers' menu-bar menu.
`((frames-separator "--")
(frames menu-item "Frames" ,frames-menu))))))
- ;; Add in some normal commands at the end of the menu. We use
- ;; the copy cached in `menu-bar-buffers-menu-command-entries'
- ;; if it's been set already. Note that we can't use constant
- ;; lists for the menu-entries, because the low-level menu-code
- ;; modifies them.
- (unless menu-bar-buffers-menu-command-entries
- (setq menu-bar-buffers-menu-command-entries
- (list '(command-separator "--")
- (list 'next-buffer
- 'menu-item
- "Next Buffer"
- 'next-buffer
- :help "Switch to the \"next\" buffer in a cyclic order")
- (list 'previous-buffer
- 'menu-item
- "Previous Buffer"
- 'previous-buffer
- :help "Switch to the \"previous\" buffer in a cyclic order")
- (list 'select-named-buffer
- 'menu-item
- "Select Named Buffer..."
- 'switch-to-buffer
- :help "Prompt for a buffer name, and select that buffer in the current window")
- (list 'list-all-buffers
- 'menu-item
- "List All Buffers"
- 'list-buffers
- :help "Pop up a window listing all Emacs buffers"
- ))))
+ ;; Add in some normal commands at the end of the menu.
(setq buffers-menu
(nconc buffers-menu menu-bar-buffers-menu-command-entries))