* 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.
(defalias 'byte-run--set-modes
#'(lambda (f _args &rest val)
(list 'function-put (list 'quote f)
- ''completion-predicate
- `(lambda (_ b)
- (command-completion-with-modes-p ',val b)))))
+ ''command-modes (list 'quote val))))
;; Add any new entries to info node `(elisp)Declare Form'.
(defvar defun-declarations-alist
if (NILP (fun))
return Qnil;
+ /* Use a `command-modes' property if present, analogous to the
+ function-documentation property. */
fun = command;
while (SYMBOLP (fun))
- fun = Fsymbol_function (fun);
+ {
+ Lisp_Object modes = Fget (fun, Qcommand_modes);
+ if (!NILP (modes))
+ return modes;
+ else
+ fun = Fsymbol_function (fun);
+ }
if (COMPILEDP (fun))
{