From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#6691: 23.2; Eshell and ^M (PATCH attached) Date: Thu, 22 Jul 2010 16:30:04 +0100 Organization: University of Cambridge, England Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1279812939 22326 80.91.229.12 (22 Jul 2010 15:35:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Jul 2010 15:35:39 +0000 (UTC) Cc: John Wiegley To: 6691@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 22 17:35:38 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Obxo8-0003f3-BA for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Jul 2010 17:35:36 +0200 Original-Received: from localhost ([127.0.0.1]:53223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Obxjg-0005B0-S1 for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Jul 2010 11:31:00 -0400 Original-Received: from [140.186.70.92] (port=57260 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObxjU-00057p-B5 for bug-gnu-emacs@gnu.org; Thu, 22 Jul 2010 11:30:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObxjS-0004hs-ID for bug-gnu-emacs@gnu.org; Thu, 22 Jul 2010 11:30:48 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43339) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObxjS-0004hn-Fb for bug-gnu-emacs@gnu.org; Thu, 22 Jul 2010 11:30:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Obxil-0001km-Mb; Thu, 22 Jul 2010 11:30:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jul 2010 15:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6691 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6691-submit@debbugs.gnu.org id=B6691.12798125806696 (code B ref 6691); Thu, 22 Jul 2010 15:30:03 +0000 Original-Received: (at 6691) by debbugs.gnu.org; 22 Jul 2010 15:29:40 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObxiM-0001jx-VJ for submit@debbugs.gnu.org; Thu, 22 Jul 2010 11:29:39 -0400 Original-Received: from ppsw-32.csi.cam.ac.uk ([131.111.8.132]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObxiL-0001jr-FH for 6691@debbugs.gnu.org; Thu, 22 Jul 2010 11:29:38 -0400 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Original-Received: from cpc1-cmbg13-0-0-cust596.cmbg.cable.ntl.com ([86.9.122.85]:53588 helo=Victoria.local) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1Obxio-0007og-0u (Exim 4.72) (return-path ); Thu, 22 Jul 2010 16:30:06 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 22 Jul 2010 11:30:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38767 Archived-At: The problem is eshell-last-output-block-begin can point to a wrong position in the eshell buffer after truncating buffer. I tried to trace the reason of introducing eshell-last-output-block-begin but the revision history only goes back to 2000. It looks like cruft to me. So I propose the following fix. Leo commit 1f263a7a7d9d978b68006619a0d2a0d6dcbf39c1 Date: Thu Jul 22 16:21:30 2010 +0100 Remove cruft eshell-last-output-block-begin and fix #6691 Modified lisp/eshell/esh-mode.el diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index cc7f0df..ee9b299 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -213,7 +213,6 @@ This is used by `eshell-watch-for-password-prompt'." (defvar eshell-last-input-start nil) (defvar eshell-last-input-end nil) (defvar eshell-last-output-start nil) -(defvar eshell-last-output-block-begin nil) (defvar eshell-last-output-end nil) (defvar eshell-currently-handling-window nil) @@ -381,7 +380,6 @@ This is used by `eshell-watch-for-password-prompt'." (set (make-local-variable 'eshell-last-input-end) (point-marker)) (set (make-local-variable 'eshell-last-output-start) (point-marker)) (set (make-local-variable 'eshell-last-output-end) (point-marker)) - (set (make-local-variable 'eshell-last-output-block-begin) (point)) (let ((modules-list (copy-sequence eshell-modules-list))) (make-local-variable 'eshell-modules-list) @@ -611,7 +609,6 @@ If NO-HOOKS is non-nil, then `eshell-post-command-hook' won't be run." (setq eshell-last-input-start (point-marker) eshell-last-input-end (point-marker) eshell-last-output-start (point-marker) - eshell-last-output-block-begin (point) eshell-last-output-end (point-marker)) (eshell-begin-on-new-line) (unless no-hooks @@ -808,9 +805,7 @@ This is done after all necessary filtering has been done." (defun eshell-run-output-filters () "Run the `eshell-output-filter-functions' on the current output." (save-current-buffer - (run-hooks 'eshell-output-filter-functions)) - (setq eshell-last-output-block-begin - (marker-position eshell-last-output-end))) + (run-hooks 'eshell-output-filter-functions))) ;;; jww (1999-10-23): this needs testing (defun eshell-preinput-scroll-to-bottom () @@ -1031,7 +1026,7 @@ buffer's process if STRING contains a password prompt defined by This function could be in the list `eshell-output-filter-functions'." (when (eshell-interactive-process) (save-excursion - (goto-char eshell-last-output-block-begin) + (goto-char eshell-last-input-end) (beginning-of-line) (if (re-search-forward eshell-password-prompt-regexp eshell-last-output-end t) @@ -1044,7 +1039,7 @@ This function could be in the list `eshell-output-filter-functions'." "Act properly when certain control codes are seen." (save-excursion (let ((orig (point))) - (goto-char eshell-last-output-block-begin) + (goto-char eshell-last-input-end) (unless (eolp) (beginning-of-line)) (while (< (point) eshell-last-output-end)