Index: buffer.lisp
===================================================================
RCS file: /project/climacs/cvsroot/climacs/buffer.lisp,v
retrieving revision 1.33
diff -u -r1.33 buffer.lisp
--- buffer.lisp	30 Apr 2006 15:20:46 -0000	1.33
+++ buffer.lisp	4 May 2006 11:11:39 -0000
@@ -46,7 +46,10 @@
   ((contents :initform (make-instance 'standard-cursorchain))
    (low-mark :reader low-mark)
    (high-mark :reader high-mark)
-   (modified :initform nil :reader modified-p))
+   (low-display-mark :reader low-display-mark)
+   (high-display-mark :reader high-display-mark)
+   (modified :initform nil :reader modified-p)
+   (display-modified :initform nil :reader display-modified-p))
   (:documentation "The Climacs standard buffer [an instantable subclass of buffer]."))
 
 (defgeneric buffer (mark)
@@ -189,9 +192,11 @@
 (defmethod initialize-instance :after ((buffer standard-buffer) &rest args)
   "Create the low-mark and high-mark"
   (declare (ignore args))
-  (with-slots (low-mark high-mark) buffer
+  (with-slots (low-mark low-display-mark high-mark high-display-mark) buffer
      (setf low-mark (make-instance 'standard-left-sticky-mark :buffer buffer))
-     (setf high-mark (make-instance 'standard-right-sticky-mark :buffer buffer))))
+     (setf low-display-mark (make-instance 'standard-left-sticky-mark :buffer buffer))
+     (setf high-mark (make-instance 'standard-right-sticky-mark :buffer buffer))
+     (setf high-display-mark (make-instance 'standard-right-sticky-mark :buffer buffer))))
 
 (defgeneric clone-mark (mark &optional stick-to)
   (:documentation "Clone a mark.  By default (when stick-to is NIL)
@@ -622,32 +627,52 @@
   (declare (ignore object))
   (setf (offset (low-mark buffer))
         (min (offset (low-mark buffer)) offset))
+  (setf (offset (low-display-mark buffer))
+        (min (offset (low-display-mark buffer)) offset))
   (setf (offset (high-mark buffer))
         (max (offset (high-mark buffer)) offset))
-  (setf (slot-value buffer 'modified) t))
+  (setf (offset (high-display-mark buffer))
+        (max (offset (high-display-mark buffer)) offset))
+  (setf (slot-value buffer 'modified) t)
+  (setf (slot-value buffer 'display-modified) t))
 
 (defmethod insert-buffer-object :before ((buffer standard-buffer) offset object)
   (declare (ignore object))
   (setf (offset (low-mark buffer))
 	(min (offset (low-mark buffer)) offset))
+  (setf (offset (low-display-mark buffer))
+        (min (offset (low-display-mark buffer)) offset))
   (setf (offset (high-mark buffer))
 	(max (offset (high-mark buffer)) offset))
-  (setf (slot-value buffer 'modified) t))
+  (setf (offset (high-display-mark buffer))
+        (max (offset (high-display-mark buffer)) offset))
+  (setf (slot-value buffer 'modified) t)
+  (setf (slot-value buffer 'display-modified) t))
 
 (defmethod insert-buffer-sequence :before ((buffer standard-buffer) offset sequence)
   (declare (ignore sequence))
   (setf (offset (low-mark buffer))
 	(min (offset (low-mark buffer)) offset))
+  (setf (offset (low-display-mark buffer))
+        (min (offset (low-display-mark buffer)) offset))
   (setf (offset (high-mark buffer))
 	(max (offset (high-mark buffer)) offset))
-  (setf (slot-value buffer 'modified) t))
+  (setf (offset (high-display-mark buffer))
+        (max (offset (high-display-mark buffer)) offset))
+  (setf (slot-value buffer 'modified) t)
+  (setf (slot-value buffer 'display-modified) t))
 
 (defmethod delete-buffer-range :before ((buffer standard-buffer) offset n)
   (setf (offset (low-mark buffer))
 	(min (offset (low-mark buffer)) offset))
+  (setf (offset (low-display-mark buffer))
+        (min (offset (low-display-mark buffer)) offset))
   (setf (offset (high-mark buffer))
 	(max (offset (high-mark buffer)) (+ offset n)))
-  (setf (slot-value buffer 'modified) t))
+  (setf (offset (high-display-mark buffer))
+        (max (offset (high-display-mark buffer)) (+ offset n)))
+  (setf (slot-value buffer 'modified) t)
+  (setf (slot-value buffer 'display-modified) t))
 
 (defgeneric clear-modify (buffer))
 
@@ -655,3 +680,11 @@
   (beginning-of-buffer (high-mark buffer))
   (end-of-buffer (low-mark buffer))
   (setf (slot-value buffer 'modified) nil))
+
+(defgeneric clear-modify-for-display (buffer))
+
+(defmethod clear-modify-for-display ((buffer standard-buffer))
+  (beginning-of-buffer (high-display-mark buffer))
+  (end-of-buffer (low-display-mark buffer))
+  (setf (slot-value buffer 'display-modified) nil))
+
Index: delegating-buffer.lisp
===================================================================
RCS file: /project/climacs/cvsroot/climacs/delegating-buffer.lisp,v
retrieving revision 1.5
diff -u -r1.5 delegating-buffer.lisp
--- delegating-buffer.lisp	25 Aug 2005 07:48:13 -0000	1.5
+++ delegating-buffer.lisp	4 May 2006 11:11:39 -0000
@@ -32,15 +32,27 @@
 (defmethod low-mark ((buffer delegating-buffer))
   (low-mark (implementation buffer)))
 
+(defmethod low-display-mark ((buffer delegating-buffer))
+  (low-display-mark (implementation buffer)))
+
 (defmethod high-mark ((buffer delegating-buffer))
   (high-mark (implementation buffer)))
 
+(defmethod high-display-mark ((buffer delegating-buffer))
+  (high-display-mark (implementation buffer)))
+
 (defmethod modified-p ((buffer delegating-buffer))
   (modified-p (implementation buffer)))
 
+(defmethod display-modified-p ((buffer delegating-buffer))
+  (display-modified-p (implementation buffer)))
+
 (defmethod clear-modify ((buffer delegating-buffer))
   (clear-modify (implementation buffer)))
 
+(defmethod clear-modify-for-display ((buffer delegating-buffer))
+  (clear-modify (implementation buffer)))
+
 (defmethod size ((buffer delegating-buffer))
   (size (implementation buffer)))
 
Index: gui.lisp
===================================================================
RCS file: /project/climacs/cvsroot/climacs/gui.lisp,v
retrieving revision 1.211
diff -u -r1.211 gui.lisp
--- gui.lisp	2 May 2006 18:02:15 -0000	1.211
+++ gui.lisp	4 May 2006 11:11:39 -0000
@@ -270,6 +305,12 @@
 
 (defvar *kill-ring* (make-instance 'kill-ring :max-size 7))
 
+(defmethod redisplay-frame-panes :around ((frame climacs) &key &allow-other-keys)
+  (call-next-method)
+  (loop for buffer in (buffers frame)
+        do (when (climacs-buffer::display-modified-p buffer)
+             (climacs-buffer::clear-modify-for-display buffer))))
+
 (defmethod execute-frame-command :around ((frame climacs) command)
   (let ((current-window (car (windows frame))))
     (handler-case
Index: pane.lisp
===================================================================
RCS file: /project/climacs/cvsroot/climacs/pane.lisp,v
retrieving revision 1.37
diff -u -r1.37 pane.lisp
--- pane.lisp	23 Apr 2006 19:37:58 -0000	1.37
+++ pane.lisp	4 May 2006 11:11:39 -0000
@@ -472,8 +472,8 @@
 ;;; the number of lines in the pane.
 (defun adjust-cache (pane)
   (let* ((buffer (buffer pane))
-	 (high-mark (high-mark buffer))
-	 (low-mark (low-mark buffer))
+	 (high-mark (climacs-buffer::high-display-mark buffer))
+	 (low-mark (climacs-buffer::low-display-mark buffer))
 	 (nb-lines-in-pane (nb-lines-in-pane pane)))
     (with-slots (top bot cache) pane
        (beginning-of-line top)
