changeset 82252:165a8aa41e32

(term-erase-in-display): Fix case when point is not at the beginning of the line.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 03 Aug 2007 10:49:56 +0000
parents b8c796068320
children e100ad942371
files lisp/ChangeLog lisp/term.el
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Aug 03 05:49:59 2007 +0000
+++ b/lisp/ChangeLog	Fri Aug 03 10:49:56 2007 +0000
@@ -1,3 +1,8 @@
+2007-08-03  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term.el (term-erase-in-display): Fix case when point is not at
+	the beginning of the line.
+
 2007-08-03  Jay Belanger  <jay.p.belanger@gmail.com>
 
 	* calc/calc-ext.el (math-get-value,math-get-sdev)
--- a/lisp/term.el	Fri Aug 03 05:49:59 2007 +0000
+++ b/lisp/term.el	Fri Aug 03 10:49:56 2007 +0000
@@ -3715,12 +3715,12 @@
 (defun term-erase-in-display (kind)
   "Erases (that is blanks out) part of the window.
 If KIND is 0, erase from (point) to (point-max);
-if KIND is 1, erase from home to point; else erase from home to point-max.
-Should only be called when point is at the start of a screen line."
+if KIND is 1, erase from home to point; else erase from home to point-max."
   (term-handle-deferred-scroll)
   (cond ((eq term-terminal-parameter 0)
-	 (delete-region (point) (point-max))
-	 (term-unwrap-line))
+	 (let ((need-unwrap (bolp)))
+	   (delete-region (point) (point-max))
+	   (when need-unwrap (term-unwrap-line))))
 	((let ((row (term-current-row))
 	      (col (term-horizontal-column))
 	      (start-region term-home-marker)