[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: menu indications of key bindings for remapped commands
From: |
Richard Stallman |
Subject: |
Re: menu indications of key bindings for remapped commands |
Date: |
Thu, 24 May 2007 17:22:49 -0400 |
Would someone please fix this and ack?
> Try this in emacs -Q
>
> (defvar bar-mode-map (make-sparse-keymap)
> "Keymap for Bar mode.")
> (defvar bar-menu-map (make-sparse-keymap "Bar")
> "Keymap for Bar menu.")
>
> (define-key bar-mode-map [menu-bar bar]
> (cons "Bar" bar-menu-map))
> (define-key bar-mode-map [remap switch-to-buffer]
> 'bar-buffer)
>
> ;; This way, the key binding shows incorrectly in the menu.
> (define-key bar-menu-map [bar-buffer]
> '("Bar Buffer..." . bar-buffer))
>
> ;; This way, the key binding shows correctly in the menu.
> ;;(define-key bar-menu-map [bar-buffer]
> ;; '("Bar Buffer..." . switch-to-buffer))
>
> (define-minor-mode bar-mode "Bar mode")
>
> M-x bar-mode
>
> You'll see the bad menu item (bad key-binding description) in menu Bar.
>
> Now execute the commented code. The menu item is now as it should be.