help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: debugging post command hook max-lisp-eval-depth


From: John Shahid
Subject: Re: debugging post command hook max-lisp-eval-depth
Date: Sun, 17 Jun 2018 23:27:40 +0000
User-agent: mu4e 1.1.0; emacs 27.0.50

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Hmm... post-command-hook is run via `safe_run_hooks` which is supposed
> to try and catch errors such that when an error is caught the
> corresponding function is removed from post-command-hook.

I don't think there is a specific hook that is recursing infinitely. The
two I noticed in the error message were both global minor modes
(magit-file-mode & display-line-numbers).

>
> Of course, this is a just a mitigating factor, but it should prevent the
> problem you describe, except in those cases where the offending function
> is constantly re-added (e.g. by a pre-command-hook).

I think that's the case, `define-globalized-minor-mode' will add the
post-command-hook in MODE-cmhh.

>
> Another approach is something like:
>
>     (advice-add 'debug :around
>       (lambda (&rest args)
>         (let ((post-command-hook nil))
>           (apply args))))

That's a great idea. Thanks!




reply via email to

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