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#66636: Move lexical-binding warning from checkdoc to byte-compiler Date: Thu, 19 Oct 2023 13:48:21 +0200 Message-ID: <48764CD1-C80F-4613-9848-BD8CA9203A40@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_1B23E174-97EC-4B15-B787-A6600272D218" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35872"; mail-complaints-to="usenet@ciao.gmane.io" To: 66636@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 19 13:49:50 2023 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 1qtRXB-0009Eg-RM for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Oct 2023 13:49:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtRX0-0002EG-8S; Thu, 19 Oct 2023 07:49:38 -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 1qtRWx-0002DQ-TP for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 07:49:36 -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 1qtRWx-0004tg-Iz for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 07:49:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtRXN-0004RC-Lv for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 07:50:01 -0400 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: Thu, 19 Oct 2023 11:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66636 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Emacs Bug Report Original-Received: via spool by submit@debbugs.gnu.org id=B.169771615116982 (code B ref -1); Thu, 19 Oct 2023 11:50:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Oct 2023 11:49:11 +0000 Original-Received: from localhost ([127.0.0.1]:35955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtRWZ-0004Pp-Ai for submit@debbugs.gnu.org; Thu, 19 Oct 2023 07:49:11 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:44246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtRWV-0004Og-EH for submit@debbugs.gnu.org; Thu, 19 Oct 2023 07:49:10 -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 1qtRVu-0000oU-0N for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 07:48:32 -0400 Original-Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtRVs-0003Jp-3B for bug-gnu-emacs@gnu.org; Thu, 19 Oct 2023 07:48:29 -0400 Original-Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-507973f3b65so10138214e87.3 for ; Thu, 19 Oct 2023 04:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697716103; x=1698320903; darn=gnu.org; h=to:date:message-id:subject:mime-version:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=XZrHtNE2O7LuXE5T39T9MORhyBhl4EGmLyicKuWceSk=; b=Cd+7DGh13Fqz4k0GGvL8OPJnozyXugYetFoA/hrgf6vQWBudcoIiGpNrHr5lsVoGT3 pO0oj+x9Arb+29sD9PejEcrrhsnrla0gkzBIINy7RE3LlmEDVMAlOTbeHNdtiXhIyD5C byZBy7026JWuIblYB94fiCsSuYAVR5y31T0XXOxc9vpiuYXjjr0MLVOJ6MUnV3Srv2RY 5nKOVpZeiU1DIMEvh1xPYSLRaRRvDZF6pNc8vF0M+NmrieIXiDxh6mg/kGgot0KbWpAP 3Bw9IMeUBKUN77cC2zfpLJvoFlfe7rj2eZdbAJrgaU6ovyRa4TFpJYY2/viEiHn5Kaea AbTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697716103; x=1698320903; h=to:date:message-id:subject:mime-version:from:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XZrHtNE2O7LuXE5T39T9MORhyBhl4EGmLyicKuWceSk=; b=eXDo8MenwsseYFOFq7DjgI5PBhgsJRkT3kmb4cKgSzem5oDs1WM4ysyDJWX+Fhx2/T FDnQVVa4Mgib9DUxCUNwVYhTpsrzfqFbALTwmMXOYz3bqfs/oW7Pbx/4a7tLG66YIy9Q WlgHBYtNiSNPzujuJtJl0a6y8HR7GeZkWerI0WzB5Jojt8CS1GANb3wUb+JpY2mj59hM YivmdhSQVe67h1IvMrOuNlIxRRN/yQg9gLviFGRkBZdAVCyDn6ki3xiVoE9cFZUGkVUy o7vfOVT88YbHAlLogQqjAN4RWc0k1IOFGlzGiikExFeVguUVDllSgIr+cQASN6L8qiUf liuQ== X-Gm-Message-State: AOJu0YzY5/qHnamqQnZP1H0SJumBKTVOUSZhyYuM5nhNzyQRkEh1SWli adGRrZn4MACTe4gNHrCuQo7HgaHm2jgqyg== X-Google-Smtp-Source: AGHT+IFMvydc7cBJRXZb1bqbo6FjNqIWAsMHgBSPTGKLdS/dRVmSvzNg5NUj0sYQTQUTFuUNXxR8Yw== X-Received: by 2002:a05:6512:159d:b0:507:b922:f920 with SMTP id bp29-20020a056512159d00b00507b922f920mr1505832lfb.8.1697716102790; Thu, 19 Oct 2023 04:48:22 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id e13-20020a05651236cd00b004ff973cb14esm1064375lfs.108.2023.10.19.04.48.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2023 04:48:22 -0700 (PDT) X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x129.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:272723 Archived-At: --Apple-Mail=_1B23E174-97EC-4B15-B787-A6600272D218 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii The warning about a missing lexical-binding cookie rather belongs in the = compiler than checkdoc, because it's not about documentation or style = but code generation and ability to detect errors, both which are = hindered by a missing cookie. Moving the warning to the compiler also makes it more widely seen. --Apple-Mail=_1B23E174-97EC-4B15-B787-A6600272D218 Content-Disposition: attachment; filename=0001-Move-lexical-binding-warning-from-checkdoc-to-byte-c.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Move-lexical-binding-warning-from-checkdoc-to-byte-c.patch" Content-Transfer-Encoding: quoted-printable =46rom=206887fadd1c262954303d706d0d556bef4b5148c5=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Sun,=2015=20Oct=202023=2022:01:06=20+0200=0A= Subject:=20[PATCH]=20Move=20lexical-binding=20warning=20from=20checkdoc=20= to=20byte-compiler=0A=0AThis=20warning=20is=20much=20more=20appropriate=20= for=20the=20compiler,=20since=20lexical=0Abinding=20affects=20what=20it=20= can=20reason=20and=20warn=20about,=20than=20for=20checkdoc=0Aas=20the=20= warning=20has=20no=20bearing=20to=20documentation=20at=20all.=0AThe=20= move=20also=20improves=20the=20reach=20of=20the=20warning.=0A=0A*=20= etc/NEWS:=20Update.=0A*=20lisp/emacs-lisp/checkdoc.el=20= (checkdoc-lexical-binding-flag)=0A(checkdoc-file-comments-engine):=20= Move=20warning=20from=20here....=0A*=20lisp/emacs-lisp/bytecomp.el=20= (byte-compile-file):=20...to=20here.=0A*=20= test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el:=0A*=20= test/lisp/emacs-lisp/bytecomp-tests.el=0A= (bytecomp-tests--unescaped-char-literals)=0A= (bytecomp-tests-function-put,=20bytecomp-tests--not-writable-directory)=0A= (bytecomp-tests--target-file-no-directory):=0AUpdate=20tests.=0A= (bytecomp-tests--log-from-compilation)=0A= (bytecomp-tests--lexical-binding-cookie):=20New=20test.=0A---=0A=20= etc/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|=2025=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=204=20++=0A=20lisp/emacs-lisp/checkdoc.el=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20|=2039=20-------------------=0A=20= .../bytecomp-resources/no-byte-compile.el=20=20=20=20=20|=20=202=20+-=0A=20= test/lisp/emacs-lisp/bytecomp-tests.el=20=20=20=20=20=20=20=20|=2039=20= +++++++++++++++++--=0A=205=20files=20changed,=2057=20insertions(+),=2052=20= deletions(-)=0A=0Adiff=20--git=20a/etc/NEWS=20b/etc/NEWS=0Aindex=20= 02b794a2964..e7f51e1c6c4=20100644=0A---=20a/etc/NEWS=0A+++=20b/etc/NEWS=0A= @@=20-845,14=20+845,6=20@@=20This=20can=20help=20avoid=20some=20awkward=20= skip=20conditions.=20=20For=20example=0A=20'(skip-unless=20(not=20= noninteractive))'=20can=20be=20changed=20to=20the=20easier=0A=20to=20= read=20'(skip-when=20noninteractive)'.=0A=20=0A-**=20Checkdoc=0A-=0A----=0A= -***=20New=20checkdock=20warning=20if=20not=20using=20lexical-binding.=0A= -Checkdoc=20now=20warns=20if=20the=20first=20line=20of=20an=20Emacs=20= Lisp=20file=20does=20not=0A-end=20with=20a=20"-*-=20lexical-binding:=20t=20= -*-"=20cookie.=20=20Customize=20the=20user=0A-option=20= 'checkdoc-lexical-binding-flag'=20to=20nil=20to=20disable=20this=20= warning.=0A-=0A=20**=20URL=0A=20=0A=20+++=0A@@=20-1153,6=20+1145,23=20@@=20= sexp-related=20motion=20commands.=0A=20=0A=20**=20New=20or=20changed=20= byte-compilation=20warnings=0A=20=0A+---=0A+***=20Warn=20about=20missing=20= 'lexical-binding'=20directive.=0A+The=20compiler=20now=20warns=20if=20an=20= Elisp=20file=20lacks=20the=20standard=0A+'-*-=20lexical-binding:=20...=20= -*-'=20cookie=20on=20the=20first=20line.=0A+This=20line=20typically=20= looks=20something=20like=0A+=0A+=20=20=20=20;;;=20My=20little=20pony=20= mode=20=20-*-=20lexical-binding:=20t=20-*-=0A+=0A+It=20is=20needed=20to=20= inform=20the=20compiler=20about=20which=20dialect=20of=20ELisp=0A+your=20= code=20is=20using:=20the=20modern=20dialect=20with=20lexical=20binding=20= or=0A+the=20old=20dialect=20with=20only=20dynamic=20binding.=0A+=0A= +Lexical=20binding=20avoids=20some=20name=20conflicts=20and=20allows=20= the=20compiler=0A+to=20detect=20more=20mistakes=20and=20generate=20more=20= efficient=20code.=20=20To=20adapt=0A+your=20code=20to=20lexical=20= binding,=20see=20the=20"(elisp)=20Converting=20to=20Lexical=0A+Binding"=20= node=20in=20the=20manual.=0A+=0A=20---=0A=20***=20Warn=20about=20empty=20= bodies=20for=20more=20special=20forms=20and=20macros.=0A=20The=20= compiler=20now=20warns=20about=20an=20empty=20body=20argument=20to=20= 'when',=0Adiff=20--git=20a/lisp/emacs-lisp/bytecomp.el=20= b/lisp/emacs-lisp/bytecomp.el=0Aindex=2092abe6b4624..cc68db73c9f=20= 100644=0A---=20a/lisp/emacs-lisp/bytecomp.el=0A+++=20= b/lisp/emacs-lisp/bytecomp.el=0A@@=20-2201,6=20+2201,10=20@@=20= byte-compile-file=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= filename=20buffer-file-name))=0A=20=20=20=20=20=20=20;;=20Don't=20= inherit=20lexical-binding=20from=20caller=20(bug#12938).=0A=20=20=20=20=20= =20=20(unless=20(local-variable-p=20'lexical-binding)=0A+=20=20=20=20=20=20= =20=20(let=20((byte-compile-current-buffer=20(current-buffer)))=0A+=20=20= =20=20=20=20=20=20=20=20(byte-compile-warn-x=0A+=20=20=20=20=20=20=20=20=20= =20=20(position-symbol=20'a=20(point-min))=0A+=20=20=20=20=20=20=20=20=20= =20=20"file=20has=20no=20`lexical-binding'=20directive=20on=20its=20= first=20line"))=0A=20=20=20=20=20=20=20=20=20(setq-local=20= lexical-binding=20nil))=0A=20=20=20=20=20=20=20;;=20Set=20the=20default=20= directory,=20in=20case=20an=20eval-when-compile=20uses=20it.=0A=20=20=20=20= =20=20=20(setq=20default-directory=20(file-name-directory=20filename)))=0A= diff=20--git=20a/lisp/emacs-lisp/checkdoc.el=20= b/lisp/emacs-lisp/checkdoc.el=0Aindex=20440e133f44b..471a2fbdf48=20= 100644=0A---=20a/lisp/emacs-lisp/checkdoc.el=0A+++=20= b/lisp/emacs-lisp/checkdoc.el=0A@@=20-128,14=20+128,6=20@@=0A=20;;=20= simple=20style=20rules=20to=20follow=20which=20checkdoc=20will=20= auto-fix=20for=20you.=0A=20;;=20`y-or-n-p'=20and=20`yes-or-no-p'=20= should=20also=20end=20in=20"?".=0A=20;;=0A-;;=20Lexical=20binding:=0A-;;=0A= -;;=20=20=20We=20recommend=20always=20using=20lexical=20binding=20in=20= new=20code,=20and=0A-;;=20converting=20old=20code=20to=20use=20it.=20=20= Checkdoc=20warns=20if=20you=20don't=20have=0A-;;=20the=20recommended=20= string=20"-*-=20lexical-binding:=20t=20-*-"=20at=20the=20top=20of=0A-;;=20= the=20file.=20=20You=20can=20disable=20this=20check=20with=20the=20user=20= option=0A-;;=20`checkdoc-lexical-binding-flag'.=0A-;;=0A=20;;=20Adding=20= your=20own=20checks:=0A=20;;=0A=20;;=20=20=20You=20can=20experiment=20= with=20adding=20your=20own=20checks=20by=20setting=20the=0A@@=20-347,12=20= +339,6=20@@=20checkdoc-column-zero-backslash-before-paren=0A=20=20=20= :type=20'boolean=0A=20=20=20:version=20"28.1")=0A=20=0A-(defcustom=20= checkdoc-lexical-binding-flag=20t=0A-=20=20"Non-nil=20means=20generate=20= warnings=20if=20file=20is=20not=20using=20lexical=20binding.=0A-See=20= Info=20node=20`(elisp)=20Converting=20to=20Lexical=20Binding'=20for=20= more."=0A-=20=20:type=20'boolean=0A-=20=20:version=20"30.1")=0A-=0A=20;;=20= This=20is=20how=20you=20can=20use=20checkdoc=20to=20make=20mass=20fixes=20= on=20the=20Emacs=0A=20;;=20source=20tree:=0A=20;;=0A@@=20-2391,31=20= +2377,6=20@@=20checkdoc-file-comments-engine=0A=20=09=20=20=20=20=20=20= (point-min)=20(save-excursion=20(goto-char=20(point-min))=0A=20=09=09=09=09= =09=20=20(line-end-position))))=0A=20=09=20nil))=0A-=20=20=20=20=20=20= (when=20checkdoc-lexical-binding-flag=0A-=20=20=20=20=20=20=20=20(setq=0A= -=20=20=20=20=20=20=20=20=20err=0A-=20=20=20=20=20=20=20=20=20;;=20= Lexical=20binding=20cookie.=0A-=20=20=20=20=20=20=20=20=20(if=20(not=20= (save-excursion=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(save-restriction=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(goto-char=20(point-min))=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(narrow-to-region=20(point)=20= (pos-eol))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(re-search-forward=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(rx=20"-*-"=20(*=20(*=20nonl)=20";")=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= (*=20space)=20"lexical-binding:"=20(*=20space)=20"t"=20(*=20space)=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(*=20nonl))=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"-*-")=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20nil=20t))))=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20(let=20((pos=20(save-excursion=20(goto-char=20= (point-min))=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=20=20=20=20=20=20= (goto-char=20(pos-eol))=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=20=20=20=20=20=20= (point))))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (checkdoc-y-or-n-p=20"There=20is=20no=20lexical-binding=20cookie!=20=20= Add=20one?")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (progn=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (goto-char=20pos)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(insert=20"=20=20-*-=20lexical-binding:=20t=20-*-"))=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(checkdoc-create-error=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"The=20first=20line=20= should=20end=20with=20\"-*-=20lexical-binding:=20t=20-*-\""=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20pos=20(1+=20pos)=20t)))=0A-=20=20= =20=20=20=20=20=20=20=20=20nil)))=0A=20=20=20=20=20=20=20(setq=0A=20=20=20= =20=20=20=20=20err=0A=20=20=20=20=20=20=20=20(or=0Adiff=20--git=20= a/test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el=20= b/test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el=0Aindex=20= 00ad1947507..1de5cf66b66=20100644=0A---=20= a/test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el=0A+++=20= b/test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el=0A@@=20-1=20= +1=20@@=0A-;;=20-*-=20no-byte-compile:=20t;=20-*-=0A+;;=20-*-=20= no-byte-compile:=20t;=20lexical-binding:=20t;=20-*-=0Adiff=20--git=20= a/test/lisp/emacs-lisp/bytecomp-tests.el=20= b/test/lisp/emacs-lisp/bytecomp-tests.el=0Aindex=20= e644417c3d4..4aa555f1e92=20100644=0A---=20= a/test/lisp/emacs-lisp/bytecomp-tests.el=0A+++=20= b/test/lisp/emacs-lisp/bytecomp-tests.el=0A@@=20-1302,6=20+1302,30=20@@=20= bytecomp-tests--with-temp-file=0A=20=20=20=20=20=20=20=20(let=20((elc=20= (concat=20,file-name-var=20".elc")))=0A=20=20=20=20=20=20=20=20=20=20(if=20= (file-exists-p=20elc)=20(delete-file=20elc))))))=0A=20=0A+(defun=20= bytecomp-tests--log-from-compilation=20(source)=0A+=20=20"Compile=20the=20= string=20SOURCE=20and=20return=20the=20compilation=20log=20output."=0A+=20= =20(let=20((text-quoting-style=20'grave)=0A+=20=20=20=20=20=20=20=20= (byte-compile-log-buffer=20(generate-new-buffer=20"=20*Compile-Log*")))=0A= +=20=20=20=20(with-current-buffer=20byte-compile-log-buffer=0A+=20=20=20=20= =20=20(let=20((inhibit-read-only=20t))=20(erase-buffer)))=0A+=20=20=20=20= (bytecomp-tests--with-temp-file=20el-file=0A+=20=20=20=20=20=20= (write-region=20source=20nil=20el-file)=0A+=20=20=20=20=20=20= (byte-compile-file=20el-file))=0A+=20=20=20=20(with-current-buffer=20= byte-compile-log-buffer=0A+=20=20=20=20=20=20(buffer-string))))=0A+=0A= +(ert-deftest=20bytecomp-tests--lexical-binding-cookie=20()=0A+=20=20= (cl-flet=20((cookie-warning=20(source)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(string-search=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "file=20has=20no=20`lexical-binding'=20directive=20on=20its=20first=20= line"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (bytecomp-tests--log-from-compilation=20source))))=0A+=20=20=20=20(let=20= ((some-code=20"(defun=20my-fun=20()=2012)\n"))=0A+=20=20=20=20=20=20= (should-not=20(cookie-warning=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(concat=20";;;=20-*-lexical-binding:t-*-\n"=20= some-code)))=0A+=20=20=20=20=20=20(should-not=20(cookie-warning=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(concat=20";;;=20= -*-lexical-binding:nil-*-\n"=20some-code)))=0A+=20=20=20=20=20=20(should=20= (cookie-warning=20some-code)))))=0A+=0A=20(ert-deftest=20= bytecomp-tests--unescaped-char-literals=20()=0A=20=20=20"Check=20that=20= byte=20compiling=20warns=20about=20unescaped=20character=0A=20literals=20= (Bug#20852)."=0A@@=20-1310,7=20+1334,9=20@@=20= bytecomp-tests--unescaped-char-literals=0A=20=20=20=20=20=20=20=20=20= (byte-compile-debug=20t)=0A=20=20=20=20=20=20=20=20=20= (text-quoting-style=20'grave))=0A=20=20=20=20=20= (bytecomp-tests--with-temp-file=20source=0A-=20=20=20=20=20=20= (write-region=20"(list=20?)=20?(=20?;=20?\"=20?[=20?])"=20nil=20source)=0A= +=20=20=20=20=20=20(write-region=20(concat=20";;;=20= -*-lexical-binding:t-*-\n"=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"(list=20?)=20?(=20?;=20?\"=20?[=20= ?])")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20nil=20= source)=0A=20=20=20=20=20=20=20(bytecomp-tests--with-temp-file=20= destination=0A=20=20=20=20=20=20=20=20=20(let*=20= ((byte-compile-dest-file-function=20(lambda=20(_)=20destination))=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(err=20(should-error=20= (byte-compile-file=20source))))=0A@@=20-1322,7=20+1348,9=20@@=20= bytecomp-tests--unescaped-char-literals=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=20=20= =20"`?\\]'=20expected!")))))))=0A=20=20=20=20=20;;=20But=20don't=20warn=20= in=20subsequent=20compilations=20(Bug#36068).=0A=20=20=20=20=20= (bytecomp-tests--with-temp-file=20source=0A-=20=20=20=20=20=20= (write-region=20"(list=201=202=203)"=20nil=20source)=0A+=20=20=20=20=20=20= (write-region=20(concat=20";;;=20-*-lexical-binding:t-*-\n"=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= "(list=201=202=203)")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20nil=20source)=0A=20=20=20=20=20=20=20= (bytecomp-tests--with-temp-file=20destination=0A=20=20=20=20=20=20=20=20=20= (let=20((byte-compile-dest-file-function=20(lambda=20(_)=20= destination)))=0A=20=20=20=20=20=20=20=20=20=20=20(should=20= (byte-compile-file=20source)))))))=0A@@=20-1330,6=20+1358,7=20@@=20= bytecomp-tests--unescaped-char-literals=0A=20(ert-deftest=20= bytecomp-tests-function-put=20()=0A=20=20=20"Check=20`function-put'=20= operates=20during=20compilation."=0A=20=20=20= (bytecomp-tests--with-temp-file=20source=0A+=20=20=20=20(insert=20=20= ";;;=20-*-lexical-binding:t-*-\n")=0A=20=20=20=20=20(dolist=20(form=20= '((function-put=20'bytecomp-tests--foo=20'foo=201)=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(function-put=20= 'bytecomp-tests--foo=20'bar=202)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(defmacro=20bytecomp-tests--foobar=20()=0A@@=20= -1636,7=20+1665,8=20@@=20bytecomp-tests--not-writable-directory=0A=20=20=20= =20=20=20=20=20=20=20=20=20(byte-compile-error-on-warn=20t))=0A=20=20=20=20= =20=20=20(unwind-protect=0A=20=20=20=20=20=20=20=20=20=20=20(progn=0A-=20= =20=20=20=20=20=20=20=20=20=20=20(write-region=20""=20nil=20input-file=20= nil=20nil=20nil=20'excl)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (write-region=20";;;=20-*-lexical-binding:t-*-\n"=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=20nil=20= input-file=20nil=20nil=20nil=20'excl)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20(write-region=20""=20nil=20output-file=20nil=20nil=20nil=20'excl)=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20(set-file-modes=20input-file=20= #o400)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20(set-file-modes=20= output-file=20#o200)=0A@@=20-1700,7=20+1730,8=20@@=20= bytecomp-tests--target-file-no-directory=0A=20=20=20=20=20(let*=20= ((default-directory=20directory)=0A=20=20=20=20=20=20=20=20=20=20=20=20= (byte-compile-dest-file-function=20(lambda=20(_)=20"test.elc"))=0A=20=20=20= =20=20=20=20=20=20=20=20=20(byte-compile-error-on-warn=20t))=0A-=20=20=20= =20=20=20(write-region=20""=20nil=20"test.el"=20nil=20nil=20nil=20'excl)=0A= +=20=20=20=20=20=20(write-region=20=20";;;=20-*-lexical-binding:t-*-\n"=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20nil=20= "test.el"=20nil=20nil=20nil=20'excl)=0A=20=20=20=20=20=20=20(should=20= (byte-compile-file=20"test.el"))=0A=20=20=20=20=20=20=20(should=20= (file-regular-p=20"test.elc"))=0A=20=20=20=20=20=20=20(should=20= (cl-plusp=20(file-attribute-size=0A--=20=0A2.32.0=20(Apple=20Git-132)=0A=0A= --Apple-Mail=_1B23E174-97EC-4B15-B787-A6600272D218--