mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-29 11:02:01 +00:00
(get_keyelt): For menu-items containing a `:filter
FILTER', apply FILTER to the menu-item's definition to get the real definition to use.
This commit is contained in:
parent
1425dcb619
commit
3fc720e4bd
@ -1,5 +1,11 @@
|
||||
2000-06-26 Gerd Moellmann <gerd@gnu.org>
|
||||
|
||||
* keymap.c (get_keyelt): For menu-items containing a `:filter
|
||||
FILTER', apply FILTER to the menu-item's definition to get the
|
||||
real definition to use.
|
||||
|
||||
* lisp.h (QCfilter): External declaration.
|
||||
|
||||
* xfns.c (Fimage_size): New function.
|
||||
(syms_of_xfns): Defsubr it.
|
||||
|
||||
@ -54,7 +60,7 @@
|
||||
include time.h, done by systime.h.
|
||||
[__FreeBSD__]: Remove redundant includes.
|
||||
|
||||
* callproc.c: (setpgrp): Undefine before defining.
|
||||
* callproc.c (setpgrp): Undefine before defining.
|
||||
(delete_temp_file): Return Qnil to avoid warning.
|
||||
|
||||
* config.in (HAVE_TERM_H, HAVE_STRUCT_TIMEZONE): Add.
|
||||
|
19
src/keymap.c
19
src/keymap.c
@ -578,15 +578,30 @@ get_keyelt (object, autoload)
|
||||
|
||||
/* If the keymap contents looks like (menu-item name . DEFN)
|
||||
or (menu-item name DEFN ...) then use DEFN.
|
||||
This is a new format menu item.
|
||||
*/
|
||||
This is a new format menu item. */
|
||||
else if (EQ (XCAR (object), Qmenu_item))
|
||||
{
|
||||
if (CONSP (XCDR (object)))
|
||||
{
|
||||
Lisp_Object tem;
|
||||
|
||||
object = XCDR (XCDR (object));
|
||||
tem = object;
|
||||
if (CONSP (object))
|
||||
object = XCAR (object);
|
||||
|
||||
/* If there's a `:filter FILTER', apply FILTER to the
|
||||
menu-item's definition to get the real definition to
|
||||
use. */
|
||||
for (; CONSP (tem) && CONSP (XCDR (tem)); tem = XCDR (tem))
|
||||
if (EQ (XCAR (tem), QCfilter))
|
||||
{
|
||||
Lisp_Object filter;
|
||||
filter = XCAR (XCDR (tem));
|
||||
filter = list2 (filter, list2 (Qquote, object));
|
||||
object = menu_item_eval_property (filter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Invalid keymap */
|
||||
|
Loading…
Reference in New Issue
Block a user