GNU bug report logs - #79157
[PATCH] Fix recursive load when 'calc-always-load-extensions' is set

Previous Next

Package: emacs;

Reported by: Sean Devlin <spd <at> toadstyle.org>

Date: Sat, 2 Aug 2025 16:33:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 79157 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79157; Package emacs. (Sat, 02 Aug 2025 16:33:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sean Devlin <spd <at> toadstyle.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 02 Aug 2025 16:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sean Devlin <spd <at> toadstyle.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Fix recursive load when 'calc-always-load-extensions' is set
Date: Sat, 2 Aug 2025 11:31:53 -0500
[Message part 1 (text/plain, inline)]
Hi folks,

The Calc setting calc-always-load-extensions leads to a recursive load
error if you set it in your init file before loading calc.el. (If you set it after
loading calc.el, e.g. via calc-settings-file, there is no recursive error, but
it also doesn’t load the extensions.)

To reproduce:

1. Emacs -Q
2. Eval: (setq calc-always-load-extensions t)
3. M-x calc RET

You should see a recursive load error.

This is due to this top-level stanza near the bottom of calc.el:

(when calc-always-load-extensions
  (require 'calc-ext)
  (calc-load-everything))

This can never work as written, since calc-ext.el requires calc.el.

I took a stab at correcting this by deleting this stanza and moving the
call to calc-load-everything inside calc-create-buffer. I’m not sure if
this is the best way, so feedback is welcome.

Thanks!

[0001-Fix-recursive-load-when-calc-always-load-extensions-.patch (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.6.0, NS
appkit-2575.70 Version 15.6 (Build 24G84)) of 2025-08-02 built on
beatrix.local
Repository revision: 49e34dede07b2151dadc0e1f71cc4405ba7f42f5
Repository branch: calc-always-load-extensions-fix
Windowing system distributor 'Apple', version 10.3.2575
System Description:  macOS 15.6

Configured using:
'configure --with-ns --with-modules --with-native-compilation
--with-libgmp --with-tree-sitter --with-sqlite3 --with-mps=yes
--without-imagemagick --without-dbus CPPFLAGS=-I/opt/homebrew/include
LDFLAGS=-L/opt/homebrew/lib PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig
ac_cv_func_posix_spawn_file_actions_addchdir=no'

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79157; Package emacs. (Sat, 02 Aug 2025 16:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 79157 <at> debbugs.gnu.org (full text, mbox):

From: Sean Devlin <spd <at> toadstyle.org>
To: Sean Devlin <spd <at> toadstyle.org>
Cc: 79157 <at> debbugs.gnu.org
Subject: Re: [PATCH] Fix recursive load when 'calc-always-load-extensions' is
 set
Date: Sat, 2 Aug 2025 11:47:35 -0500
> On Aug 2, 2025, at 11:31 AM, Sean Devlin <spd <at> toadstyle.org> wrote:
> 
> Hi folks,
> 
> The Calc setting calc-always-load-extensions leads to a recursive load
> error if you set it in your init file before loading calc.el. (If you set it after
> loading calc.el, e.g. via calc-settings-file, there is no recursive error, but
> it also doesn’t load the extensions.)
> 

To reproduce the latter issue, i.e. failure to load extensions:

1. Emacs -Q
2. M-x load-library calc RET
3. Evaluate: (setq calc-always-load-extensions t)
4. M-x calc RET
5. Evaluate: (featurep 'calc-aent)

The result will be nil.

Alternately, by using the settings file:

1. mkdir /tmp/emacs-calc
2. HOME=/tmp/emacs-calc emacs
3. M-x calc RET
4. m x
5. m m
6. C-x C-c
7. Repeat steps 2 and 3
8. Evaluate: (featurep 'calc-aent)

The result will be nil.



This bug report was last modified 12 days ago.

Previous Next


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