emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

menu indications of key bindings for remapped commands


From: Drew Adams
Subject: menu indications of key bindings for remapped commands
Date: Thu, 11 Jan 2007 10:32:00 -0800

I guess this whole message got rejected when the GIF attachment was deemed
"bad". Here it is again, without the attachment (see PNG sent separately).

From: Drew Adams Sent: Thursday, January 11, 2007 10:05 AM

> > What is the reason that a remapped command in a menu item has its key
> > binding listed as, for example, "(<remap> <switch-to-buffer>)"? Is it
> > because it would be impossible or difficult to pick up one of
> > the final keys that it is actually bound to - e.g. "(C-x b)"?
> >
> > I assume this is not an oversight or a bug - I'm just curious
> > as to why this appears this way. It is not especially useful for
> > users to see this, IMO.
>
> I don't see it.  And I have several remapped commands (from ido-mode).

See attached image.

> Can you please give a specific example/recipe of this.

The code is here: http://www.emacswiki.org/cgi-bin/wiki/icicles-mode.el.

The relevant code creating the first menu item is this:

(setq icicle-mode-map (make-sparse-keymap))
(unless icicle-menu-map
  (setq icicle-menu-map (make-sparse-keymap "Icicles"))
  (define-key icicle-mode-map [menu-bar icicles]
              (cons "Icicles" icicle-menu-map)))
(define-key icicle-menu-map [icicle-buffer]
            '("+ Switch to Buffer..." . icicle-buffer)))

The code that does the remapping for the first menu item is this:

(define-key icicle-mode-map [remap switch-to-buffer]
            'icicle-buffer)

The Icicles menubar menu is available whenever global minor mode
`icicle-mode' is turned on. In that minor mode, `switch-to-buffer' is
remapped to `icicle-buffer'. In the Icicles menu, that binding is indicated
as "(<remap> <switch-to-buffer>)".





reply via email to

[Prev in Thread] Current Thread [Next in Thread]