[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ELPA] New package: scanner
From: |
Stefan Monnier |
Subject: |
Re: [ELPA] New package: scanner |
Date: |
Fri, 10 Apr 2020 16:43:10 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> I'm also wondering why you need all those `:key-sequence nil` in the menu.
>> Maybe it reflects a bug in our code?
> The Elisp doc says in (info "(elisp) Extended Menu Items"):
> ‘:key-sequence nil’
> This property indicates that there is normally no key binding which
> is equivalent to this menu item. Using this property saves time in
> preparing the menu for display, because Emacs does not need to
> search the keymaps for a keyboard equivalent for this menu item.
AFAIK we never bother with this optimization. Finding the key-sequence
is supposed to be very cheap (basically a hash-table lookup) because we
pre-compute a "reverse table" from commands to key-bindings.
[ This pre-computation is not that cheap but we the above keyword
argument doesn't prevent its computation. ]
> I just thought this is how it's done.
I guess we should adjust the doc, thanks.
Stefan