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: Sun, 17 Jun 2018 23:27:40 +0000 Message-ID: <87a7rtuh77.fsf@gmail.com> References: <87efh5uxkl.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529278036 6335 195.159.176.226 (17 Jun 2018 23:27:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 17 Jun 2018 23:27:16 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 18 01:27:12 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 1fUh4h-0001Xf-Qm for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Jun 2018 01:27:11 +0200 Original-Received: from localhost ([::1]:56688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUh6n-0008A4-EO for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jun 2018 19:29:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUh5h-000859-KC for help-gnu-emacs@gnu.org; Sun, 17 Jun 2018 19:28:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUh5E-0000rE-9W for help-gnu-emacs@gnu.org; Sun, 17 Jun 2018 19:28:13 -0400 Original-Received: from mail-qk0-x234.google.com ([2607:f8b0:400d:c09::234]:45546) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUh5D-0000pT-QB for help-gnu-emacs@gnu.org; Sun, 17 Jun 2018 19:27:44 -0400 Original-Received: by mail-qk0-x234.google.com with SMTP id c198-v6so8462574qkg.12 for ; Sun, 17 Jun 2018 16:27:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=dIbwdE1gMz+mfZzNS25gGKpeaLcCXp8YKN5p0JO32s4=; b=XCr/o4gS/Og2QDzhgKghU4N2wn/GYGvneUYjCfPvWK/cbUYWhfbi5+V/TQhT3apIwR 4BZ28UDQbTn115n7XiFJ1LpQLR13KhzQ30ex96wG9K8oIJg5WpWfXUyBGuZFhUMNxERE 2TG2UOz1Th8i2cdAJPa3mkJmVy/yD7d+1D1+smFW5yR6tdOMexP+uxbzWyS91Yo5PTBv n4zbYyjiD2iHUgXcWV0FduPyy7hkPg1vUqxP6/jKwQaBqjLZy/+CFydBL0ZiRewDRIAC sBfoE+0B2G7K+6uW4Cz2qw5HPQ4Yxb2MBQGbj9EscIysS1dYyeC0xbIRnhiy3f47Dar/ dUqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=dIbwdE1gMz+mfZzNS25gGKpeaLcCXp8YKN5p0JO32s4=; b=T16ixYMmEimTHFkiCdDoOx9nEkXHKwvbuKUrw+SXrmVR+WN/6US2OZ+1I26dNlTNUR dBYjvU6SKiB9+3mABZ9TZfvmzedFcqZpToPKEZkDuusc7NLV7wo9JE73eqB4jJiXAMaW 6MH+qMjwEjucOxPbxVC7CNlno90mqqOkM1Q6qYC/8fWBw9kma7osJpSc16UfPPBVSg0v SGY7VAiqOipGGuf6y85dPkdBkTJH3BnssDHasRTHBt3G9V2fwF9msyzcW/X0+CHK/wBs fpmf1AT/MHACYAFp4Pz/O4rp29/zvA2lkJO5ddqd0BMkLqpb+SgdfNgsMXsGze/Gw/ig bj4A== X-Gm-Message-State: APt69E2PLZbMpGK4cmKP4ySLRRDcP5LYlNQu+dgSFSJxps+q3zY2cZB4 YqnEFxy91c6pb0dw8G/NKxKVOwt4 X-Google-Smtp-Source: ADUXVKKKa3QQohtUTc404J47LCxWldTSZIKKiaAoJOCQGCbBWtTRI8g6XtquodU6OCnVF6YTPUtbRg== X-Received: by 2002:a37:8e87:: with SMTP id q129-v6mr8526283qkd.76.1529278062812; Sun, 17 Jun 2018 16:27:42 -0700 (PDT) Original-Received: from dee925c335f3 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id c19-v6sm8041171qtp.22.2018.06.17.16.27.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jun 2018 16:27:41 -0700 (PDT) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::234 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:117193 Archived-At: Stefan Monnier 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!