Commit 5d907d6c authored by Drew Adams's avatar Drew Adams Committed by Stefan Monnier
Browse files

* lisp/menu-bar.el: Use function variable instead of switch-to-buffer.

(menu-bar-select-buffer-function): New variable.
(menu-bar-update-buffers): Use it.
parent 478d6f95
......@@ -309,6 +309,11 @@ If you need it, feedmail.el ought to provide a superset of the functionality.
The elisp implementation sha1.el is removed. Feature sha1 is provided
by default.
** Menu-bar changes
*** `menu-bar-select-buffer-function' lets you choose another operation
instead of `switch-to-buffer' when selecting an item in the Buffers menu.
* Editing Changes in Emacs 24.1
......
2011-06-21 Drew Adams <drew.adams@oracle.com>
* menu-bar.el: Use function variable instead of switch-to-buffer.
(menu-bar-select-buffer-function): New variable.
(menu-bar-update-buffers): Use it.
2011-06-21 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/bytecomp.el (add-to-list): Add handler to check the
......
......@@ -1977,6 +1977,10 @@ Buffers menu is regenerated."
;; Used to cache the menu entries for commands in the Buffers menu
(defvar menu-bar-buffers-menu-command-entries nil)
(defvar menu-bar-select-buffer-function 'switch-to-buffer
"Function to select the buffer chosen from the `Buffers' menu-bar menu.
It must accept a buffer as its only required argument.")
(defun menu-bar-update-buffers (&optional force)
;; If user discards the Buffers item, play along.
(and (lookup-key (current-global-map) [menu-bar buffer])
......@@ -2022,7 +2026,7 @@ Buffers menu is regenerated."
(cons nil nil))
`(lambda ()
(interactive)
(switch-to-buffer ,(cdr pair))))))
(funcall menu-bar-select-buffer-function ,(cdr pair))))))
(list buffers-vec))))
;; Make a Frames menu if we have more than one frame.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment