unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Nonax <nonax@posteo.net>
Cc: 43116@debbugs.gnu.org
Subject: bug#43116: 27.1; with-eval-after-load executes BODY multiple times for fortran
Date: Sat, 12 Jun 2021 14:46:20 +0200	[thread overview]
Message-ID: <87im2j6yjn.fsf@gnus.org> (raw)
In-Reply-To: <6a275221-6158-8b3e-648b-ceb0116a71b6@posteo.net> (nonax@posteo.net's message of "Sun, 30 Aug 2020 18:18:51 +0200")

Nonax <nonax@posteo.net> 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





      parent reply	other threads:[~2021-06-12 12:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30 16:18 bug#43116: 27.1; with-eval-after-load executes BODY multiple times for fortran Nonax
     [not found] ` <mailman.1792.1598806565.2469.bug-gnu-emacs@gnu.org>
2020-08-31 11:34   ` Alan Mackenzie
2021-06-12 12:46 ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87im2j6yjn.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=43116@debbugs.gnu.org \
    --cc=nonax@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).