From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73886: 29.4; Confusing info about void function cells in Emacs Lisp manual Date: Sun, 27 Oct 2024 10:59:23 -0400 Message-ID: References: <86ldykj8a4.fsf@gnu.org> <86frorjqs5.fsf@gnu.org> <864j4xaj6l.fsf@gnu.org> <86msip8wq0.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9317"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Ulrich =?UTF-8?Q?M=C3=BCller?= , 73886-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 27 16:00:57 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t54lF-0002FB-9a for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Oct 2024 16:00:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t54ko-00006j-5V; Sun, 27 Oct 2024 11:00:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t54km-00006P-FV for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 11:00:28 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t54km-0007ZF-68 for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 11:00:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=9QGBw7bMAeK0cEXbjz2/AZ37saFmt9ac60tAh7PLGsA=; b=vWTbforNpQYadHDsMP+Ut4VOuQaC4SKeaVn+fxtgtxcZf4tv8+wcBTscdNv4DIzoRer5+AKja3mvqHZVu5g4mgZPOQSE8drSMJ89/phLits2mRV4PKY9hFO1ePGy/n7omGUrJP2tOIrVV5rDrIJvcskc/w2Snz4LvAllp3NqQNenLlyCJAnHcQj5ylWUcB1UlnIqILQTE0B5Be+Q9AGONYtf5q/CAT8oCsL1tSVYKN91ZzSORC4741sQipYB+qvr9M4U7ko3nCh010nNqfhVgscWTVgFqyEY7XGLNcL3rZBVpMnkx2YBE2fpcYLo5P+x3SpkMpP/hwstLvRR4dofQQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t54lJ-0002dv-Vn for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 11:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2024 15:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73886 X-GNU-PR-Package: emacs Original-Received: via spool by 73886-done@debbugs.gnu.org id=D73886.17300412199741 (code D ref 73886); Sun, 27 Oct 2024 15:01:01 +0000 Original-Received: (at 73886-done) by debbugs.gnu.org; 27 Oct 2024 15:00:19 +0000 Original-Received: from localhost ([127.0.0.1]:45914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t54kc-0002X3-JJ for submit@debbugs.gnu.org; Sun, 27 Oct 2024 11:00:19 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t54kW-0002Va-Dg for 73886-done@debbugs.gnu.org; Sun, 27 Oct 2024 11:00:15 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0C6BB100180; Sun, 27 Oct 2024 10:59:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1730041165; bh=SfgFE0pj0T0iL0seOlzwIcmly0QLqjYbD1CUxddbUWY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=K3wwqGV8Q6/VptsUr8DOD7ywUvIrdOOP1b3EPgk88fu9g6598kNo3ROppcWj6GeNu IiZzWBxiDzemUDTS5sSY6TQVH1yfPKN04TzkcZ+mYARUr159IrO+L5t7CHSoH172IR FG+mhnkfGflnR97iP2cmphwI5B2IYYsJYHUpg96SjD77rPTKIzF6wkDrRS4ZIGrtRr uLIDGpzh5VnLuUnDNWzFNjME45VoZYah1FYdTproDTrTzM3Lyj1oehFYg9QVCOOrwq Bj6/ISthCV/0wk4LX09xkNdApq2WXqiBeMD05BStXYriRLuY6zNQ87qzjm9ikiAZvs vy+rSdlAuJeFg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0B4D5100043; Sun, 27 Oct 2024 10:59:25 -0400 (EDT) Original-Received: from pastel (69-196-161-60.dsl.teksavvy.com [69.196.161.60]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D0013120418; Sun, 27 Oct 2024 10:59:24 -0400 (EDT) In-Reply-To: <86msip8wq0.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 27 Oct 2024 16:08:23 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294366 Archived-At: >> > 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);