summaryrefslogtreecommitdiff
path: root/doc/lispref/functions.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/lispref/functions.texi')
-rw-r--r--doc/lispref/functions.texi32
1 files changed, 17 insertions, 15 deletions
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 2b2c9287d91..ff635fc54b2 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -498,13 +498,12 @@ indentation of the following lines is inside the string; what looks
nice in the source code will look ugly when displayed by the help
commands.
- You may wonder how the documentation string could be optional, since
-there are required components of the function that follow it (the body).
-Since evaluation of a string returns that string, without any side effects,
-it has no effect if it is not the last form in the body. Thus, in
-practice, there is no confusion between the first form of the body and the
-documentation string; if the only body form is a string then it serves both
-as the return value and as the documentation.
+ A documentation string must always be followed by at least one Lisp
+expression; otherwise, it is not a documentation string at all but the
+single expression of the body and used as the return value.
+When there is no meaningful value to return from a function, it is
+standard practice to return @code{nil} by adding it after the
+documentation string.
The last line of the documentation string can specify calling
conventions different from the actual function arguments. Write
@@ -982,8 +981,8 @@ lists) and call them using @code{funcall} or @code{apply}. Functions
that accept function arguments are often called @dfn{functionals}.
Sometimes, when you call a functional, it is useful to supply a no-op
-function as the argument. Here are two different kinds of no-op
-function:
+function as the argument. Here are three different kinds of no-op
+functions:
@defun identity argument
This function returns @var{argument} and has no side effects.
@@ -2066,9 +2065,10 @@ code) obey the advice and other calls (from C code) do not.
@defmac define-advice symbol (where lambda-list &optional name depth) &rest body
This macro defines a piece of advice and adds it to the function named
-@var{symbol}. The advice is an anonymous function if @var{name} is
-@code{nil} or a function named @code{symbol@@name}. See
-@code{advice-add} for explanation of other arguments.
+@var{symbol}. If @var{name} is non-nil, the advice is named
+@code{@var{symbol}@@@var{name}} and installed with the name @var{name}; otherwise,
+the advice is anonymous. See @code{advice-add} for explanation of
+other arguments.
@end defmac
@defun advice-add symbol where function &optional props
@@ -2077,10 +2077,12 @@ Add the advice @var{function} to the named function @var{symbol}.
(@pxref{Core Advising Primitives}).
@end defun
-@defun advice-remove symbol function
+@deffn Command advice-remove symbol function
Remove the advice @var{function} from the named function @var{symbol}.
-@var{function} can also be the @code{name} of a piece of advice.
-@end defun
+@var{function} can also be the @code{name} of a piece of advice. When
+called interactively, prompt for both an advised @var{function} and
+the advice to remove.
+@end deffn
@defun advice-member-p function symbol
Return non-@code{nil} if the advice @var{function} is already in the named