From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#69387: 30.0.50; A string shouldn't be both a docstring and a return value Date: Tue, 5 Mar 2024 14:16:50 +0100 Message-ID: <74101BB1-B82C-4F6C-8AB1-47A131BC90E6@gmail.com> References: <2D08AD76-59F7-41BE-9363-96677967034A@gmail.com> <4FCE8B7D-17D7-44E8-A764-A6047209CBE1@gmail.com> <86bk7um4v1.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_5A42B810-900D-46C2-8D65-3FA797E83AF0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11557"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, 69387@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 05 14:18: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 1rhUh7-0002mS-JP for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Mar 2024 14:18:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhUgl-0006nB-Bf; Tue, 05 Mar 2024 08:18:35 -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 1rhUgi-0006mq-Oe for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2024 08:18:32 -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 1rhUgi-0007M9-Dz for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2024 08:18:32 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rhUhC-0003Ti-7g for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2024 08:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Mar 2024 13:19: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.170964471413334 (code B ref 69387); Tue, 05 Mar 2024 13:19:02 +0000 Original-Received: (at 69387) by debbugs.gnu.org; 5 Mar 2024 13:18:34 +0000 Original-Received: from localhost ([127.0.0.1]:46953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhUgk-0003Sz-92 for submit@debbugs.gnu.org; Tue, 05 Mar 2024 08:18:34 -0500 Original-Received: from mail-lj1-f169.google.com ([209.85.208.169]:49427) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhUgf-0003Si-2D for 69387@debbugs.gnu.org; Tue, 05 Mar 2024 08:18:32 -0500 Original-Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2d2509c66daso72306401fa.3 for <69387@debbugs.gnu.org>; Tue, 05 Mar 2024 05:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709644612; x=1710249412; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:from:to:cc:subject:date:message-id:reply-to; bh=swref9jxzr9T2bRluRBRukmh9VomYuCMRjYZYPawv5s=; b=gBp0rKRNHFBKFy2f0aMdLf0TUdkRK/Ju2hKePmNyrQTXJBnY+XNSqTKMLl9upwmQs9 vA/N/Q4gNJHA/ti44Leg96vngJR5t+tlLHzbKFR+4taLiyhUkmO8p7/0YMzh4zpctHaU /V2IINpiWfpQVk2Nfth7KIGtyurdyr9bncK99b0SQ3/UhqsjPXP/uAtNb68JrjgYA18v PKeZWGAdJf29S+cCQC4oP2cjLinsYvMOpLkDlZPoYZFEkCv2MWCGMU7p6bBhozlA1Ok+ px3y5Pf6oSaPKP8Fuytq8sW9WxvoOZDtQNHDInwIXiSZEjYTlKIyIbMYZ4KbWESCSw/n hYww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709644612; x=1710249412; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=swref9jxzr9T2bRluRBRukmh9VomYuCMRjYZYPawv5s=; b=h394OgrNKwRqIKygpr/Gj9AeaW0TvbboBIbg53tBWroudADMJ17PWmAkSgUpG4qSS8 EOTX2zlxENnYW4ceyG/pi9v4shxddQ7QOTDTUHWkxafh/l5+QfTcRVJdlz8wEItV/HY8 Xkd6+rlXf9vUfSli43e4ntJWV/MxeXrTccu0qDCJUCKkWBvMg8Ry5UIEzyyY4Er3eyEr Mlt/W/YpEOlskqRGzXOG7tmTY9PSiCwHVPmBmic3SLHluJ49zB91tpcDs/IUOZ48M5nT Gvo5k1kxTuhzb19jaFOt+fIUFm2Tdkx3/VFxKnCgV3DMnOHJKgpz10sdxo88sQ1nB0dZ aSww== X-Forwarded-Encrypted: i=1; AJvYcCVKfs6bVmB7lB4kimOcDMIUtxIyz6UcU5tDHgKDJdtb5qeWL6JYMhPhtLVWen6simyuLNMbvXoWpJK4ykYRgXi9i7ADf34= X-Gm-Message-State: AOJu0Yx6w/ycssnRYyAjEBKw/qyUxqUCgG21ojWGzGRoGGAieNYVRxvq q6Dt2yUfTJwnvgikKLHzqHc7qrTsZehS4S6vvJEshNUF2agTA6hX X-Google-Smtp-Source: AGHT+IF/69FgDbFpACdUIKqaVu2hwRbl5/XeFRHCSZ82cRTMvsUU21WEcyl2aGkuwkLbmceXsLqlXQ== X-Received: by 2002:a05:6512:61:b0:513:4acb:6ea7 with SMTP id i1-20020a056512006100b005134acb6ea7mr1271076lfo.33.1709644612067; Tue, 05 Mar 2024 05:16:52 -0800 (PST) Original-Received: from smtpclient.apple (c80-217-1-132.bredband.tele2.se. [80.217.1.132]) by smtp.gmail.com with ESMTPSA id c2-20020ac24142000000b00513021f5b96sm2173623lfi.59.2024.03.05.05.16.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2024 05:16:51 -0800 (PST) In-Reply-To: <86bk7um4v1.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.15) 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:281051 Archived-At: --Apple-Mail=_5A42B810-900D-46C2-8D65-3FA797E83AF0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 4 mars 2024 kl. 15.46 skrev Eli Zaretskii : > Do we need to say something about this change in NEWS? Yes, here is a complete patch. The cl-lib definition forms (cl-defun, cl-defsubst, cl-defmacro etc) are = unaffected by the change as they don't have the dual-use doc-string = problem. The doc-string mechanism change should be sound and safe. The warning is = only an annoyance for people writing code like (defun my-constant-fun () "some-useful-string") which isn't common but not necessarily bad style either, which would be = the main argument against the warning -- the programmer needs to add a = doc string or `nil` before the string to silence the compiler. It's more common to see no-op functions like (defun my-no-op-fun () "This function is unfinished.") and here it's probably a good idea to make the programmer be more = explicit about the return value. --Apple-Mail=_5A42B810-900D-46C2-8D65-3FA797E83AF0 Content-Disposition: attachment; filename=0001-Use-single-string-literal-as-return-value-not-doc-st.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Use-single-string-literal-as-return-value-not-doc-st.patch" Content-Transfer-Encoding: quoted-printable =46rom=2016e3e27d26ab5fcfd61c0e8fbd4aa2a5498058a0=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Wed,=2028=20Feb=202024=2012:05:19=20+0100=0A= Subject:=20[PATCH]=20Use=20single=20string=20literal=20as=20return=20= value,=20not=20doc=20string=0A=0AA=20function=20or=20macro=20body=20= consisting=20of=20a=20single=20string=20literal=20now=20only=0Auses=20it=20= as=20a=20return=20value.=20=20Previously,=20it=20was=20used=20as=20a=20= doc=20string=20as=0Awell=20which=20was=20never=20what=20the=20programmer=20= intended=20and=20had=20some=0Ainconvenient=20consequences=20(bug#69387).=0A= =0AThis=20change=20also=20adds=20a=20warning=20for=20uses=20of=20`defun`=20= and=20`defmacro`=20(but=0Anot=20plain=20`lambda`)=20that=20stand=20to=20= lose=20their=20doc=20string=20this=20way,=20to=0Aalert=20the=20= programmer=20of=20a=20possible=20mistake.=0A=0A*=20= lisp/emacs-lisp/bytecomp.el=20(byte-compile-lambda):=0ADon't=20use=20a=20= lone=20string=20literal=20as=20doc=20string.=0A*=20= lisp/emacs-lisp/byte-run.el=20(byte-run--parse-body):=20Add=20warning=0A= for=20`defun`=20and=20`defmacro`.=0A*=20doc/lispref/functions.texi=20= (Function=20Documentation):=20Update=20manual.=0A*=20etc/NEWS:=20= Announce=20the=20change=20and=20the=20warning.=0A---=0A=20= doc/lispref/functions.texi=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20|=2013=20++-=0A=20etc/NEWS=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20|=2028=20++++++=0A=20lisp/emacs-lisp/byte-run.el=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20|=2092=20++++++++++---------=0A=20= lisp/emacs-lisp/bytecomp.el=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20|=20=209=20+-=0A=20.../bytecomp-resources/fun-attr-warn.el=20=20= =20=20=20=20=20|=2011=20++-=0A=20.../warn-wide-docstring-defun.el=20=20=20= =20=20=20=20=20=20=20=20=20=20=20|=20=203=20+-=0A=20= test/lisp/emacs-lisp/bytecomp-tests.el=20=20=20=20=20=20=20=20|=20=204=20= +-=0A=207=20files=20changed,=20101=20insertions(+),=2059=20deletions(-)=0A= =0Adiff=20--git=20a/doc/lispref/functions.texi=20= b/doc/lispref/functions.texi=0Aindex=20344b3ff3a50..ff635fc54b2=20100644=0A= ---=20a/doc/lispref/functions.texi=0A+++=20b/doc/lispref/functions.texi=0A= @@=20-498,13=20+498,12=20@@=20Function=20Documentation=0A=20nice=20in=20= the=20source=20code=20will=20look=20ugly=20when=20displayed=20by=20the=20= help=0A=20commands.=0A=20=0A-=20=20You=20may=20wonder=20how=20the=20= documentation=20string=20could=20be=20optional,=20since=0A-there=20are=20= required=20components=20of=20the=20function=20that=20follow=20it=20(the=20= body).=0A-Since=20evaluation=20of=20a=20string=20returns=20that=20= string,=20without=20any=20side=20effects,=0A-it=20has=20no=20effect=20if=20= it=20is=20not=20the=20last=20form=20in=20the=20body.=20=20Thus,=20in=0A= -practice,=20there=20is=20no=20confusion=20between=20the=20first=20form=20= of=20the=20body=20and=20the=0A-documentation=20string;=20if=20the=20only=20= body=20form=20is=20a=20string=20then=20it=20serves=20both=0A-as=20the=20= return=20value=20and=20as=20the=20documentation.=0A+=20=20A=20= documentation=20string=20must=20always=20be=20followed=20by=20at=20least=20= one=20Lisp=0A+expression;=20otherwise,=20it=20is=20not=20a=20= documentation=20string=20at=20all=20but=20the=0A+single=20expression=20= of=20the=20body=20and=20used=20as=20the=20return=20value.=0A+When=20= there=20is=20no=20meaningful=20value=20to=20return=20from=20a=20= function,=20it=20is=0A+standard=20practice=20to=20return=20@code{nil}=20= by=20adding=20it=20after=20the=0A+documentation=20string.=0A=20=0A=20=20=20= The=20last=20line=20of=20the=20documentation=20string=20can=20specify=20= calling=0A=20conventions=20different=20from=20the=20actual=20function=20= arguments.=20=20Write=0Adiff=20--git=20a/etc/NEWS=20b/etc/NEWS=0Aindex=20= 06856602ea8..c31ebaea74b=20100644=0A---=20a/etc/NEWS=0A+++=20b/etc/NEWS=0A= @@=20-1801,6=20+1801,17=20@@=20Tree-sitter=20conditionally=20sets=20= 'forward-sexp-function'=20for=20major=20modes=0A=20that=20have=20defined=20= 'sexp'=20in=20'treesit-thing-settings'=20to=20enable=0A=20sexp-related=20= motion=20commands.=0A=20=0A++++=0A+**=20Returned=20strings=20are=20never=20= docstrings=0A+Functions=20and=20macros=20whose=20body=20consists=20of=20= a=20single=20string=20literal=20now=0A+only=20return=20that=20string;=20= it=20is=20not=20used=20as=20a=20docstring.=0A+Previously,=20that=20= string=20was=20used=20as=20both=20a=20docstring=20and=20return=20value,=0A= +which=20was=20never=20what=20the=20programmer=20wanted.=20=20This=20= change=20applies=20to=0A+'defun',=20'defsubst',=20'defmacro'=20and=20= 'lambda'=20forms.=0A+If=20you=20want=20the=20string=20to=20be=20a=20= docstring,=20add=20an=20explicit=20return=20value.=0A+=0A+See=20related=20= warning=20below.=0A+=0A=20**=20New=20or=20changed=20byte-compilation=20= warnings=0A=20=0A=20---=0A@@=20-1954,6=20+1965,23=20@@=20name=20= 'ignored-return-value'.=0A=20The=20warning=20will=20only=20be=20issued=20= for=20calls=20to=20functions=20declared=0A=20'important-return-value'=20= or=20'side-effect-free'=20(but=20not=20'error-free').=0A=20=0A+---=0A= +***=20Warn=20about=20strings=20that=20look=20like=20docstrings=20but=20= are=20just=20returned=0A+The=20compiler=20now=20warns=20about=20= functions=20and=20macros=20where=20the=20body=0A+consists=20of=20a=20= single=20string=20literal,=20which=20is=20now=20used=20as=20a=20return=20= value=0A+only,=20not=20as=20a=20docstring.=20=20Example:=0A+=0A+=20=20=20= =20(defun=20sing-a-song=20()=0A+=20=20=20=20=20=20"Sing=20a=20song.")=0A= +=0A+The=20above=20function=20returns=20the=20string=20'"Sing=20a=20= song."'=20but=20has=20no=0A+docstring.=20=20This=20warning=20is=20= emitted=20for=20'defun',=20'defsubst'=20and=0A+'defmacro'=20= declarations,=20not=20'lambda'=20forms.=0A+=0A+To=20silence=20the=20= warning,=20assuming=20a=20string=20literal=20should=20be=20returned,=0A= +add=20an=20explicit=20docstring=20(or=20'nil')=20before=20the=20= returned=20string.=0A+If=20the=20string=20should=20be=20a=20doc=20= string,=20return=20something=20else=20(like=20'nil').=0A+=0A=20---=0A=20= ***=20Warn=20about=20docstrings=20that=20contain=20control=20characters.=0A= =20The=20compiler=20now=20warns=20about=20docstrings=20with=20control=20= characters=20other=0Adiff=20--git=20a/lisp/emacs-lisp/byte-run.el=20= b/lisp/emacs-lisp/byte-run.el=0Aindex=20cc176821026..663f405cecd=20= 100644=0A---=20a/lisp/emacs-lisp/byte-run.el=0A+++=20= b/lisp/emacs-lisp/byte-run.el=0A@@=20-263,49=20+263,57=20@@=20= 'byte-run--set-no-font-lock-keyword=0A=20(defalias=20= 'byte-run--parse-body=0A=20=20=20#'(lambda=20(body=20allow-interactive)=0A= =20=20=20=20=20=20=20"Decompose=20BODY=20into=20(DOCSTRING=20DECLARE=20= INTERACTIVE=20BODY-REST=20WARNINGS)."=0A-=20=20=20=20=20=20(let*=20((top=20= body)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20(docstring=20nil)=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20(declare-form=20nil)=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20(interactive-form=20nil)=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20(warnings=20nil)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= (warn=20#'(lambda=20(msg=20form)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(push=20(macroexp-warn-and-return=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(format-message=20msg)=20nil=20nil=20t=20form)=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= warnings))))=0A-=20=20=20=20=20=20=20=20(while=0A-=20=20=20=20=20=20=20=20= =20=20=20=20(and=20body=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(let*=20((form=20(car=20body))=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(head=20(car-safe=20form)))=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cond=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((or=20(and=20(stringp=20= form)=20(cdr=20body))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(eq=20head=20:documentation))=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cond=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(docstring=20(funcall=20= warn=20"More=20than=20one=20doc=20string"=20top))=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(declare-form=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(funcall=20warn=20= "Doc=20string=20after=20`declare'"=20declare-form))=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(interactive-form=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(funcall=20= warn=20"Doc=20string=20after=20`interactive'"=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= interactive-form))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(t=20(setq=20docstring=20form)))=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20t)=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20((eq=20head=20'declare)=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cond=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(declare-form=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(funcall=20warn=20= "More=20than=20one=20`declare'=20form"=20form))=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(interactive-form=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(funcall=20warn=20= "`declare'=20after=20`interactive'"=20form))=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(t=20(setq=20declare-form=20= form)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= t)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((eq=20= head=20'interactive)=0A+=20=20=20=20=20=20(if=20(and=20(null=20(cdr=20= body))=20(stringp=20(car=20body)))=0A+=20=20=20=20=20=20=20=20=20=20= (list=20nil=20nil=20nil=20body=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(list=20(macroexp-warn-and-return=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20"Single=20string=20treated=20= as=20return=20value,=20not=20doc=20string"=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20nil=20nil=20t=20body)))=0A+=20=20= =20=20=20=20=20=20(let*=20((top=20body)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(docstring=20nil)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(declare-form=20nil)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (interactive-form=20nil)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (warnings=20nil)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(warn=20= #'(lambda=20(msg=20form)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(push=20(macroexp-warn-and-return=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(format-message=20msg)=20nil=20nil=20t=20form)=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20warnings))))=0A+=20=20=20=20=20=20=20=20=20=20(while=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(and=20body=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(let*=20((form=20(car=20body))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (head=20(car-safe=20form)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(cond=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20((not=20allow-interactive)=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(funcall=20warn=20"No=20= `interactive'=20form=20allowed=20here"=20form))=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(interactive-form=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(funcall=20warn=20= "More=20than=20one=20`interactive'=20form"=20form))=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(t=20(setq=20= interactive-form=20form)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20t))))=0A-=20=20=20=20=20=20=20=20=20=20(setq=20body=20= (cdr=20body)))=0A-=20=20=20=20=20=20=20=20(list=20docstring=20= declare-form=20interactive-form=20body=20warnings))))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((or=20(and=20(stringp=20= form)=20(cdr=20body))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(eq=20head=20:documentation))=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cond=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (docstring=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(funcall=20warn=20"More=20than=20one=20doc=20string"=20= top))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(declare-form=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(funcall=20warn=20"Doc=20string=20after=20= `declare'"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20declare-form))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (interactive-form=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(funcall=20warn=20"Doc=20string=20after=20= `interactive'"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20interactive-form))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(t=20= (setq=20docstring=20form)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20t)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20((eq=20head=20'declare)=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cond=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(declare-form=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (funcall=20warn=20"More=20than=20one=20`declare'=20form"=20form))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (interactive-form=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(funcall=20warn=20"`declare'=20after=20= `interactive'"=20form))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(t=20(setq=20declare-form=20form)))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20t)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((eq=20head=20= 'interactive)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(cond=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20((not=20allow-interactive)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(funcall=20warn=20"No=20= `interactive'=20form=20allowed=20here"=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= form))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(interactive-form=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(funcall=20warn=20"More=20than=20one=20= `interactive'=20form"=20form))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(t=20(setq=20interactive-form=20form)))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= t))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20(setq=20body=20(cdr=20= body)))=0A+=20=20=20=20=20=20=20=20=20=20(list=20docstring=20= declare-form=20interactive-form=20body=20warnings)))))=0A=20=0A=20= (defalias=20'byte-run--parse-declarations=0A=20=20=20#'(lambda=20(name=20= arglist=20clauses=20construct=20declarations-alist)=0Adiff=20--git=20= a/lisp/emacs-lisp/bytecomp.el=20b/lisp/emacs-lisp/bytecomp.el=0Aindex=20= c3355eedd75..cf0e6d600dd=20100644=0A---=20a/lisp/emacs-lisp/bytecomp.el=0A= +++=20b/lisp/emacs-lisp/bytecomp.el=0A@@=20-3061,12=20+3061,11=20@@=20= byte-compile-lambda=0A=20=09=20=20(append=20(if=20(not=20= lexical-binding)=20arglistvars)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20byte-compile-bound-variables))=0A=20=09=20(body=20(cdr=20= (cdr=20fun)))=0A-=09=20(doc=20(if=20(stringp=20(car=20body))=0A+=20=20=20= =20=20=20=20=20=20;;=20Treat=20a=20final=20string=20literal=20as=20a=20= value,=20not=20a=20doc=20string.=0A+=09=20(doc=20(if=20(and=20(cdr=20= body)=20(stringp=20(car=20body)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(prog1=20(car=20body)=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20;;=20Discard=20the=20doc=20string=20from=20= the=20body=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20unless=20it=20is=20the=20last=20element=20of=20the=20body.=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20(cdr=20body)=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setq=20body=20(cdr=20body))))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Discard=20the=20doc=20string=20from=20the=20= body.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setq=20body=20(cdr=20body)))))=0A=20=09=20(int=20(assq=20'interactive=20= body))=0A=20=20=20=20=20=20=20=20=20=20command-modes)=0A=20=20=20=20=20= (when=20lexical-binding=0Adiff=20--git=20= a/test/lisp/emacs-lisp/bytecomp-resources/fun-attr-warn.el=20= b/test/lisp/emacs-lisp/bytecomp-resources/fun-attr-warn.el=0Aindex=20= be907b32f47..9bec23a81e3=20100644=0A---=20= a/test/lisp/emacs-lisp/bytecomp-resources/fun-attr-warn.el=0A+++=20= b/test/lisp/emacs-lisp/bytecomp-resources/fun-attr-warn.el=0A@@=20-42,9=20= +42,6=20@@=20faw-doc-decl-int-code=0A=20=0A=20;;=20Correct=20(last=20= string=20is=20return=20value)=0A=20=0A-(defun=20faw-str=20()=0A-=20=20= "something")=0A-=0A=20(defun=20faw-decl-str=20()=0A=20=20=20(declare=20= (pure=20t))=0A=20=20=20"something")=0A@@=20-63,6=20+60,9=20@@=20= faw-doc-str=0A=20=20=20"something=20else")=0A=20=0A=20=0A+=0A+=0A+=0A=20= ;;=20Incorrect=20(bad=20order)=0A=20=0A=20(defun=20faw-int-decl-code=20= (x)=0A@@=20-264,3=20+264,8=20@@=20faw-doc-int-decl-int-code=0A=20=20=20= (declare=20(pure=20t))=0A=20=20=20(interactive=20"p")=0A=20=20=20(print=20= x))=0A+=0A+;;=20Incorrect=20(ambiguous=20string)=0A+=0A+(defun=20faw-str=20= ()=0A+=20=20"something")=0Adiff=20--git=20= a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el=20= b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el=0A= index=2094b0e80c979..571f7f6f095=20100644=0A---=20= a/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el=0A= +++=20= b/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defun.el=0A= @@=20-1,3=20+1,4=20@@=0A=20;;;=20-*-=20lexical-binding:=20t=20-*-=0A=20= (defun=20foo=20()=0A-=20=20= "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxx")=0A+=20=20= "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxx"=0A+=20=20nil)=0Adiff=20--git=20= a/test/lisp/emacs-lisp/bytecomp-tests.el=20= b/test/lisp/emacs-lisp/bytecomp-tests.el=0Aindex=20= 26408e8685a..f95c4084bf4=20100644=0A---=20= a/test/lisp/emacs-lisp/bytecomp-tests.el=0A+++=20= b/test/lisp/emacs-lisp/bytecomp-tests.el=0A@@=20-2052,7=20+2052,9=20@@=20= bytecomp-fun-attr-warn=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "258:4:=20Warning:=20More=20than=20one=20`interactive'=20form"=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20"257:4:=20Warning:=20`declare'=20= after=20`interactive'"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "265:4:=20Warning:=20More=20than=20one=20`interactive'=20form"=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20"264:4:=20Warning:=20`declare'=20= after=20`interactive'")))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "264:4:=20Warning:=20`declare'=20after=20`interactive'"=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20"270:2:=20Warning:=20Single=20string=20= treated=20as=20return=20value,=20not=20doc=20string"=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20)))=0A=20=20=20=20=20=20=20=20=20(goto-char=20= (point-min))=0A=20=20=20=20=20=20=20=20=20(let=20((actual=20nil))=0A=20=20= =20=20=20=20=20=20=20=20=20(while=20(re-search-forward=0A--=20=0A2.32.0=20= (Apple=20Git-132)=0A=0A= --Apple-Mail=_5A42B810-900D-46C2-8D65-3FA797E83AF0--