unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: 8876@debbugs.gnu.org
Subject: bug#8876: 24.0.50; making `menu-bar-update-buffers' use another frame
Date: Fri, 17 Jun 2011 07:48:00 -0700	[thread overview]
Message-ID: <DA8129BE6BC04AE3B1CD0F5DA9912A74@us.oracle.com> (raw)
In-Reply-To: <jwv1uytubwt.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

> >> Feel free to change it so that instead of calling 
> >> `switch-to-buffer' it calls some alias or it (funcall 
> >> menu-bar-select-buffer-function <buf>).
> > That would be great.  What do you need from me - a patch?
> 
> For example, yes, including ChangeLog entry and a tiny note 
> in etc/NEWS.

Attached.  Changelog entry:

2011-06-17  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 menu-bar-select-buffer-function.

[-- Attachment #2: menu-bar-2011-06-17.patch --]
[-- Type: application/octet-stream, Size: 1399 bytes --]

diff -c -w "menu-bar.el" "menu-bar-patched-2011-06-17.el"
*** menu-bar.el	Fri Jun 17 06:52:34 2011
--- menu-bar-patched-2011-06-17.el	Fri Jun 17 07:14:10 2011
***************
*** 1977,1982 ****
--- 1977,1986 ----
  ;; 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 applied to a 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,2028 ****
  					(cons nil nil))
  				  `(lambda ()
                                       (interactive)
!                                      (switch-to-buffer ,(cdr pair))))))
                     (list buffers-vec))))
  
  	 ;; Make a Frames menu if we have more than one frame.
--- 2026,2032 ----
  					(cons nil nil))
  				  `(lambda ()
                                       (interactive)
!                                      (funcall menu-bar-select-buffer-function ,(cdr pair))))))
                     (list buffers-vec))))
  
  	 ;; Make a Frames menu if we have more than one frame.

Diff finished at Fri Jun 17 07:14:31

[-- Attachment #3: NEWS-2011-06-17.patch --]
[-- Type: application/octet-stream, Size: 600 bytes --]

diff -c -w "NEWS" "NEWS-patched-2011-06-17"
*** NEWS	Fri Jun 17 07:23:06 2011
--- NEWS-patched-2011-06-17	Fri Jun 17 07:22:50 2011
***************
*** 309,314 ****
--- 309,320 ----
  The elisp implementation sha1.el is removed. Feature sha1 is provided
  by default.
  
+ ** Menu-bar changes
+ 
+ *** Buffers menu uses variable `menu-bar-select-buffer-function'.
+ The value of this new variable is the function invoked when you choose
+ a buffer from the menu.  Default value: `switch-to-buffer'.
+ 
  \f
  * Editing Changes in Emacs 24.1
  

Diff finished at Fri Jun 17 07:23:19

  reply	other threads:[~2011-06-17 14:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15 22:06 bug#8876: 24.0.50; making `menu-bar-update-buffers' use another frame Drew Adams
2011-06-16  1:00 ` Stefan Monnier
2011-06-16  2:24   ` Drew Adams
2011-06-16 13:47     ` Stefan Monnier
2011-06-17 14:48       ` Drew Adams [this message]
2011-06-21  1:49         ` Stefan Monnier
2011-06-21  1:50         ` Stefan Monnier
     [not found]         ` <<jwv4o3kgdgp.fsf-monnier+emacs@gnu.org>
2013-06-17 14:34           ` Drew Adams
2013-06-17 15:46             ` Michael Heerdegen
2013-06-17 16:26               ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DA8129BE6BC04AE3B1CD0F5DA9912A74@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=8876@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).