aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2024-10-27 13:16:36 +0200
committerEli Zaretskii2024-10-27 13:16:36 +0200
commitb0aaee93fde245b972a0d69b60328550f53bc043 (patch)
tree027474143244d079837c93577968747082d31c7e
parent299a1f240750595d7b0132aec5eb3a2b58c9d943 (diff)
downloademacs-b0aaee93fde245b972a0d69b60328550f53bc043.tar.gz
emacs-b0aaee93fde245b972a0d69b60328550f53bc043.zip
Update the documentation of void functions
* doc/lispref/functions.texi (Function Cells): * src/data.c (Ffboundp, Ffmakunbound, Fsymbol_function): Update documentation to the changes of how void functions are represented since Emacs 24.5. (Bug#73886)
-rw-r--r--doc/lispref/functions.texi24
-rw-r--r--src/data.c12
2 files changed, 18 insertions, 18 deletions
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 0131305525c..bfb8789d05b 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -1511,9 +1511,9 @@ indirect-function}.
1511This returns the object in the function cell of @var{symbol}. It does 1511This returns the object in the function cell of @var{symbol}. It does
1512not check that the returned object is a legitimate function. 1512not check that the returned object is a legitimate function.
1513 1513
1514If the function cell is void, the return value is @code{nil}. To 1514If the function cell is void, the return value is @code{nil}. It is
1515distinguish between a function cell that is void and one set to 1515impossible to distinguish between a function cell that is void and one
1516@code{nil}, use @code{fboundp} (see below). 1516set to @code{nil}.
1517 1517
1518@example 1518@example
1519@group 1519@group
@@ -1538,24 +1538,24 @@ that that symbol's function cell is @dfn{void}. In other words, the
1538function cell does not have any Lisp object in it. If you try to call 1538function cell does not have any Lisp object in it. If you try to call
1539the symbol as a function, Emacs signals a @code{void-function} error. 1539the symbol as a function, Emacs signals a @code{void-function} error.
1540 1540
1541 Note that void is not the same as @code{nil} or the symbol 1541 Unlike with void variables (@pxref{Void Variables}), a symbol's
1542@code{void}. The symbols @code{nil} and @code{void} are Lisp objects, 1542function cell that contains @code{nil} is indistinguishable from the
1543and can be stored into a function cell just as any other object can be 1543function's being void. Note that void is not the same as the symbol
1544(and @code{void} can be a valid function if you define it with 1544@code{void}: @code{void} can be a valid function if you define it with
1545@code{defun}). A void function cell contains no object whatsoever. 1545@code{defun}.
1546 1546
1547 You can test the voidness of a symbol's function definition with 1547 You can test the voidness of a symbol's function definition with
1548@code{fboundp}. After you have given a symbol a function definition, you 1548@code{fboundp}. After you have given a symbol a function definition, you
1549can make it void once more using @code{fmakunbound}. 1549can make it void once more using @code{fmakunbound}.
1550 1550
1551@defun fboundp symbol 1551@defun fboundp symbol
1552This function returns @code{t} if the symbol has an object in its 1552This function returns @code{t} if the symbol has a non-@code{nil} object
1553function cell, @code{nil} otherwise. It does not check that the object 1553in its function cell, @code{nil} otherwise. It does not check that the
1554is a legitimate function. 1554object is a legitimate function.
1555@end defun 1555@end defun
1556 1556
1557@defun fmakunbound symbol 1557@defun fmakunbound symbol
1558This function makes @var{symbol}'s function cell void, so that a 1558This function makes @var{symbol}'s function cell @code{nil}, so that a
1559subsequent attempt to access this cell will cause a 1559subsequent attempt to access this cell will cause a
1560@code{void-function} error. It returns @var{symbol}. (See also 1560@code{void-function} error. It returns @var{symbol}. (See also
1561@code{makunbound}, in @ref{Void Variables}.) 1561@code{makunbound}, in @ref{Void Variables}.)
diff --git a/src/data.c b/src/data.c
index 13b4593e005..bf83755bff3 100644
--- a/src/data.c
+++ b/src/data.c
@@ -756,7 +756,7 @@ global value outside of any lexical scope. */)
756 breaking backward compatibility, as some users of fboundp may 756 breaking backward compatibility, as some users of fboundp may
757 expect t in particular, rather than any true value. */ 757 expect t in particular, rather than any true value. */
758DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0, 758DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
759 doc: /* Return t if SYMBOL's function definition is not void. */) 759 doc: /* Return t if SYMBOL's function definition is neither void nor nil. */)
760 (Lisp_Object symbol) 760 (Lisp_Object symbol)
761{ 761{
762 CHECK_SYMBOL (symbol); 762 CHECK_SYMBOL (symbol);
@@ -782,12 +782,12 @@ See also `fmakunbound'. */)
782} 782}
783 783
784DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0, 784DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0,
785 doc: /* Make SYMBOL's function definition be void. 785 doc: /* Make SYMBOL's function definition be nil.
786Return SYMBOL. 786Return SYMBOL.
787 787
788If a function definition is void, trying to call a function by that 788If a function definition is nil or void, trying to call a function by
789name will cause a `void-function' error. For more details, see Info 789that name will cause a `void-function' error. For more details, see
790node `(elisp) Function Cells'. 790Info node `(elisp) Function Cells'.
791 791
792See also `makunbound'. */) 792See also `makunbound'. */)
793 (register Lisp_Object symbol) 793 (register Lisp_Object symbol)
@@ -800,7 +800,7 @@ See also `makunbound'. */)
800} 800}
801 801
802DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0, 802DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
803 doc: /* Return SYMBOL's function definition, or nil if that is void. */) 803 doc: /* Return SYMBOL's function definition, or nil if that is void or nil. */)
804 (Lisp_Object symbol) 804 (Lisp_Object symbol)
805{ 805{
806 CHECK_SYMBOL (symbol); 806 CHECK_SYMBOL (symbol);