From unknown Wed Jun 18 00:26:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#43116 <43116@debbugs.gnu.org> To: bug#43116 <43116@debbugs.gnu.org> Subject: Status: 27.1; with-eval-after-load executes BODY multiple times for fortran Reply-To: bug#43116 <43116@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:26:55 +0000 retitle 43116 27.1; with-eval-after-load executes BODY multiple times for f= ortran reassign 43116 emacs submitter 43116 Nonax severity 43116 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 30 12:55:17 2020 Received: (at submit) by debbugs.gnu.org; 30 Aug 2020 16:55:17 +0000 Received: from localhost ([127.0.0.1]:50668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCQbs-0007nj-V4 for submit@debbugs.gnu.org; Sun, 30 Aug 2020 12:55:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:41962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCQ2n-0006yy-Nt for submit@debbugs.gnu.org; Sun, 30 Aug 2020 12:19:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCQ2n-0005St-Ig for bug-gnu-emacs@gnu.org; Sun, 30 Aug 2020 12:19:01 -0400 Received: from mout02.posteo.de ([185.67.36.66]:36269) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCQ2l-0003BL-0P for bug-gnu-emacs@gnu.org; Sun, 30 Aug 2020 12:19:01 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 549212400FB for ; Sun, 30 Aug 2020 18:18:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1598804332; bh=53YDD9sGxd2UI3M5puGbJShFu7YmL1WnYEjeTaedkL8=; h=To:Subject:From:Autocrypt:Date:From; b=RDKAx0xBw9eaM1I110SC8lw3IpPXuOpqBhRsnEni+pmhOLlGDZVmT90fhrue0I0TE jQJDREpmoi2UZU8azqlHpfdFBSg9bRlboicVUsunEqicJ0Oi8FGucy3CsIo6ju7OJR tF15efLG4kQt6p0GrJFfxCAsNec58d0BMrROecHJnRPIUdzznKIXlOrTQmtgRdJUvr xvuPLYeqHcCjs30nIEGb41q32fWkM+UJpJveunjOZeL8MbC5DJSKU4atRwOOPugdZ6 vDSBXeY/1bkK6zvL/xymJzIOv3pxAcpzMO6wEq+TtURrL2ghk+5ggktq4xQ62uPrPZ W4E/N9YWY6vuA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Bfdn75Y4xz6tmQ for ; Sun, 30 Aug 2020 18:18:51 +0200 (CEST) To: bug-gnu-emacs@gnu.org Subject: 27.1; with-eval-after-load executes BODY multiple times for fortran From: Nonax Autocrypt: addr=nonax@posteo.net; prefer-encrypt=mutual; keydata= mQENBFuJVeEBCADAhVktqEkcI1afVu75HQXC0CBQA7O77a9MEFk0AHCS/3F69GBZ5uhoLFwL sidR383IhosUMhFK60k+lF5y+FqzrnCcgyos+aNpmpFxoAF1cyonZyyoqyqcKxwtwaBAs67c 6H9obPPBkP9kfAt40JEMNUXodcDiqJkZPtaS07yT+Ydud8JROX9pQpCUBikTZRsr0POU8Xi6 BBsNL3wmHF9OjRV8hAykmzWhUOJCdcgaWAqMAGfDdVEK/QLGN/WukIeCMykMpB3ft8rCtW7Y SfKegRkTMDjIewmHcAO1vxNKUylm3WMe/+VG0f4fHqdb/d0U7E1f8SEL+gbwDBoCW9V7ABEB AAG0GE5vbmF4IDxub25heEBwb3N0ZW8ubmV0PokBTgQTAQgAOBYhBIHKsVNWX9DYD0H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Vx7SUnM1c16bc7apcYIniE0+ hVFvIEH27OcWywotnWmWW6DCvTxfpP77HkOhWy0vNOXoPpgRx21om1pExYu+Xe98r7D5DBx0 40vbq4AKkltTkKzU3wGnbyatRB2oFrXHETDDBOKPSsI= Message-ID: <6a275221-6158-8b3e-648b-ceb0116a71b6@posteo.net> Date: Sun, 30 Aug 2020 18:18:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.66; envelope-from=nonax@posteo.net; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/30 10:32:36 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 30 Aug 2020 12:55:15 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello, The following command will reproduce the bug: emacs -Q -l mwe.el f.f f.f does not have to exist, it just serves to open a buffer and enable fortran-mode. The file mwe.el contains the following: (with-eval-after-load 'fortran (if (boundp 'fortran-canary) (message "..is cursed.") (message "FORTRAN..")) (defvar fortran-canary t)) ;;; end of mwe.el The following message will appear in the *Message* buffer: FORTRAN.. ..is cursed. suggesting BODY has been executed twice. This problem seems to persist across multiple versions of Emacs. It seems to only apply to fortran specifically, however. I could not reproduce it with other features. Kind regards, N. In GNU Emacs 27.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.21, cairo version 1.16.0) of 2020-08-20 built on buildvm-x86-24.iad2.fedoraproject.org Windowing system distributor 'Fedora Project', version 11.0.12008000 System Description: Fedora 32 (Workstation Edition) Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. (New file) FORTRAN.. ..is cursed. Making completion list... [2 times] Configured using: 'configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3 --with-gpm=no --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' LDFLAGS=-Wl,-z,relro PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER GMP Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Fortran Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils fortran cus-edit easymenu cus-start cus-load wid-edit cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 66282 11790) (symbols 48 7807 1) (strings 32 19871 1395) (string-bytes 1 608771) (vectors 16 11410) (vector-slots 8 142908 11478) (floats 8 28 41) (intervals 56 263 0) (buffers 1000 14)) From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 31 07:34:39 2020 Received: (at 43116) by debbugs.gnu.org; 31 Aug 2020 11:34:39 +0000 Received: from localhost ([127.0.0.1]:51728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCi59-0003uz-7k for submit@debbugs.gnu.org; Mon, 31 Aug 2020 07:34:39 -0400 Received: from colin.muc.de ([193.149.48.1]:27604 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1kCi54-0003ui-PB for 43116@debbugs.gnu.org; Mon, 31 Aug 2020 07:34:37 -0400 Received: (qmail 96127 invoked by uid 3782); 31 Aug 2020 11:34:28 -0000 Date: 31 Aug 2020 11:34:28 -0000 Message-ID: <20200831113428.96126.qmail@mail.muc.de> From: Alan Mackenzie To: Nonax Subject: Re: bug#43116: 27.1; with-eval-after-load executes BODY multiple times for fortran Organization: muc.de e.V. In-Reply-To: X-Newsgroups: gnu.emacs.bug User-Agent: tin/2.4.4-20191224 ("Millburn") (FreeBSD/11.3-RELEASE-p9 (amd64)) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 43116 Cc: acm@muc.de, 43116@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Nonax. In article you wrote: > Hello, > The following command will reproduce the bug: emacs -Q -l mwe.el f.f > f.f does not have to exist, it just serves to open a buffer and enable > fortran-mode. The file mwe.el contains the following: > (with-eval-after-load 'fortran > (if (boundp 'fortran-canary) > (message "..is cursed.") > (message "FORTRAN..")) > (defvar fortran-canary t)) > ;;; end of mwe.el > The following message will appear in the *Message* buffer: > FORTRAN.. > ..is cursed. > suggesting BODY has been executed twice. This problem seems to persist > across multiple versions of Emacs. It seems to only apply to fortran > specifically, however. I could not reproduce it with other features. > Kind regards, > N. > In GNU Emacs 27.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version > 3.24.21, cairo version 1.16.0) > of 2020-08-20 built on buildvm-x86-24.iad2.fedoraproject.org > Windowing system distributor 'Fedora Project', version 11.0.12008000 > System Description: Fedora 32 (Workstation Edition) [ .... ] Diagnosis: 1. At a fairly low level, (load "fortran") gets called. 2. In fortran.el L658 in (defvar fortran-mode-map ....) there's a form ,(custom-menu-create 'fortran). This gets evaluated during the load. 3. custom-menu-create's call stack (pertinent part) looks like: (do-after-load-evaluation "path/to/fortran.elc") (require 'fortran) <========================================= (custom-load-symbol 'fortran) (custom-menu-create 'fortran) 4. The above do-after-load-evaluation eventually calls the fortran eval-after-load function that outputs "FORTRAN..". 5. At a later stage of the load, do-after-load-evaluation gets called by load normally. This calls the eval-after-load function again, which outputs "..is cursed.". In a nutshell, the problem is the recursive (require 'fortran) called from within (load "fortran"). I don't yet have any idea on how to fix this bug. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 01 00:29:18 2020 Received: (at 43116) by debbugs.gnu.org; 1 Sep 2020 04:29:18 +0000 Received: from localhost ([127.0.0.1]:54503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCxv3-0008Bl-VI for submit@debbugs.gnu.org; Tue, 01 Sep 2020 00:29:18 -0400 Received: from mout02.posteo.de ([185.67.36.66]:41717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCqP2-0002ab-Pq for 43116@debbugs.gnu.org; Mon, 31 Aug 2020 16:27:45 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 91B382400FE for <43116@debbugs.gnu.org>; Mon, 31 Aug 2020 22:27:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1598905658; bh=vBlV6RxDJ2/uIhlGP8cy93xRJnlHK33Mb9m7UZS5EIw=; h=Subject:To:Cc:From:Autocrypt:Date:From; b=iEBL9Wi30tinW5q8JVzGyPtW5vfx+cjGsTLGbA04CrBwSEjlwAKoOmcUNe0hAs+jg kulxOKhF1NiO5fHBSAk/KMiiHZBmnd+as2FLP7RcuYExbNGzjULDvJ3pg5BkWS8V0a djjUvEyo1JEpLDrUaA8ufUFNokKNbK44yaJoaXk0YhIhfo0VRZe72FAM5Xu/0kvzM7 U3NTamc+56ri7/dTIpgXd5X6a+bsewYe4Ov6n8qZ6ZLBnKwMqjeBL5hv4Uu8Y22RHA EzgIyo1a2NgXIILQSY8J0nJq2R2ZraLDMW7kCpzpNNZVO3jCerU93ZCkUiqA67CUci 4FePBVumZ1/Zg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BgMFj2zFGz9rxj; Mon, 31 Aug 2020 22:27:37 +0200 (CEST) Subject: Re: Recursive Fload and eval-after-load forms. (See bug #43116.) To: Alan Mackenzie , Stefan Monnier References: <20200831184526.GB4176@ACM> From: Nonax Autocrypt: addr=nonax@posteo.net; prefer-encrypt=mutual; keydata= mQENBFuJVeEBCADAhVktqEkcI1afVu75HQXC0CBQA7O77a9MEFk0AHCS/3F69GBZ5uhoLFwL sidR383IhosUMhFK60k+lF5y+FqzrnCcgyos+aNpmpFxoAF1cyonZyyoqyqcKxwtwaBAs67c 6H9obPPBkP9kfAt40JEMNUXodcDiqJkZPtaS07yT+Ydud8JROX9pQpCUBikTZRsr0POU8Xi6 BBsNL3wmHF9OjRV8hAykmzWhUOJCdcgaWAqMAGfDdVEK/QLGN/WukIeCMykMpB3ft8rCtW7Y SfKegRkTMDjIewmHcAO1vxNKUylm3WMe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VuMldYJj6UPm6wTlV3jjUtp0BCkFMOAKABfBgwJuF2xfpT+ijdDAcFcq6 bw7SCyk3/WeoJ8yVa0y0zsGPtBuQYfixeE9GIsrk/KOjWyJQVx7SUnM1c16bc7apcYIniE0+ hVFvIEH27OcWywotnWmWW6DCvTxfpP77HkOhWy0vNOXoPpgRx21om1pExYu+Xe98r7D5DBx0 40vbq4AKkltTkKzU3wGnbyatRB2oFrXHETDDBOKPSsI= Message-ID: <2edcfc59-59b4-4609-93d5-aba610e2c541@posteo.net> Date: Mon, 31 Aug 2020 22:27:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200831184526.GB4176@ACM> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 43116 X-Mailman-Approved-At: Tue, 01 Sep 2020 00:29:16 -0400 Cc: 43116@debbugs.gnu.org, emacs-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) Hi all, I looked into a matter a bit and, while I don't have a solution myself, noticed something very strange. You made me aware of the fact that the fortran modes (both fortran-mode and f90) use custom-menu-create directly. The thing I find exceptional about that is that absolutely no other major mode uses this function this way, period. A quick grep shows that the only other file in the lisp/ directory using it is eudc.el, and it uses it to bind the return value to a const. So it seems that it does a rather standard thing (setting up a menu for a major mode) in a very exceptional way. I am still quite new to writing modes, but I guess one could circumvent the direct usage of custom-menu-create entirely. I've also been poking around some more to see what modules use it indirectly, to see how they deal with potential issues. The function is used by two more functions in cus-edit: custom-group-menu-create (unused in the entire lisp/ subdir) and customize-menu-create, which is used by cus-edit itself once to create Custom-mode-menu. Almost all other modules using customize-menu-create (org.el, idlwave.el, reftex.el) define a function -create-customize-menu which calls it in return. The only other module using it differently is wid-browse.el, which uses it in a similar way cus-edit itself uses it. So all in all the hierarchy of files using custom-menu-create at all is quite small, and it seems the majority does not actually call it at evaluation time, but instead have it called as a function bound to a menu point (meaning it will be called upon user input when everything important already happened). I would have to do a lot more digging to really get what custom-menu-create and family really do, but I get the feeling that fortran-mode kind of (ab)uses it in a way that was not originally anticipated. I hope this information proves somewhat useful, but my pattern recognition tells me it does. Cheers, Nonax On 31/08/2020 20:45, Alan Mackenzie wrote: > Hello, Emacs. > > In bug #43116, the OP has rightly complained that on loading > fortran.elc, his eval-after-load forms get evaluated twice. > > The cause of the double evaluation is a custom-menu-create form in > fortran.el, which causes a recursive evaluation of (load "fortran"). > The eval-after-load-forms are evaluated both for the "inner" load and > the "outer" load. > > What do people think of the following proposal: that the eval-after-load > forms should be evaluated only after the outermost load has completed? > This would be a simple amendment to the function Fload. > From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 12 08:46:36 2021 Received: (at 43116) by debbugs.gnu.org; 12 Jun 2021 12:46:37 +0000 Received: from localhost ([127.0.0.1]:40540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ls324-0002cZ-NU for submit@debbugs.gnu.org; Sat, 12 Jun 2021 08:46:36 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42106) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ls322-0002Vz-8q for 43116@debbugs.gnu.org; Sat, 12 Jun 2021 08:46:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ft42/v7F0R8FHNSzNqo0zhVGnO1EoIc0hawe4ZG6jmE=; b=neThqgFfhk8SWqo8+TjT7WIjNA 0s78L4B5IuXW6Ayhd0ke+lRMVEO7bV4BFSUExlI6yXUYevoVUwH4bbYEXXi237hi7L+7KdqhldKF7 alniNxq/8d2aYaL72BSEFesJjtMTigppLr1hGs+LSDcvHnP3O6GWiXdX1B1d0OFkKV1o=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ls31t-0005lh-Av; Sat, 12 Jun 2021 14:46:27 +0200 From: Lars Ingebrigtsen To: Nonax Subject: Re: bug#43116: 27.1; with-eval-after-load executes BODY multiple times for fortran References: <6a275221-6158-8b3e-648b-ceb0116a71b6@posteo.net> X-Now-Playing: Colored Music's _Individual Beauty_: "Heartbeat (Previously Unreleased Version)" Date: Sat, 12 Jun 2021 14:46:20 +0200 In-Reply-To: <6a275221-6158-8b3e-648b-ceb0116a71b6@posteo.net> (nonax@posteo.net's message of "Sun, 30 Aug 2020 18:18:51 +0200") Message-ID: <87im2j6yjn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Nonax writes: > The following command will reproduce the bug: emacs -Q -l mwe.el f.f > > f.f does not have to exist, it just serves to open a buffer and enable > fortran-mode. The file mwe.el contains the following [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43116 Cc: 43116@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Nonax writes: > The following command will reproduce the bug: emacs -Q -l mwe.el f.f > > f.f does not have to exist, it just serves to open a buffer and enable > fortran-mode. The file mwe.el contains the following: > > (with-eval-after-load 'fortran > (if (boundp 'fortran-canary) > (message "..is cursed.") > (message "FORTRAN..")) > (defvar fortran-canary t)) > ;;; end of mwe.el > > The following message will appear in the *Message* buffer: > FORTRAN.. > ..is cursed. > > suggesting BODY has been executed twice. Yup -- you and Alan diagnosed the problem (a recursive load in the easymenu call), and I think the easiest fix here is just to do define the menu at the end of fortran.el. So I've now done this in Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 12 08:46:40 2021 Received: (at control) by debbugs.gnu.org; 12 Jun 2021 12:46:40 +0000 Received: from localhost ([127.0.0.1]:40543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ls327-0002fj-VQ for submit@debbugs.gnu.org; Sat, 12 Jun 2021 08:46:40 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ls326-0002a2-UL for control@debbugs.gnu.org; Sat, 12 Jun 2021 08:46:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OKdnm3O9FT1ouilOXWy+F+BqODUHkudob/JoIGCfhm0=; b=ooH0wyjYl1Jx0vwVdi5BAiGQoy jP6lswFn+t4FxmpscmljsGS9/goyJsWkr2WY6WAVpSm5wm2uEiydFHctTwh+MKztYDKFyYJHGMulM zZ/hs+p7ltnocZwN2zRiJ+jXSTnJyi1ajmGimt+5jyyxjm24fhTauS8Rg64zYqq23hAs=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ls31z-0005lo-Gg for control@debbugs.gnu.org; Sat, 12 Jun 2021 14:46:33 +0200 Date: Sat, 12 Jun 2021 14:46:31 +0200 Message-Id: <87h7i36yjc.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #43116 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 43116 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 43116 28.1 quit From unknown Wed Jun 18 00:26:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 11 Jul 2021 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator