Subject: Re: bug#43116: 27.1; with-eval-after-load executes BODY multiple times for fortran

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 12 Jun 2021 14:46:20 +0200

Nonax <[email-masked]> 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