Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
424d6179
Commit
424d6179
authored
Nov 08, 2009
by
Stefan Monnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(parse_menu_item): Handle `notreal' a bit earlier.
Use `tem' less. Make sure KEYEQ holds a string or nil (bug#4879).
parent
c7bd4ebe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
54 deletions
+64
-54
src/ChangeLog
src/ChangeLog
+5
-0
src/keyboard.c
src/keyboard.c
+59
-54
No files found.
src/ChangeLog
View file @
424d6179
2009-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
* keyboard.c (parse_menu_item): Handle `notreal' a bit earlier.
Use `tem' less. Make sure KEYEQ holds a string or nil (bug#4879).
2009-11-08 Chong Yidong <cyd@stupidchicken.com>
* xmenu.c (Fx_popup_menu): Extract event timestamp. Pass it to
...
...
src/keyboard.c
View file @
424d6179
...
...
@@ -8068,65 +8068,70 @@ parse_menu_item (item, notreal, inmenubar)
if (inmenubar > 0)
return 1;
/* This is a command. See if there is an equivalent key binding. */
tem = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
/* The previous code preferred :key-sequence to :keys, so we
preserve this behavior. */
if (STRINGP (tem) && !CONSP (keyhint))
tem = Fsubstitute_command_keys (tem);
else
{
Lisp_Object prefix = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
Lisp_Object keys = Qnil;
/* If we only want to precompute equivalent key bindings (which we
don't even do any more anyway), stop here. */
if (notreal)
return 1;
if (CONSP (prefix))
{
def = XCAR (prefix);
prefix = XCDR (prefix);
}
else
def = AREF (item_properties, ITEM_PROPERTY_DEF);
{ /* This is a command. See if there is an equivalent key binding. */
Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
if (CONSP (keyhint) && !NILP (XCAR (keyhint)))
{
keys = XCAR (keyhint);
tem = Fkey_binding (keys, Qnil, Qnil, Qnil);
/* We have a suggested key. Is it bound to the command? */
if (NILP (tem)
|| (!EQ (tem, def)
/* If the command is an alias for another
(such as lmenu.el set it up), check if the
original command matches the cached command. */
&& !(SYMBOLP (def) && EQ (tem, XSYMBOL (def)->function))))
keys = Qnil;
}
/* The previous code preferred :key-sequence to :keys, so we
preserve this behavior. */
if (STRINGP (keyeq) && !CONSP (keyhint))
keyeq = Fsubstitute_command_keys (keyeq);
else
{
Lisp_Object prefix = keyeq;
Lisp_Object keys = Qnil;
if (CONSP (prefix))
{
def = XCAR (prefix);
prefix = XCDR (prefix);
}
else
def = AREF (item_properties, ITEM_PROPERTY_DEF);
if (CONSP (keyhint) && !NILP (XCAR (keyhint)))
{
keys = XCAR (keyhint);
tem = Fkey_binding (keys, Qnil, Qnil, Qnil);
/* We have a suggested key. Is it bound to the command? */
if (NILP (tem)
|| (!EQ (tem, def)
/* If the command is an alias for another
(such as lmenu.el set it up), check if the
original command matches the cached command. */
&& !(SYMBOLP (def) && EQ (tem, XSYMBOL (def)->function))))
keys = Qnil;
}
if (NILP (keys))
keys = Fwhere_is_internal (def, Qnil, Qt, Qnil, Qnil);
if (NILP (keys))
keys = Fwhere_is_internal (def, Qnil, Qt, Qnil, Qnil);
if (!NILP (keys))
{
tem = Fkey_description (keys, Qnil);
if (CONSP (prefix))
{
if (STRINGP (XCAR (prefix)))
tem = concat2 (XCAR (prefix), tem);
if (STRINGP (XCDR (prefix)))
tem = concat2 (tem, XCDR (prefix));
}
tem = concat2 (build_string (" "), tem);
/* tem = concat3 (build_string (" ("), tem, build_string (")")); */
}
}
/* If we only want to precompute equivalent key bindings, stop here. */
if (notreal)
return 1;
if (!NILP (keys))
{
tem = Fkey_description (keys, Qnil);
if (CONSP (prefix))
{
if (STRINGP (XCAR (prefix)))
tem = concat2 (XCAR (prefix), tem);
if (STRINGP (XCDR (prefix)))
tem = concat2 (tem, XCDR (prefix));
}
keyeq = concat2 (build_string (" "), tem);
/* keyeq = concat3(build_string(" ("),tem,build_string(")")); */
}
else
keyeq = Qnil;
}
/* If we have an equivalent key binding, use that. */
ASET (item_properties, ITEM_PROPERTY_KEYEQ, tem);
/* If we have an equivalent key binding, use that. */
ASET (item_properties, ITEM_PROPERTY_KEYEQ, keyeq);
}
/* Include this when menu help is implemented.
tem = XVECTOR (item_properties)->contents[ITEM_PROPERTY_HELP];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment