[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r104649: * lisp/menu-bar.el: Use func
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r104649: * lisp/menu-bar.el: Use function variable instead of switch-to-buffer. |
Date: |
Mon, 20 Jun 2011 21:49:36 -0400 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 104649
author: Drew Adams <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2011-06-20 21:49:36 -0400
message:
* 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.
modified:
etc/NEWS
lisp/ChangeLog
lisp/menu-bar.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2011-06-18 21:12:33 +0000
+++ b/etc/NEWS 2011-06-21 01:49:36 +0000
@@ -309,6 +309,11 @@
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
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-06-21 01:43:56 +0000
+++ b/lisp/ChangeLog 2011-06-21 01:49:36 +0000
@@ -1,3 +1,9 @@
+2011-06-21 Drew Adams <address@hidden>
+
+ * 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 <address@hidden>
* emacs-lisp/bytecomp.el (add-to-list): Add handler to check the
=== modified file 'lisp/menu-bar.el'
--- a/lisp/menu-bar.el 2011-05-29 19:11:23 +0000
+++ b/lisp/menu-bar.el 2011-06-21 01:49:36 +0000
@@ -1977,6 +1977,10 @@
;; 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 @@
(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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r104649: * lisp/menu-bar.el: Use function variable instead of switch-to-buffer.,
Stefan Monnier <=