all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Allen <timallen@ls83.fsnet.co.uk>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Adding an entry to the menu bar
Date: Fri, 21 Jul 2006 08:52:54 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0607210851510.31896-100000@fleet.dcallen.co.uk> (raw)
In-Reply-To: <e9p1k6$d4e$1@sea.gmane.org>

On Thu, 20 Jul 2006, Kevin Rodgers wrote:

> Tim Allen wrote:
> > I'm trying to add an entry to the Buffers menu bar (for creating a new
> > scratch). My attempt below works OK when adding to the Files menu, but
> > changing "files" to "buffers" does not insert the new menu option:
> > 
> > (define-key global-map
> >   [menu-bar files create-scratch]
> >   '("New buffer" . create-scratch-buffer))
> > 
> > 
> > I think this may be because the contents of the Buffers menu is created 
> > "on-the-fly", as it needs to list the actual buffers present. Can anyone 
> > help with this?
> 
> Right (plus the key is actually [menu-bar buffer], not [menu-bar
> buffers]).
> 
> menu-bar-update-buffers is the function where this happens, so you could
> try invoking your code like this:
> 
> (defadvice menu-bar-update-buffers (after create-scratch activate)
>    "Add a \"New buffer\" entry to the \"Buffers\" menu."
>    (define-key (current-global-map) [menu-bar buffer create-scratch]
>      '("New buffer" . create-scratch-buffer)))
> 
> 

Thanks Kevin, that was exactly what I needed.

Tim

      reply	other threads:[~2006-07-21  7:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-20 14:18 Adding an entry to the menu bar Tim Allen
2006-07-20 22:53 ` Kevin Rodgers
2006-07-21  7:52   ` Tim Allen [this message]

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

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

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0607210851510.31896-100000@fleet.dcallen.co.uk \
    --to=timallen@ls83.fsnet.co.uk \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.