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#69387: 30.0.50; A string shouldn't be both a docstring and a return value Date: Mon, 26 Feb 2024 13:17:25 -0500 Message-ID: References: <2D08AD76-59F7-41BE-9363-96677967034A@gmail.com> <4FCE8B7D-17D7-44E8-A764-A6047209CBE1@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32641"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Philip Kaludercic , Eli Zaretskii , 69387@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 26 19:25:58 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 1reffp-0008De-TZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Feb 2024 19:25:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reffW-0004SJ-J2; Mon, 26 Feb 2024 13:25:38 -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 1reffV-0004Rw-Dl for bug-gnu-emacs@gnu.org; Mon, 26 Feb 2024 13:25:37 -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 1reffV-0007B7-41 for bug-gnu-emacs@gnu.org; Mon, 26 Feb 2024 13:25:37 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reffu-0005DA-7x for bug-gnu-emacs@gnu.org; Mon, 26 Feb 2024 13:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Feb 2024 18:26:02 +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.170897191919900 (code B ref 69387); Mon, 26 Feb 2024 18:26:02 +0000 Original-Received: (at 69387) by debbugs.gnu.org; 26 Feb 2024 18:25:19 +0000 Original-Received: from localhost ([127.0.0.1]:54945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reffC-0005At-73 for submit@debbugs.gnu.org; Mon, 26 Feb 2024 13:25:18 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1refe0-00056S-Cg for 69387@debbugs.gnu.org; Mon, 26 Feb 2024 13:24:05 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 94BFA80A75; Mon, 26 Feb 2024 13:17:27 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1708971446; bh=NiRO679P507b+PCqLXpzapHTysv5f/8W4vT15e1swCY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LrfxeGeWymzieBssyTj9oKhw0P7mkeVLL2w9Odm7UaWXemu8g3Fo1a0oRzfbPbDhn muRQQkZJw8VrzTTUsGF1u9fWTEbxrf7zuZmiE4tOmrBppF17RNmzqGFXj+/LSncM+c KmsQZA6+ncNbGgnSLPN/N+2tsaU0yO8KTC/d63STTBVf5kMzDH3oIOtKL+t4pbHYHN QR+OB8yrI8WHhpo6GWmn4T7Wd7DG0tEiRqsbRXGj/DUAk6H2RWXiL3cjLPp2luxzO5 MylviAcsKy9H+x/cX11/tSMM75ZMbuFIjYNf4Kr75pFC1gvfvbgs7QbCzWCEZ52Dwj lXBgxZS38aV3Q== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 08A6780234; Mon, 26 Feb 2024 13:17:26 -0500 (EST) Original-Received: from pastel (unknown [45.72.205.238]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D129412023D; Mon, 26 Feb 2024 13:17:25 -0500 (EST) In-Reply-To: <4FCE8B7D-17D7-44E8-A764-A6047209CBE1@gmail.com> ("Mattias =?UTF-8?Q?Engdeg=C3=A5rd?="'s message of "Mon, 26 Feb 2024 19:04:25 +0100") 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:280700 Archived-At: >>> (defun (ARGS) "string") -> (defun (ARGS) "string" "string") >>> to preserve semantics (and the same for defmacro, cl-defun, etc). >> I still haven't seen any code that wants this behavior, so that's >> a definite no for me. > I presume you mean that `defun`s with a single string always want it to be > their doc string? That indeed seems to be the dominant use. These are the > few counter-examples that I could find: No, I mean that we should not keep the old dual-use semantics, even if it means some docstrings get temporarily "lost" until the code is fixed. As for whether (defun (ARGS) "string") should treat the string as a docstring or a return value, I'd rather keep it as a return value, so it's the same as for `lambda`. Another reason is because, the kind of failures it is likely to introduce is a lot more mild: it's much safer to remove a docstring than to change the return value. So far, the harder part of such a change (beside getting it accepted =F0=9F= =99=82) seems to be the font-lock highlighting. Stefan