From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Shahid Newsgroups: gmane.emacs.bugs Subject: bug#31793: 26.1; (error "Lisp nesting exceeds =?UTF-8?Q?=E2=80=98max-lisp-eval-depth=E2=80=99?=") Date: Sat, 23 Jun 2018 15:47:11 +0000 Message-ID: <87k1qpsdxc.fsf@gmail.com> References: <99D8E495-B396-4266-8BF1-BA0B609DEC3D@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1529768770 24355 195.159.176.226 (23 Jun 2018 15:46:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 23 Jun 2018 15:46:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 31793@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 23 17:46:05 2018 Return-path: Envelope-to: geb-bug-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 1fWkjj-0006EZ-Ol for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jun 2018 17:46:03 +0200 Original-Received: from localhost ([::1]:38911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWklr-0004vN-5I for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jun 2018 11:48:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWklj-0004vG-Jr for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 11:48:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWkle-0008ED-ML for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 11:48:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53699) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWkle-0008E9-Hp for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 11:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fWkle-0000M9-8L for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 11:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Shahid Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jun 2018 15:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31793 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31793-submit@debbugs.gnu.org id=B31793.15297688411311 (code B ref 31793); Sat, 23 Jun 2018 15:48:02 +0000 Original-Received: (at 31793) by debbugs.gnu.org; 23 Jun 2018 15:47:21 +0000 Original-Received: from localhost ([127.0.0.1]:33363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fWkkz-0000L5-2x for submit@debbugs.gnu.org; Sat, 23 Jun 2018 11:47:21 -0400 Original-Received: from mail-qt0-f173.google.com ([209.85.216.173]:47085) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fWkkx-0000Kp-Ry for 31793@debbugs.gnu.org; Sat, 23 Jun 2018 11:47:20 -0400 Original-Received: by mail-qt0-f173.google.com with SMTP id h5-v6so8538040qtm.13 for <31793@debbugs.gnu.org>; Sat, 23 Jun 2018 08:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Za41SpfQ9PtegiNEfsziujxT/Dl0lVOCwg55jZdgKiQ=; b=uLGCQdh+IXF7kW8qm6udn+TdXaErwHUDLA18NixW2BMssw73yog1v61CkssC4JaxUX TVU8mMsxqQg6KEGDsJ0Ixl62ivDsHIU23jOpDHzJHAjgzCz866DD8HY0fMLeQO4Z0sMs Ue7rBl2K90ZuzJBoqOLXuxkW96pK9f39K8SiRkG5t4yu0LnvTORwJkSz9Oi3Gq+vJDvL oowHGqNJOPhhyGDMx/wDET/cFjOP2kyBqWhxR3+n9EE2TydnQCujdkccVjderRcm6aym 9zu5ZP2++eql5ZeaL4jV0rNz2MxlDXpY0bAtsSyRAAkY2wfwfRXK325PMOXMZzWWY/dx TxCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Za41SpfQ9PtegiNEfsziujxT/Dl0lVOCwg55jZdgKiQ=; b=rnkC8xyMrSlj0BrqZ70Sic2KixtCv2FkKu0ak+yU1s5rm5qyxHSCn+6I3fojvB+v4A /c+wICV0LcA1zObp9ptgv0pHU5LrKYnMZqw8Ishn1yKV1OkbahjU2sBDJGJSDPBiKwm6 Dn7dtVLIKQEAX6yv8SHllbnUuxfbwu/p/16qpeNBAK1FQWPrrw76aW/pThFj8tJe88tV XneLEouLrFxABpJwz4oTz4hQv32G1Eq/vv9EjPB7BIdCVweYYAngTXcR/k5iSv0H6jdc zenyIvUaUnrgUKvTs4YAW3oAbZ7ACLboAVMz5Fcftg4GxdEmnM7Z+IbpbZHsUnWE9EG9 WV8w== X-Gm-Message-State: APt69E2UBLqBca7x9+Me3dCVWAa0VNEO+KNKz+lPQFu0wyJnUVqJ0BZ3 q+dyzyttAyhYw90gW7uMe9NGMMwL X-Google-Smtp-Source: ADUXVKKuoZ0UKtiA4fxCUwmFhSL0kC5OisHeQ/OM/OpEPFTQVREGBUZFzJ1xDMel3HAmI0gV6Slpzg== X-Received: by 2002:aed:2c63:: with SMTP id f90-v6mr3254493qtd.352.1529768833914; Sat, 23 Jun 2018 08:47:13 -0700 (PDT) Original-Received: from 01d9722383d0 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id g56-v6sm9467209qta.83.2018.06.23.08.47.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jun 2018 08:47:12 -0700 (PDT) In-Reply-To: (Leo Liu's message of "Tue, 12 Jun 2018 16:46:11 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147775 Archived-At: --=-=-= Content-Type: text/plain Leo Liu writes: > On 2018-06-12 08:21 +0300, Eli Zaretskii wrote: >> Ugh, macOS... This means no xbacktrace and no other GDB >> wizardry... > > Indeed. > >> Well, I think the most important thing is to produce a Lisp >> backtrace from the error. > > Turns out 26.1 cannot load a version of python.el (by dave love) that I > have in my site-lisp. > > 1. emacs -Q -l python.el > 2. M-x python-mode > > ,----[ error ] > | Variable binding depth exceeds max-specpdl-size > | Error in post-command-hook (global-eldoc-mode-check-buffers): (error "Variable binding depth exceeds max-specpdl-size") > `---- > > Gnus was just loading python-mode to fontify some code in an article. double posting since I sent the email only to Leo. VVVV original email VVVV That seems to be a result of converting `global-eldoc-mode' to use `define-globalized-minor-mode' in 2349f. The recursive call seems to be a result of the following sequence of calls: 1. python-mode is enabled which adds an eldoc-mode-hook 2. eldoc-mode is turned on in the buffer triggering python's eldoc-mode-hook 3. python-mode hook will start an inferior process which in turn trigger ,MODE-enable-in-buffers 4. ,MODE-enable-in-buffers will go over the list again trying to enable eldoc-mode The problem is in step 4. The eldoc-global-mode buffer list isn't reset in step 2. Step 4 will try to enabe the mode for the same buffer and start a sequence of calls at 2. I was able to fix this problem by setting the buffer-list to nil inside ,MODE-enable-in-buffers. I attached a patch below. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-avoid-turning-on-the-global-minor-mode-recursively.patch >From 9f6bb1c2d9cac8ccea129242d6977bc848b3f715 Mon Sep 17 00:00:00 2001 From: John Shahid Date: Sat, 23 Jun 2018 11:12:44 -0400 Subject: [PATCH] avoid turning on the global-minor-mode recursively * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): reset the buffer-list inside ,MODE-enable-in-buffers to avoid enabling the mode recursively --- lisp/emacs-lisp/easy-mmode.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index a81b6fefb2..d363634236 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -457,7 +457,9 @@ define-globalized-minor-mode ;; The function that calls TURN-ON in each buffer. (defun ,MODE-enable-in-buffers () - (dolist (buf ,MODE-buffers) + (let ((buffers ,MODE-buffers)) + (setq ,MODE-buffers nil) + (dolist (buf buffers) (when (buffer-live-p buf) (with-current-buffer buf (unless ,MODE-set-explicitly @@ -467,12 +469,11 @@ define-globalized-minor-mode (,mode -1) (funcall #',turn-on)) (funcall #',turn-on)))) - (setq ,MODE-major-mode major-mode))))) + (setq ,MODE-major-mode major-mode)))))) (put ',MODE-enable-in-buffers 'definition-name ',global-mode) (defun ,MODE-check-buffers () (,MODE-enable-in-buffers) - (setq ,MODE-buffers nil) (remove-hook 'post-command-hook ',MODE-check-buffers)) (put ',MODE-check-buffers 'definition-name ',global-mode) -- 2.17.1 --=-=-=--