1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Improve documentation of 'declare' forms

* lisp/simple.el (read-extended-command-predicate): Mention the
'(declare completion ...' form in the doc string.

* doc/lispref/functions.texi (Declare Form): Clarify
'completion-predicate' and 'modes'; add cross-references.
(Bug#64045)
This commit is contained in:
Eli Zaretskii 2023-06-15 09:28:26 +03:00
parent c835758238
commit 70fc7c41ef
2 changed files with 14 additions and 7 deletions

View file

@ -2609,14 +2609,18 @@ be passed to @code{gv-define-setter}.
@item (completion @var{completion-predicate})
Declare @var{completion-predicate} as a function to determine whether
to include the symbol in the list of functions when asking for
completions in @kbd{M-x}. @var{completion-predicate} is called with
two parameters: The first parameter is the symbol, and the second is
the current buffer.
to include a function's symbol in the list of functions when asking
for completions in @kbd{M-x}. This predicate function will only be
called when @code{read-extended-command-predicate} is customized to
@code{command-completion-default-include-p}; by default the value of
@code{read-extended-command-predicate} is nil (@pxref{Interactive
Call, execute-extended-command}). The predicate
@var{completion-predicate} is called with two arguments: the
function's symbol and the current buffer.
@item (modes @var{modes})
Specify that this command is meant to be applicable for @var{modes}
only.
Specify that this command is meant to be applicable only to specified
@var{modes}. @xref{Command Modes}.
@item (interactive-args @var{arg} ...)
Specify the arguments that should be stored for @code{repeat-command}.