all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Assigning keymaps / menu shorts / changing menu items
@ 2005-04-09 18:11 David Reitter
  0 siblings, 0 replies; 4+ messages in thread
From: David Reitter @ 2005-04-09 18:11 UTC (permalink / raw)


I would like to do a couple of global-set-keys for a few basic 
functions that appear in the menu bar. However, the new shortcuts don't 
appear in the menu items, since they are still assigned (and should 
be).

I understand the menu item shortcuts show what's defined first. Is 
there a command like global-set-key that would insert the new keymap at 
the beginning of the list associated with the function? Here's what I 
do:

(global-set-key [(alt v)] 'yank)

'yank has a menu entry in the Edit menu that currently says "Paste 
(C-y)".

Also, I would like to change the way the keyboard shortcuts appear in 
the menu. Can I redefine a function to do that? What would that be?

Lastly: how do I change a menu item?
I know how to add submenus to a menu with easychange.el, but I couldn't 
figure out how to actually change the text of an arbitrary item. Is 
that possible?

I've been looking for something like that in various places - maybe 
someone here could give me a hint regarding any of these things, I'd be 
very grateful.

^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <mailman.935.1113068595.2895.help-gnu-emacs@gnu.org>]
* Re: Assigning keymaps / menu shorts / changing menu items
@ 2005-04-10 19:40 David Reitter
  2005-04-10 20:28 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: David Reitter @ 2005-04-10 19:40 UTC (permalink / raw)
  Cc: Help-gnu-emacs

Many thanks for your hints.

> > Lastly: how do I change a menu item?
> > I know how to add submenus to a menu with easychange.el, but I 
> couldn't
> > figure out how to actually change the text of an arbitrary item. Is
> > that possible?
>
> Find the key-sequence corresponding to it with C-h k, then
> (define-key [theseysequence] '(menu-item ...)).
> See the elisp manual's description of menus and `menu-item' for more 
> info.

OK, but I wouldn't want to contruct a completely new menu-item, I would 
just want to exchange the text. Now, when I do something like

(lookup-key global-map [menu-bar file open-file])

all I get is the pure command, 'find-file-existing, in this case - but 
not the arguments :enable and :help that were defined in menu-bar.el:

(define-key menu-bar-file-menu [open-file]
   '(menu-item "Open File..." find-file-existing
	      :enable (not (window-minibuffer-p
			    (frame-selected-window menu-updating-frame)))
	      :help "Read an existing file into an Emacs buffer"))

So in order to _change_ single elements of a menu-item, I need to read 
out everything that define-key was called with in menu-bar.el.

Of course, I could tinker with menu-bar.el directly or copy stuff out 
of it, but that would be no fun to keep up to date...

Thanks in advance
-- Dave

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-10 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-09 18:11 Assigning keymaps / menu shorts / changing menu items David Reitter
     [not found] <mailman.935.1113068595.2895.help-gnu-emacs@gnu.org>
2005-04-09 19:15 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2005-04-10 19:40 David Reitter
2005-04-10 20:28 ` Stefan Monnier

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.