all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Shahid <jvshahid@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: debugging post command hook max-lisp-eval-depth
Date: Mon, 18 Jun 2018 12:33:36 -0400	[thread overview]
Message-ID: <CAE5=+KUhXRioa6-MwUrd=c_Lk8L7b1rWMUPGmb3hChVP_Wz3Lg@mail.gmail.com> (raw)
In-Reply-To: <jwvh8m0cik9.fsf-monnier+emacs@gnu.org>

On Mon, Jun 18, 2018, 10:03 AM Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> >> 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).
>
> Hmm... I don't understand what you mean: when you say "I don't think
> there is a specific hook that is recursing infinitely" do you mean hook
> as in "post-command-hook" or in "one of the functions placed on
> post-command-hook"?
>
> Then you say "the two ... were global minor modes", but I fail to see
> how a "hook" can be a "minor mode".
>

Sorry, I meant functions placed on the hook.


> >> 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.
>
> Now that I think about it, the message you get should say which hook
> function had an error, since the message is emitted with:
>
>   AUTO_STRING (format, "Error in %s (%S): %S");
>   Lisp_Object hook = args[0];
>   Lisp_Object fun = args[1];
>   CALLN (Fmessage, format, hook, fun, error);
>
> where `fun` is the function during which the error was signaled.
>

That's what I was trying to explain above. The function name in the error
message isn't consistent.


> So if you only get "Lisp nesting exceeds...", check your *Messages* and
> if even there you don't have the "Error in ... (...): ..." message, it
> means that the error was most likely signaled elsewhere than in
> post-command-hook.
>
>
>         Stefan
>


  reply	other threads:[~2018-06-18 16:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-17 17:34 debugging post command hook max-lisp-eval-depth John Shahid
2018-06-17 19:16 ` Stefan Monnier
2018-06-17 23:27   ` John Shahid
2018-06-18 14:03     ` Stefan Monnier
2018-06-18 16:33       ` John Shahid [this message]
2018-06-18 16:53         ` Stefan Monnier
2018-06-18 18:10           ` John Shahid
2018-06-20 19:31             ` John Shahid
2018-06-20 21:53               ` Stefan Monnier
2018-06-22  4:38                 ` Leo Liu
2018-06-23 15:15                   ` John Shahid

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

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

  git send-email \
    --in-reply-to='CAE5=+KUhXRioa6-MwUrd=c_Lk8L7b1rWMUPGmb3hChVP_Wz3Lg@mail.gmail.com' \
    --to=jvshahid@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.