From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregor Zattler Newsgroups: gmane.emacs.bugs Subject: bug#49746: 28.0.50; bytecompilation introduces bug in org-capture with certain template Date: Tue, 27 Jul 2021 15:58:58 +0200 Message-ID: <875ywvyi1p.fsf@no.workgroup> 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="15647"; mail-complaints-to="usenet@ciao.gmane.io" To: 49746@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 27 16:02:25 2021 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 1m8Nf7-0003oC-6I for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Jul 2021 16:02:25 +0200 Original-Received: from localhost ([::1]:57508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8Nf6-0000Ev-6I for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Jul 2021 10:02:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8Nco-0006Yd-H7 for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2021 10:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41849) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8Nco-0001a2-9D for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2021 10:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m8Ncn-00067W-VV for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2021 10:00:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregor Zattler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Jul 2021 14:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49746 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162739435123437 (code B ref -1); Tue, 27 Jul 2021 14:00:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jul 2021 13:59:11 +0000 Original-Received: from localhost ([127.0.0.1]:53395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8Nbz-00065x-FU for submit@debbugs.gnu.org; Tue, 27 Jul 2021 09:59:11 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:42846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m8Nbx-00065p-Bp for submit@debbugs.gnu.org; Tue, 27 Jul 2021 09:59:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8Nbw-0006DK-1z for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2021 09:59:08 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:45327) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8Nbu-0000rD-3H for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2021 09:59:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1627394343; bh=JTAiu/vx+tktb6IRx6zhdsEOdL/8oks7yGuceh/Z/eE=; h=X-UI-Sender-Class:From:To:Subject:Date; b=k057oOH0JK2YyMLoI6Xyuyg+dfw0jahinKZRkhdjT95Rp/T0ShW4yzY0eqd458J5i yh4gddyZ8FI1sPx3+oNKn6Ddq0pxo8K08vcS68hTrFQSnRleSU8mp4vZzu3E7mpyet 6KZ+6DYzJneyrf/qBF1zOUTjiktpdXVMi38h5yIs= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from no.workgroup ([46.94.153.87]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N3siG-1n8DWY3rCy-00zr8k; Tue, 27 Jul 2021 15:59:02 +0200 X-Provags-ID: V03:K1:LQqbqEzj2ymmrhOraNwvJybqr7LHPjKsBukEqChtrvB8QdYorjS IheWSkYl6tGVp3i0HGZiPUWFdkrOBpCT+uHxJvAZDodnwaq7nnMOAoN5PPwfmx7IpEm9wfy YOK/3wCEv8TErzsq6HlRggms6M1ytXW7Ka9Cy3IXmiwrvz1jlcnEu9HIz/KRxMPmRJye7Yq AcziusCXcQ2fc+AndxC5A== X-UI-Out-Filterresults: notjunk:1;V03:K0:FrjpfeF9Ss8=:XUdnyyQdnUWFgvw33YKLCy MeNLThtG6+OUa4oXqn44UEp8+kLOO/SSExkYsEEt93ZhMaobeWy553VJLTRO49bowXJwDCiqN EuUnEr7BGsc1hPyTAImKZHcZXB7UikpITfxi5IMhQLoYuor5j9QRzP4DD3NCvJTFAU9/FNj2b i2UNz/YXr+SA2YGe0NeHCrWuaflFmz2SZ2Lt+CJna4YNTUL/fSoZHq2jotpgrsG4nvW1zFVqw HYxBXTP08C/u/4IKxcFtLWyw5ZTDsHr/r8FBJwb8IfweLKJDImoOJiDk+SnjrPEvSDIqbAZsv 7QIKCxZLBjxJ+XtugqJ2VtpOL2SfcQtU5ENpqSqkuobMwIyYx6yz16dwWxtYwkDuV8MbFaqad 6g/awTrSIHjUDRlr9psP+QYvEx4XRKNCVqNDodaVRgmT3wwSwNen9aNykAR3HQsYTSVE2CRdm P5iN5LBAJI0cLqbysm7l+SufKf87fewgFTxo/Djw+sGum3UnOgAmbZnw7FU/dZ8lv4JHIGQT2 TXmFtq29Js/ZBntk+A0wXEzNHpM0YiV+S66+qDw6dPlUvVMoQc7Bv1Oak6jS5ghICsdIT81Zt vbyvX2DHEqeSW8k06hbAm8v7878QvusmRfaIkA8YPwQ3gCY5MJXc6Umn6vcvrfWvn7JTXbPe+ stMeLzSNBb3jPAt1EZuO3BPHz4idlEu7ojiM3OPO+s2LhFOixMfy+7P0bQKZsSW0ZCJlc1xnZ uRMYA/n9+fwJGjcaNe2TkqSxD3h8oSIFDYbTDR5PW5Ss8cGzZkUYU3YjFgWdnaX/K7V/Sg+B Received-SPF: pass client-ip=212.227.17.22; envelope-from=telegraph@gmx.net; helo=mout.gmx.net 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_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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" Xref: news.gmane.io gmane.emacs.bugs:210784 Archived-At: Dear emacs developers, I use org-capture a lot with org-capture-templates. It stopped working a few days ago, throwing a error message instead: org-capture: Capture abort: Unknown template placeholder: "%^g" This is due to a problem with byte compilation. It does not happen, if I remove all .elc files before starting emacs. You may test it with this: (custom-set-variables '(org-capture-templates '(("d" "diary" entry (file "~/notes.org") "*** %? = %^g")))) in minconfig.el and with this invocation of emacs: ~/src/emacs$ src/emacs -Q -l /tmp/minconfig.el --eval '(org-capture 0 "d")' If this gives you an error, quit emacs, remove all .elc -files: ~/src/emacs$ find -type f -print0| grep -zZ "\.elc$" |xargs -0r rm start emacs again: ~/src/emacs$ src/emacs -Q -l /tmp/minconfig.el --eval '(org-capture 0 "d")' and there is no error. I narrowed it down to this commit: 51a86b6a0504d580d3e10efe41abf3ae42c90711 is the first bad commit commit 51a86b6a0504d580d3e10efe41abf3ae42c90711 Author: Mattias Engdeg=C3=A5rd Date: Tue Jul 20 17:23:11 2021 +0200 Count (not X) as a switch condition * lisp/emacs-lisp/bytecomp.el (byte-compile--cond-switch-prefix): Treat (not VAR) and (null VAR) as (eq VAR nil) when computing the extent of switch ops. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 6970c8a5055..2968f1af5df 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -4340,6 +4340,16 @@ byte-compile--cond-switch-prefix (push value keys) (push (cons (list value) (or body '(t))) cases)) t)))) + ;; Treat (not X) as (eq X nil). + (`((,(or 'not 'null) ,(and var (pred symbolp))) . ,body) + (and (or (eq var switch-var) (not switch-var)) + (progn + (setq switch-var var) + (setq switch-test 'eq) + (unless (memq nil keys) + (push nil keys) + (push (cons (list nil) (or body '(t))) cases)) + t))) (`((,(and fn (or 'memq 'memql 'member)) ,var ,expr) . ,body) (and (symbolp var) (or (eq var switch-var) (not switch-var)) :040000 040000 ae3e2ceaa690965108fb8547ce6e90ecd2fcaaf3 28eec9e6920160dc5df= f29e2567ee34b50924bec M lisp The problem came up recently on the org-mode mailing list: https://www.mail-archive.com/emacs-orgmode@gnu.org/msg138065.html Especially this message: https://www.mail-archive.com/emacs-orgmode@gnu.org/msg138121.html inspired me to do a git bisect and test builds if the throw this error and if so, if it also happens after removing all .elc files. For every step in git bisect I did a rm -rf * ; git checkout -f ; make=20 in order to make sure that all .elc files are build afresh. Ciao; Gregor --=20 -... --- .-. . -.. ..--.. ...-.-