* bug#50126: 28.0.50; "mode: conf" and "mode: tex" get unbounded recursion
@ 2021-08-19 17:11 Bob Rogers
2021-08-20 13:58 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Bob Rogers @ 2021-08-19 17:11 UTC (permalink / raw)
To: 50126
In "emacs -Q" in master rebuilt a few hours ago, when I open the file
shown below with "# -*- mode: conf; -*-" I get a "Lisp nesting exceeds
max-lisp-eval-depth " error because conf-mode is trying to dispatch to
one of its submodes, but the submode then calls run-mode-hooks which
ends up back in conf-mode, ad inf. Using this minimal broken.conf file:
# -*- mode: conf; -*-
is sufficient; here's the top of the backtrace:
Debugger entered--Lisp error: (error "Lisp nesting exceeds max-lisp-eval-depth ")
apply(#f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>) #f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>) nil)
conf-mode()
conf-unix-mode()
#f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>)(#f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>))
apply(#f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>) #f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>) nil)
conf-mode()
hack-one-local-variable(mode conf)
hack-local-variables-apply()
hack-local-variables(no-mode)
run-mode-hooks(conf-unix-mode-hook)
conf-unix-mode()
#f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>)(#f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>))
apply(#f(compiled-function (orig-fun) "Redirect to one of the submodes when called directly." #<bytecode -0xe6df0765af3b07>) #f(compiled-function () (interactive nil) #<bytecode 0xdf70887525b4bad>) nil)
conf-mode()
hack-one-local-variable(mode conf)
. . .
It fails with conf-unix-mode in the simple case of the configuration
file above; unsurprisingly, I've also seen it fail with conf-space-mode.
And "mode: tex;" has the same general problem, since it uses the same
dispatch logic.
I would attempt a patch, but I have no clue what TRT would be here.
It would seem cleanest to keep conf-mode and tex-mode as user-visible
modes, and make new generic-conf-mode and generic-tex-mode parents for
their submodes, but that seems like it could be a fairly large change.
Using delay-mode-hooks might be simpler, but I have no idea how that
would work.
-- Bob Rogers
http://www.rgrjr.com/
------------------------------------------------------------------------
In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
of 2021-08-19 built on orion
Repository revision: a44432a773f7e131692e3f5c9d765cffeef0739a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: openSUSE Leap 15.3
Configured using:
'configure --with-dbus=no --with-gsettings=no --with-gif=ifavailable
--with-tiff=no --with-gnutls=yes --with-gconf=no'
Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG LIBSELINUX LIBXML2
MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#50126: 28.0.50; "mode: conf" and "mode: tex" get unbounded recursion
2021-08-19 17:11 bug#50126: 28.0.50; "mode: conf" and "mode: tex" get unbounded recursion Bob Rogers
@ 2021-08-20 13:58 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-20 13:58 UTC (permalink / raw)
To: Bob Rogers; +Cc: 50126
Bob Rogers <rogers@rgrjr.com> writes:
> It fails with conf-unix-mode in the simple case of the configuration
> file above; unsurprisingly, I've also seen it fail with conf-space-mode.
> And "mode: tex;" has the same general problem, since it uses the same
> dispatch logic.
Yeah, that's pretty odd dispatch logic, but I guess it's for historical
reasons.
The easy way to hack around this issue is to just disable recursion via
file-local variables, so I've done that now in Emacs 28.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-20 13:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 17:11 bug#50126: 28.0.50; "mode: conf" and "mode: tex" get unbounded recursion Bob Rogers
2021-08-20 13:58 ` Lars Ingebrigtsen
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).