From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Adding an entry to the menu bar
Date: Thu, 20 Jul 2006 16:53:40 -0600 [thread overview]
Message-ID: <e9p1k6$d4e$1@sea.gmane.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0607201511330.26347-100000@fleet.dcallen.co.uk>
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)))
--
Kevin
next prev parent reply other threads:[~2006-07-20 22:53 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 [this message]
2006-07-21 7:52 ` Tim Allen
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='e9p1k6$d4e$1@sea.gmane.org' \
--to=ihs_4664@yahoo.com \
/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.