Original thread on XEmacs Patches, moving this discussion to XEmacs
Beta to get a broader audience (and hopefully more comments).
Reshuffled to save the tl;dr comments for last. ;-)
Vin Shelton writes:
I have attached patches for both 21.4 and 21.5 to address these
thoughts. I will commit them soon unless there is further discussion.
+1. You need not wait for the outcome of the discussion below to be
resolved. As far as I'm concerned, your patch is a clear improvement
There remains a bug with the accelerator code - even though the
accelerator for "One" is "1", I notice that the initial "O"
Yes. Maybe the right thing to do is to use the code for displaying
accelerators for auto-generated menus when the :accelerator key is
used in a menu item. This might require refactoring that code.
Since there already is a top-level "t" menu (Tools), I
probably clearer to bind the top-level menu to "s". This will also
show that accelerators don't have to be initial characters and can be
embedded inside strings.
The accelerator for "Two" is the lowercase, not uppercase, "t", so I
tried to make that clear.
This isn't mentioned anywhere in the 21.5 version of menu.texi that I
can see. In fact, the actual behavior is confusing. By using the
:accelerator keyword, you can set the accelerator key to uppercase
letters (I tested "O"), and you can set the accelerator key inline
using the "%_" format character to shifted punctuation (I tested
The case-folding behavior is not restricted to initial characters.
Here's the test menu:
(add-submenu nil '("%_Test"
["One" (insert "1") :accelerator ?O :active t]
["T%_WO" (insert "2")]
["%_#3" (insert "3")]))2
So I would guess a paragraph something like
The keystrokes used to activate an accelerated item must be
graphic characters. As a convenience for both programmers and
users, alphabetic keys declared using the "%_" format sequence in
the item name string are case-folded to lowercase by the menu
creation code. It is possible to set an uppercase accelerator by
use of the :accelerator key, but there is no way to distinguish
between uppercase accelerators and lowercase accelerators by
looking at the displayed menu. Therefore, uppercase accelerator
keys are best avoided.
should be added just above the menu in node "Menu Accelerators" of
menu.texi. Discussion of both content and location welcome.
I also note that man/xemacs/menus.texi doesn't mention accelerators at
all. Patches welcome. It also contains a section on using Lisp to
customize menus that seems out of place, but this probably should be
discussed before replacing it with a pointer to LispRef or anything
XEmacs-Beta mailing list