GNU bug report logs - #43116
27.1; with-eval-after-load executes BODY multiple times for fortran

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Nonax <nonax@HIDDEN>; dated Sun, 30 Aug 2020 16:56:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 43116 <at> debbugs.gnu.org:


Received: (at 43116) by debbugs.gnu.org; 1 Sep 2020 04:29:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 01 00:29:18 2020
Received: from localhost ([127.0.0.1]:54503 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kCxv3-0008Bl-VI
	for submit <at> 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 <nonax@HIDDEN>) id 1kCqP2-0002ab-Pq
 for 43116 <at> 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 <at> 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 <acm@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
References: <20200831184526.GB4176@ACM>
From: Nonax <nonax@HIDDEN>
Autocrypt: addr=nonax@HIDDEN; prefer-encrypt=mutual; keydata=
 mQENBFuJVeEBCADAhVktqEkcI1afVu75HQXC0CBQA7O77a9MEFk0AHCS/3F69GBZ5uhoLFwL
 sidR383IhosUMhFK60k+lF5y+FqzrnCcgyos+aNpmpFxoAF1cyonZyyoqyqcKxwtwaBAs67c
 6H9obPPBkP9kfAt40JEMNUXodcDiqJkZPtaS07yT+Ydud8JROX9pQpCUBikTZRsr0POU8Xi6
 BBsNL3wmHF9OjRV8hAykmzWhUOJCdcgaWAqMAGfDdVEK/QLGN/WukIeCMykMpB3ft8rCtW7Y
 SfKegRkTMDjIewmHcAO1vxNKUylm3WMe/+VG0f4fHqdb/d0U7E1f8SEL+gbwDBoCW9V7ABEB
 AAG0GE5vbmF4IDxub25heEBwb3N0ZW8ubmV0PokBTgQTAQgAOBYhBIHKsVNWX9DYD0HK/jJY
 uORdjV2iBQJbiVXhAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEDJYuORdjV2iGWAH
 /2lkSJIxllLP5Y6+JbQXSH7yjxeRCP7JrhAaNCR7NE0zerWh77Y/YnqWWPdbd/GnLL7C6Pqt
 qTzK/Wrh8jjbI9sPq6eITMoeLr11KyeKBMeEnyrLFu7OQAcVelavZuPZVKwcvNhgbk0Jk2cZ
 zOGhxkw/msuYJm/ShE8ENzm0Y0jJmpLykVBhLWtHYuYa+XIXfvxr+2pNsf/ARR//uYfCIeTY
 O7yNvoV2ueEv33uQvJK2rCEdlYF3H/GmTQ0w8fTtXpD6xoxWfBwJV+nB9I/KuKrEpj7fAzxD
 SE820WPfkI7HBh7KcImrnzaS9xckTu7Oy46XiRQVDeqjyXf/+6qnnum5AQ0EW4lV4QEIAM75
 ZE6pfxX28Kp1KD8+k8XY1WgAuycyviJy/ANEcwgR7eIr8tuKcOqiqvrMc4kKdpG5sm37lczN
 F1KDDwJmONfjNk322dn0hznPbZAvCiPB+95ajeBuEc7U3qKq8OaX8XClsCXqC3vgMDT6GI6+
 fu0DndoFlks8XQFLF1hiwpLV8I6tGV6jLwQxgq4rTuZ5bP89TK2rOK7CPrJy9eH1fNB4j+J2
 /w20Eo2bxHmfARSLrl2mqmsqsglE52aIZOfkgJBXHBA6JuviuSYB8haFpLIJNjedI2jneyeD
 z2lem7zhYYRTYCXVq2ccZRmY6iGVGNrkDmaIFrRYyK45cXkZbNMAEQEAAYkBNgQYAQgAIBYh
 BIHKsVNWX9DYD0HK/jJYuORdjV2iBQJbiVXhAhsMAAoJEDJYuORdjV2i4zUH/i3h8eON47/8
 j7a7HNdZSR12wjagkUIF/mPhFo/YKQ1RigB6QORluMNrMFbNZ1Eyifr94sawD/mrA6Mkumi4
 awMzkZwO8aLYU5LVuMldYJj6UPm6wTlV3jjUtp0BCkFMOAKABfBgwJuF2xfpT+ijdDAcFcq6
 bw7SCyk3/WeoJ8yVa0y0zsGPtBuQYfixeE9GIsrk/KOjWyJQVx7SUnM1c16bc7apcYIniE0+
 hVFvIEH27OcWywotnWmWW6DCvTxfpP77HkOhWy0vNOXoPpgRx21om1pExYu+Xe98r7D5DBx0
 40vbq4AKkltTkKzU3wGnbyatRB2oFrXHETDDBOKPSsI=
Message-ID: <2edcfc59-59b4-4609-93d5-aba610e2c541@HIDDEN>
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 <at> debbugs.gnu.org, emacs-devel@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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 <mode>-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.
> 




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43116; Package emacs. Full text available.

Message received at 43116 <at> debbugs.gnu.org:


Received: (at 43116) by debbugs.gnu.org; 31 Aug 2020 11:34:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 31 07:34:39 2020
Received: from localhost ([127.0.0.1]:51728 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kCi59-0003uz-7k
	for submit <at> 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 <acm@HIDDEN>) id 1kCi54-0003ui-PB
 for 43116 <at> 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@HIDDEN>
From: Alan Mackenzie <acm@HIDDEN>
To: Nonax <nonax@HIDDEN>
Subject: Re: bug#43116: 27.1;
 with-eval-after-load executes BODY multiple times for fortran
Organization: muc.de e.V.
In-Reply-To: <mailman.1792.1598806565.2469.bug-gnu-emacs@HIDDEN>
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@HIDDEN, 43116 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Nonax.

In article <mailman.1792.1598806565.2469.bug-gnu-emacs@HIDDEN> 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).





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43116; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Aug 2020 16:55:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 30 12:55:17 2020
Received: from localhost ([127.0.0.1]:50668 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kCQbs-0007nj-V4
	for submit <at> 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 <nonax@HIDDEN>) id 1kCQ2n-0006yy-Nt
 for submit <at> 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 <nonax@HIDDEN>) id 1kCQ2n-0005St-Ig
 for bug-gnu-emacs@HIDDEN; 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 <nonax@HIDDEN>) id 1kCQ2l-0003BL-0P
 for bug-gnu-emacs@HIDDEN; 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 <bug-gnu-emacs@HIDDEN>; 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 <bug-gnu-emacs@HIDDEN>; Sun, 30 Aug 2020 18:18:51 +0200 (CEST)
To: bug-gnu-emacs@HIDDEN
Subject: 27.1; with-eval-after-load executes BODY multiple times for fortran
From: Nonax <nonax@HIDDEN>
Autocrypt: addr=nonax@HIDDEN; prefer-encrypt=mutual; keydata=
 mQENBFuJVeEBCADAhVktqEkcI1afVu75HQXC0CBQA7O77a9MEFk0AHCS/3F69GBZ5uhoLFwL
 sidR383IhosUMhFK60k+lF5y+FqzrnCcgyos+aNpmpFxoAF1cyonZyyoqyqcKxwtwaBAs67c
 6H9obPPBkP9kfAt40JEMNUXodcDiqJkZPtaS07yT+Ydud8JROX9pQpCUBikTZRsr0POU8Xi6
 BBsNL3wmHF9OjRV8hAykmzWhUOJCdcgaWAqMAGfDdVEK/QLGN/WukIeCMykMpB3ft8rCtW7Y
 SfKegRkTMDjIewmHcAO1vxNKUylm3WMe/+VG0f4fHqdb/d0U7E1f8SEL+gbwDBoCW9V7ABEB
 AAG0GE5vbmF4IDxub25heEBwb3N0ZW8ubmV0PokBTgQTAQgAOBYhBIHKsVNWX9DYD0HK/jJY
 uORdjV2iBQJbiVXhAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEDJYuORdjV2iGWAH
 /2lkSJIxllLP5Y6+JbQXSH7yjxeRCP7JrhAaNCR7NE0zerWh77Y/YnqWWPdbd/GnLL7C6Pqt
 qTzK/Wrh8jjbI9sPq6eITMoeLr11KyeKBMeEnyrLFu7OQAcVelavZuPZVKwcvNhgbk0Jk2cZ
 zOGhxkw/msuYJm/ShE8ENzm0Y0jJmpLykVBhLWtHYuYa+XIXfvxr+2pNsf/ARR//uYfCIeTY
 O7yNvoV2ueEv33uQvJK2rCEdlYF3H/GmTQ0w8fTtXpD6xoxWfBwJV+nB9I/KuKrEpj7fAzxD
 SE820WPfkI7HBh7KcImrnzaS9xckTu7Oy46XiRQVDeqjyXf/+6qnnum5AQ0EW4lV4QEIAM75
 ZE6pfxX28Kp1KD8+k8XY1WgAuycyviJy/ANEcwgR7eIr8tuKcOqiqvrMc4kKdpG5sm37lczN
 F1KDDwJmONfjNk322dn0hznPbZAvCiPB+95ajeBuEc7U3qKq8OaX8XClsCXqC3vgMDT6GI6+
 fu0DndoFlks8XQFLF1hiwpLV8I6tGV6jLwQxgq4rTuZ5bP89TK2rOK7CPrJy9eH1fNB4j+J2
 /w20Eo2bxHmfARSLrl2mqmsqsglE52aIZOfkgJBXHBA6JuviuSYB8haFpLIJNjedI2jneyeD
 z2lem7zhYYRTYCXVq2ccZRmY6iGVGNrkDmaIFrRYyK45cXkZbNMAEQEAAYkBNgQYAQgAIBYh
 BIHKsVNWX9DYD0HK/jJYuORdjV2iBQJbiVXhAhsMAAoJEDJYuORdjV2i4zUH/i3h8eON47/8
 j7a7HNdZSR12wjagkUIF/mPhFo/YKQ1RigB6QORluMNrMFbNZ1Eyifr94sawD/mrA6Mkumi4
 awMzkZwO8aLYU5LVuMldYJj6UPm6wTlV3jjUtp0BCkFMOAKABfBgwJuF2xfpT+ijdDAcFcq6
 bw7SCyk3/WeoJ8yVa0y0zsGPtBuQYfixeE9GIsrk/KOjWyJQVx7SUnM1c16bc7apcYIniE0+
 hVFvIEH27OcWywotnWmWW6DCvTxfpP77HkOhWy0vNOXoPpgRx21om1pExYu+Xe98r7D5DBx0
 40vbq4AKkltTkKzU3wGnbyatRB2oFrXHETDDBOKPSsI=
Message-ID: <6a275221-6158-8b3e-648b-ceb0116a71b6@HIDDEN>
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@HIDDEN;
 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 <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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))




Acknowledgement sent to Nonax <nonax@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#43116; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 1 Sep 2020 04:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.