unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonathan Kyle Mitchell <kyle@jonathanmitchell.org>
To: 31326@debbugs.gnu.org, npostavs@gmail.com
Subject: bug#31326: 27.0.50; eshell/clear exceeds max-lisp-eval-depth
Date: Wed, 2 May 2018 23:09:55 -0500	[thread overview]
Message-ID: <16d9d5de-de45-4585-14a1-5f2701314bc5@jonathanmitchell.org> (raw)
In-Reply-To: <87tvrro9bz.fsf@gmail.com>



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 <kyle@jonathanmitchell.org> 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






  reply	other threads:[~2018-05-03  4:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01  6:08 bug#31326: 27.0.50; eshell/clear exceeds max-lisp-eval-depth Jonathan Kyle Mitchell
2018-05-01 12:21 ` Noam Postavsky
2018-05-03  4:09   ` Jonathan Kyle Mitchell [this message]
2018-05-04 10:42     ` Noam Postavsky
2018-05-04 18:07       ` Jonathan Kyle Mitchell
2018-05-04 20:16         ` Eli Zaretskii
2018-05-05  0:53           ` Jonathan Kyle Mitchell
2018-05-05  6:40             ` Eli Zaretskii
2018-07-11  1:30       ` Noam Postavsky

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=16d9d5de-de45-4585-14a1-5f2701314bc5@jonathanmitchell.org \
    --to=kyle@jonathanmitchell.org \
    --cc=31326@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).