emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Insight into the mystery hangs


From: Kévin Le Gouguec
Subject: Re: Insight into the mystery hangs
Date: Tue, 13 Feb 2024 08:52:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "Eric S. Raymond" <esr@thyrsus.com>
>> Date: Sun, 11 Feb 2024 16:37:37 -0500 (EST)
>> 
>> However.  Emacs is not entirely off the hook here.  When I'm not under
>> deadline pressure I will file a bug with a title something like
>> "With debug-on-quit enabled, Emacs does not reliably raise a debug
>> trace on interrupt of call-process"
>
> Isn't that call issued from the mode-line display?  If so, that is
> done from redisplay, and redisplay cannot enter debugger, so it
> catches all errors.  If you want to produce Lisp backtraces from Lisp
> code called by redisplay, you need to use the facilities documented in
> the node "Debugging Redisplay" in the ELisp Reference manual.

Tangential, not so much about debugging errors during redisplay, than
merely noticing them: I do periodically forget that these errors are
caught, so every couple of months I find myself frowning at code
(font-locking, usually) that misbehaves yet fails to throw an error for
about five minutes, before remembering to check *Messages* for any
"Error during redisplay".

Couple of questions:

1. "For Science", I just did…

    (setq mode-line-format '(:eval (error "argh")))

   … and I am surprised that this *Messages* diagnostic…

    > Error during redisplay: (eval (error "argh") t) signaled (error "argh")

   … never seems to make its way to the echo area?  It's a small thing
   (I'll probably have *Messages* open when debugging so I'll notice
   eventually) but it is somewhat surprising that these warnings can
   pile up in *Messages* yet the echo area remains blank.

2. It's neat that…

    (setq mode-line-format '("foo " (:eval (error "argh")) " bar"))

   … will be "robust" enough to display "foo bar" in the mode-line;
   combined with the lack of echo-area reporting it does make it hard to
   ever know something went wrong though.  Might it make sense to (have
   an option to) substitute a signaling :eval form with some "[redisplay
   error]" placeholder?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]