From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Shahid Newsgroups: gmane.emacs.help Subject: Re: debugging post command hook max-lisp-eval-depth Date: Mon, 18 Jun 2018 12:33:36 -0400 Message-ID: References: <87efh5uxkl.fsf@gmail.com> <87a7rtuh77.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1529339828 6216 195.159.176.226 (18 Jun 2018 16:37:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Jun 2018 16:37:08 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 18 18:37:04 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUx9H-0001Oi-FK for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jun 2018 18:36:59 +0200 Original-Received: from localhost ([::1]:35873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUxBO-0000sc-Ox for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jun 2018 12:39:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUx6F-0005yH-9T for help-gnu-emacs@gnu.org; Mon, 18 Jun 2018 12:33:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUx6E-0006SQ-7C for help-gnu-emacs@gnu.org; Mon, 18 Jun 2018 12:33:51 -0400 Original-Received: from mail-pl0-x22c.google.com ([2607:f8b0:400e:c01::22c]:40611) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUx6D-0006Rc-Tb for help-gnu-emacs@gnu.org; Mon, 18 Jun 2018 12:33:50 -0400 Original-Received: by mail-pl0-x22c.google.com with SMTP id t12-v6so9314509plo.7 for ; Mon, 18 Jun 2018 09:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gY5qZD1S0HnrihiAHE+h/xM+I1Lsu6Dhs2AtKLAnQNM=; b=px7l7iM4yoM2agHBzMsNx+de7kd3ZL7E4JU4nYlDyypO32L33L0kItV4rOMifHhIzD 76vGigY4i7whIxqV/PpL7rHWuwR9edIgfPJ5Acgt6v0AS1U9YeINgPB++DL10NzC0w6/ XZPiPCA7xdAKb63usOHFPBzLtmWdvGPR2D68l32WUavKPu1FNZD6Q0FVWTrwUVZSGQKc 2FB1qbRJ6mWeOVxHoy7BnlSv6eTlkIEL05BYoGDEbZZvtMugq2t6r6Shxz8AF/9Jt6+N XK9/3tusgQbxslRZs98i5dJlzLcZLltNkhAXbegzTGePtKylLqW9EghvFCpFUbU/ZzXF NLQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gY5qZD1S0HnrihiAHE+h/xM+I1Lsu6Dhs2AtKLAnQNM=; b=BfXgNhPktJmMB4Iw7K+aGFeWLG2xLUoAbSxRWwDaQ/FGt7iJ0uZXhh0jn1ceaYBfGZ sR28vD7woPuaXeuCuFYPozGKibLOoEksMs1LMDXmhob/LBHOWgjlurPrU/uGx1+stizd CHDAO5eszsLiIf/wDi9GB90y7WsuOWQlke1e9EeOg9tt3DotZN23smjzITKF7q1Z0iEK U6xqaF2I+Y4hj1AqkHUlW4qdOyWKwSRjA6k9KtjpcGYpsA6ZJbDwQ7mZUTunIpSyaFpJ Cr6SetfoVFCY/m1+zSvlqxJMhuI0Dv7QBUHc8hIOcOUI9A4UgB+uTBUDeMntfKIjUuSe +B5g== X-Gm-Message-State: APt69E3FcAYR3gGXmLDFN/QVnSaaRZALM0OdGb7FQogumyzdsCAHR4gr AW+VB2qMU38GzxrGS/p5418RiLj+t42gNcGxWFY= X-Google-Smtp-Source: ADUXVKKF9o+3amfbEz6mjsgT7G/IMHISFWNt39yUqduL61gvVSP6eIHKIHqI1P27Rm88sj5su+YStmcS3jY9/HxSaEw= X-Received: by 2002:a17:902:be0b:: with SMTP id r11-v6mr15248074pls.182.1529339628678; Mon, 18 Jun 2018 09:33:48 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::22c X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117202 Archived-At: On Mon, Jun 18, 2018, 10:03 AM Stefan Monnier 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 >