help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Commands with more than one keybinding in menus


From: Michael Heerdegen
Subject: Re: Commands with more than one keybinding in menus
Date: Wed, 14 Aug 2013 14:36:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Thorsten Jolitz <tjolitz@gmail.com> writes:

> Its looks good so far, but I could not make easy-menu to show the
> advertised keybindings. The whole thing looks like this:
>
> ,-----------------------------------------------------------------------
> | ;; ** Menus
> | ;; *** Advertise Bindings
> |
> | (put 'outline-cycle :advertised-binding [TAB])
> | (put 'outshine-cycle-buffer :advertised-binding [BACKTAB])
> | (put 'outline-promote :advertised-binding [M-S-left])
> | (put 'outline-demote :advertised-binding [M-S-right])
> | [...snip...]
> | (put 'outline-up-heading :advertised-binding [M-\# M-u])
> | (put 'outorg-edit-as-org :advertised-binding [M-\# M-\#])
> |
> | ;; *** Define Menu
> |
> | (easy-menu-define outshine-menu outline-minor-mode-map "Outshine menu"
> |   '("Outshine"
> |      ["Cycle Subtree" outline-cycle
> |       :active (outline-on-heading-p)]
> |       [...snip...]
> |      ["Up Heading" outline-up-heading t]
> |     "--"
> |      ["Edit As Org" outorg-edit-as-org t]))
> |
> | ;; add "Outshine" menu item
> | (easy-menu-add outshine-menu outline-minor-mode-map)
> | ;; get rid of "Outline" menu item
> | (define-key outline-minor-mode-map [menu-bar outline] 'undefined)
> `-----------------------------------------------------------------------
>
> but the advertised bindings don't appear in the menu, either the
> alternative bindings or no bindings at all show up.

Looks ok to me.  But presumably Emacs doesn't match your actual bindings
with the advertised bindings.

I wonder how the actual bindings are compared with the
:advertised-binding property - equal? (Stefan?)

> I should mention that I use a specialised macro to define keybindings
> conditional on point position, in order to not mess with user setting
> (this is a minor-mode).

Please post the according code.


Michael.




reply via email to

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