From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jonathan Kyle Mitchell Newsgroups: gmane.emacs.bugs Subject: bug#31326: 27.0.50; eshell/clear exceeds max-lisp-eval-depth Date: Wed, 2 May 2018 23:09:55 -0500 Message-ID: <16d9d5de-de45-4585-14a1-5f2701314bc5@jonathanmitchell.org> References: <4d356aa0-7783-e22f-b943-0a3f70119b94@jonathanmitchell.org> <87tvrro9bz.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1525320550 9878 195.159.176.226 (3 May 2018 04:09:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 May 2018 04:09:10 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 To: 31326@debbugs.gnu.org, npostavs@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 03 06:09: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 1fE5YD-0002Mc-IV for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 May 2018 06:09:01 +0200 Original-Received: from localhost ([::1]:53868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE5aK-0001zf-Fv for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 May 2018 00:11:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE5aD-0001zN-JW for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 00:11:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fE5aA-000827-DT for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 00:11:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fE5aA-00081x-8s for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 00:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fE5aA-0000DP-3r for bug-gnu-emacs@gnu.org; Thu, 03 May 2018 00:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonathan Kyle Mitchell Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 May 2018 04:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31326 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 31326-submit@debbugs.gnu.org id=B31326.1525320607760 (code B ref 31326); Thu, 03 May 2018 04:11:02 +0000 Original-Received: (at 31326) by debbugs.gnu.org; 3 May 2018 04:10:07 +0000 Original-Received: from localhost ([127.0.0.1]:47586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fE5ZH-0000CC-9K for submit@debbugs.gnu.org; Thu, 03 May 2018 00:10:07 -0400 Original-Received: from mail-ot0-f182.google.com ([74.125.82.182]:38141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fE5ZD-0000Bc-Re for 31326@debbugs.gnu.org; Thu, 03 May 2018 00:10:04 -0400 Original-Received: by mail-ot0-f182.google.com with SMTP id j27-v6so19143195ota.5 for <31326@debbugs.gnu.org>; Wed, 02 May 2018 21:10:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=fEd+PYhe0ZnUp/ZXkCtR0KYKpFMFXUkAjc8msO1LNlM=; b=Yud5SuTFvPi/pjrbyljJrfH1biYUV1OCY9KmxoHo/X8oxLSpSdLyZyc6JHO/Q4x+Lc jVzfuc6xR+V41ABUEQyO8LY85O2GWb17w4OJhF8I9V8O6EcBWcK82SCFlfq0uhi2cW7T WF+02YtBenAkcDKU+XfIwTxldRuVYkBxOL8mfOXqNLvWMcBwiU5P2/FiWQYZWdMHZFZE npLLsykKPm10gWxz5zM9vJ1LdvrQWNjz9uYkd37aBkuSu9jSGc1FNB0iOLkYYO9Dv0Hf oMqCQ6P6ZrePNCdwctSU4IyduCGoEId+TqON3rkyPwxm5N7NH+JrpF/SdNIfbqSfQt8W LOjw== X-Gm-Message-State: ALQs6tBtrwOCc9ZGEsCogFMGSGOFsCPUQ2dWSKKerYH7El2rD4LLOOGg gNlJtFLHsxwyPTEqIYlWf+I= X-Google-Smtp-Source: AB8JxZoXgAXI8vQcJWeTCTuLFlAGtzzrAFMKFI3a5FnJl4MMUFNaJS0MwEi5DjyUXis1YjPEipKLIw== X-Received: by 2002:a9d:3f34:: with SMTP id m49-v6mr16152286otc.80.1525320597943; Wed, 02 May 2018 21:09:57 -0700 (PDT) Original-Received: from ?IPv6:2601:2c3:8880:3cc9:1089:6163:4bb7:b22d? ([2601:2c3:8880:3cc9:1089:6163:4bb7:b22d]) by smtp.gmail.com with ESMTPSA id y71-v6sm9238976oia.13.2018.05.02.21.09.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 21:09:56 -0700 (PDT) In-Reply-To: <87tvrro9bz.fsf@gmail.com> Content-Language: en-US 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:145960 Archived-At: On 05/01/2018 07:21 AM, Noam Postavsky wrote: > retitle 31326 eshell/clear goes into infinite loop with eshell-smart-initialize > found 31326 25 > tags 31326 + confirmed > quit > > Jonathan Kyle Mitchell writes: > >> The eshell/clear elisp function seems to go into an infinite loop before >> ending in an error when the eshell smart display functionality is >> enabled in eshell-mode-hook. Several "Error during redisplay" messages >> are printed to *Messages* buffer. >> >> Steps to reproduce: >> 1. ./emacs -Q >> 2. In the scratch buffer evaluate: >> (require 'em-smart) >> (add-hook 'eshell-mode-hook 'eshell-smart-initialize) >> 4. M-x eshell >> 5. type "clear" in eshell and press RET > This reproduces back to 25.3; it doesn't happen in 24.5, but "clear" > seems to do nothing in that version. I caught a backtrace (attached) > with M-x toggle-debug-on-quit and quickly hitting C-g. > I did a little more investigation into this issue. While I don't fully understand all the code paths of how it works, I found that let binding eshell-input-filter-functions to nil stops the infinite looping. Before issuing the clear command in eshell, eshell-input-filter-functions contains this list:     (eshell-smart-display-setup eshell-add-to-history) The original eshell/clear implementation just removes eshell-add-to-history, so eshell-input-filter-functions is just this list (which results in infinite looping):     (eshell-smart-display-setup) Here's a diff for the change that works for me: diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index bbb74c3d86..9f854c7d90 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -884,8 +884,7 @@ eshell/clear    (interactive)    (if scrollback        (eshell/clear-scrollback) -    (let ((eshell-input-filter-functions -           (remq 'eshell-add-to-history eshell-input-filter-functions))) +    (let ((eshell-input-filter-functions nil))        (insert (make-string (window-size) ?\n))        (eshell-send-input)))) -- Jonathan Kyle Mitchell