diff options
Diffstat (limited to 'doc/lispref/functions.texi')
-rw-r--r-- | doc/lispref/functions.texi | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 414035f684b..77d1465c876 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -863,6 +863,10 @@ This function returns @var{argument} and has no side effects. This function ignores any @var{arguments} and returns @code{nil}. @end defun +@defun always &rest arguments +This function ignores any @var{arguments} and returns @code{t}. +@end defun + Some functions are user-visible @dfn{commands}, which can be called interactively (usually by a key sequence). It is possible to invoke such a command exactly as though it was called interactively, by using @@ -1177,7 +1181,7 @@ This form defines a method like @code{cl-defmethod} does. @end table @end defmac -@defmac cl-defmethod name [qualifier] arguments [&context (expr spec)@dots{}] &rest [docstring] body +@defmac cl-defmethod name [extra] [qualifier] arguments [&context (expr spec)@dots{}] &rest [docstring] body This macro defines a particular implementation for the generic function called @var{name}. The implementation code is given by @var{body}. If present, @var{docstring} is the documentation string @@ -1263,6 +1267,10 @@ Parent type: @code{array}. @item font-object @end table +The optional @var{extra} element, expressed as @samp{:extra +@var{string}}, allows you to add more methods, distinguished by +@var{string}, for the same specializers and qualifiers. + The optional @var{qualifier} allows combining several applicable methods. If it is not present, the defined method is a @dfn{primary} method, responsible for providing the primary implementation of the @@ -1284,9 +1292,6 @@ This auxiliary method will run @emph{instead} of the primary method. The most specific of such methods will be run before any other method. Such methods normally use @code{cl-call-next-method}, described below, to invoke the other auxiliary or primary methods. -@item :extra @var{string} -This allows you to add more methods, distinguished by @var{string}, -for the same specializers and qualifiers. @end table Functions defined using @code{cl-defmethod} cannot be made @@ -2309,6 +2314,16 @@ form @code{(lambda (@var{arg}) @var{body})} in which case that function will additionally have access to the macro (or function)'s arguments and it will 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. + +@item (modes @var{modes}) +Specify that this command is meant to be applicable for @var{modes} +only. @end table @end defmac @@ -2406,11 +2421,12 @@ opposed to an unspecified one). @cindex safety of functions Some major modes, such as SES, call functions that are stored in user -files. (@inforef{Top, ,ses}, for more information on SES@.) User -files sometimes have poor pedigrees---you can get a spreadsheet from -someone you've just met, or you can get one through email from someone -you've never met. So it is risky to call a function whose source code -is stored in a user file until you have determined that it is safe. +files. (@xref{Top, Simple Emacs Spreadsheet,,ses}, for more +information on SES@.) User files sometimes have poor pedigrees---you +can get a spreadsheet from someone you've just met, or you can get one +through email from someone you've never met. So it is risky to call a +function whose source code is stored in a user file until you have +determined that it is safe. @defun unsafep form &optional unsafep-vars Returns @code{nil} if @var{form} is a @dfn{safe} Lisp expression, or |