From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "Ulrich Müller" <ulm@gentoo.org>, 73886-done@debbugs.gnu.org
Subject: bug#73886: 29.4; Confusing info about void function cells in Emacs Lisp manual
Date: Sun, 27 Oct 2024 10:59:23 -0400 [thread overview]
Message-ID: <jwvldy9ppwq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86msip8wq0.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 27 Oct 2024 16:08:23 +0200")
>> > Thanks, I've now updated the documentation, and I'm closing this bug.
>> TBH, I find the new wording still confusing: "It is impossible to
>> distinguish between a function cell that is void and one set to nil."
>> After commit eadf1faa3cb5eea8c25a5166a9a97ebd63525c56 there are no void
>> function cells any more.
> A function that was not defined at all is void.
How 'bout the patch below, which tries to eliminate the notion that
a function cell ever contains "void", reducing "void function" to just
a terminology to describe the nil value in function cells?
Stefan
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index bfb8789d05b..3a6da5c31e6 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -1511,10 +1511,6 @@ Function Cells
This returns the object in the function cell of @var{symbol}. It does
not check that the returned object is a legitimate function.
-If the function cell is void, the return value is @code{nil}. It is
-impossible to distinguish between a function cell that is void and one
-set to @code{nil}.
-
@example
@group
(defun bar (n) (+ n 2))
@@ -1533,9 +1529,9 @@ Function Cells
@end defun
@cindex void function cell
- If you have never given a symbol any function definition, we say
-that that symbol's function cell is @dfn{void}. In other words, the
-function cell does not have any Lisp object in it. If you try to call
+ If you have never given a symbol any function definition, its function
+cell contains the default value @code{nil} and we say
+that that symbol's function cell is @dfn{void}. If you try to call
the symbol as a function, Emacs signals a @code{void-function} error.
Unlike with void variables (@pxref{Void Variables}), a symbol's
diff --git a/src/data.c b/src/data.c
index bf83755bff3..904eaf35c1a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -756,7 +756,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
breaking backward compatibility, as some users of fboundp may
expect t in particular, rather than any true value. */
DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
- doc: /* Return t if SYMBOL's function definition is neither void nor nil. */)
+ doc: /* Return t if SYMBOL's function definition is not nil. */)
(Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
@@ -785,7 +785,7 @@ DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0,
doc: /* Make SYMBOL's function definition be nil.
Return SYMBOL.
-If a function definition is nil or void, trying to call a function by
+If a function definition is nil, trying to call a function by
that name will cause a `void-function' error. For more details, see
Info node `(elisp) Function Cells'.
@@ -800,7 +800,7 @@ DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0,
}
DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
- doc: /* Return SYMBOL's function definition, or nil if that is void or nil. */)
+ doc: /* Return SYMBOL's function definition. */)
(Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
next prev parent reply other threads:[~2024-10-27 14:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-19 14:37 bug#73886: 29.4; Confusing info about void function cells in Emacs Lisp manual Ulrich Müller
2024-10-19 17:45 ` Eli Zaretskii
2024-10-20 2:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-20 5:18 ` Eli Zaretskii
2024-10-20 16:56 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 11:17 ` Eli Zaretskii
2024-10-27 13:40 ` Ulrich Müller
2024-10-27 14:08 ` Eli Zaretskii
2024-10-27 14:59 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-10-27 16:50 ` Eli Zaretskii
2024-10-27 17:10 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 17:20 ` Eli Zaretskii
2024-10-27 18:53 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-19 19:08 ` Andreas Schwab
2024-10-19 21:07 ` Ulrich Müller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvldy9ppwq.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=73886-done@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=ulm@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.