aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-02-20 14:29:41 +0100
committerLars Ingebrigtsen2021-02-20 14:29:41 +0100
commit12578d6aca2cc7182afdd070aa31c7aff6a3add8 (patch)
tree06c14e37892aa30913fdd0601c946839d3486a2a /src
parent825aed11d267f7879ca8915eb2b0d154e0beb2d4 (diff)
downloademacs-12578d6aca2cc7182afdd070aa31c7aff6a3add8.tar.gz
emacs-12578d6aca2cc7182afdd070aa31c7aff6a3add8.zip
Change how (declare (modes store the data
* lisp/emacs-lisp/byte-run.el (byte-run--set-modes): Change from being a predicate to storing the modes. This allows using the modes for positive command discovery, too. * src/data.c (Fcommand_modes): Look at the `command-modes' symbol property, too.
Diffstat (limited to 'src')
-rw-r--r--src/data.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c
index ace859d2d0c..9af9131b123 100644
--- a/src/data.c
+++ b/src/data.c
@@ -957,9 +957,17 @@ The value, if non-nil, is a list of mode name symbols. */)
957 if (NILP (fun)) 957 if (NILP (fun))
958 return Qnil; 958 return Qnil;
959 959
960 /* Use a `command-modes' property if present, analogous to the
961 function-documentation property. */
960 fun = command; 962 fun = command;
961 while (SYMBOLP (fun)) 963 while (SYMBOLP (fun))
962 fun = Fsymbol_function (fun); 964 {
965 Lisp_Object modes = Fget (fun, Qcommand_modes);
966 if (!NILP (modes))
967 return modes;
968 else
969 fun = Fsymbol_function (fun);
970 }
963 971
964 if (COMPILEDP (fun)) 972 if (COMPILEDP (fun))
965 { 973 {