From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69387: 30.0.50; A string shouldn't be both a docstring and a return value Date: Sun, 25 Feb 2024 19:13:09 +0200 Message-ID: <86jzmswjq2.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8546"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69387@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 25 18:26:04 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 1reIGI-0001yF-Sj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Feb 2024 18:26:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reIFz-0000jR-4J; Sun, 25 Feb 2024 12:25:43 -0500 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 1reIFv-0000i0-63 for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 12:25:39 -0500 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 1reIFu-0005WZ-RC for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 12:25:38 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reIGJ-0005uS-K8 for bug-gnu-emacs@gnu.org; Sun, 25 Feb 2024 12:26:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Feb 2024 17:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69387 X-GNU-PR-Package: emacs Original-Received: via spool by 69387-submit@debbugs.gnu.org id=B69387.170888192122557 (code B ref 69387); Sun, 25 Feb 2024 17:26:03 +0000 Original-Received: (at 69387) by debbugs.gnu.org; 25 Feb 2024 17:25:21 +0000 Original-Received: from localhost ([127.0.0.1]:32810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reIFc-0005rb-Q3 for submit@debbugs.gnu.org; Sun, 25 Feb 2024 12:25:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reI4N-0005JT-9g for 69387@debbugs.gnu.org; Sun, 25 Feb 2024 12:13:44 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reI3s-0003Jj-Ss; Sun, 25 Feb 2024 12:13:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=zaTKNhYolt9c7j8gBSGebczq3OHvg3NsxyyH4PhoOxg=; b=jx2bps1r2Q5J aguezDlk+kvqi1uU/qr1A70+8A8FC3a2yYeSJZJr1ptwg4nLT0Y5WCwb61l1JZe58YqKQ0jHovEi8 9UEUM/rb+QXJpmgfUt3egzrWl5ypdG+aeHzm31ScRj5QTDqftPFWLLvPk9rNjznGdPEl4H14TBU2v 2cYe6Ns3VHg8meksE2V7Ui7DG/EiXs7jqA0/NxPmeSBCdXgBuMIjd5QDpcLwi47hdU+tI8JjtA6gE X/dZdBNK6JoV+ute457l9Vc80dvSive7zSC3pvgju6tCmulzvXoSMKbBo6QCUUUrHsuwn6x4SvlTj xNI3Yhxvs9iku4l0Gn//fQ==; In-Reply-To: (bug-gnu-emacs@gnu.org) 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:280626 Archived-At: > Cc: monnier@iro.umontreal.ca > Date: Sun, 25 Feb 2024 11:29:45 -0500 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Currently, ELisp defines > > (lambda (blabla) "Help!") > > as a function that returns "Help!" *and* whose docstring is "Help!". > As seen in commit eeb89a5cb292bffe40ba7d0b0cf81f82f8452bf8, it can be > a source of annoyance as well. > > I cannot remember finding source code which makes use of this "feature". > My impression is that our docs document this behavior simply because > that's how it happened to work rather than how it should work. > This is documented in the texinfo under "Function Documentation" where > it says: > > [... > 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. > > I think we should change that to say that > > if the only body form is a string then it serves as the return value > and not as the documentation. > > This will/would require a few changes to `macroexp.el` and > `bytecomp.el`, but it should be minor. It shouldn't introduce any > significant breakage either because the only effect will be to make it > so some functions won't have a docstring any more, but most (all?) of > those function never expected to have a docstring in the first place. Here again we are changing age-old (mis)features, which some code somewhere probably relies upon. Why? because a newly-introduced byte-compilation warning erroneously flagged that as a mistake in the doc string. My vote is to leave this alone.