[climacs-cvs] CVS update: climacs/gui.lisp climacs/syntax.lisp

Robert Strandh rstrandh at common-lisp.net
Mon Jan 10 05:31:24 UTC 2005


Update of /project/climacs/cvsroot/climacs
In directory common-lisp.net:/tmp/cvs-serv17277

Modified Files:
	gui.lisp syntax.lisp 
Log Message:
Removed the line number from the status line until we have 
the better buffer implementation.  Right now, this function
requires scanning the entire buffer and counting newlines.

Fixed adjust-cache so that it doesn't do anything when there has been no
modification of the buffer since previous redisplay. 

Date: Mon Jan 10 06:31:20 2005
Author: rstrandh

Index: climacs/gui.lisp
diff -u climacs/gui.lisp:1.60 climacs/gui.lisp:1.61
--- climacs/gui.lisp:1.60	Sun Jan  9 15:08:27 2005
+++ climacs/gui.lisp	Mon Jan 10 06:31:16 2005
@@ -115,7 +115,7 @@
 			    (name (syntax win))
 			    (if *overwrite-mode*
 				"Ovwrt"
-				(format nil "L~d" (line-number (point win)))))))
+				""))))
     (princ name-info pane)))
 
 (defun display-win (frame pane)


Index: climacs/syntax.lisp
diff -u climacs/syntax.lisp:1.20 climacs/syntax.lisp:1.21
--- climacs/syntax.lisp:1.20	Sun Jan  9 12:54:50 2005
+++ climacs/syntax.lisp	Mon Jan 10 06:31:17 2005
@@ -233,23 +233,24 @@
 	       (and (mark< low-mark top)
 		    (>= (number-of-lines-in-region top high-mark) (nb-elements cache))))
 	   (reposition-window pane syntax)
-	   (let* ((n1 (number-of-lines-in-region top low-mark))
-		  (n2 (1+ (number-of-lines-in-region low-mark high-mark)))
-		  (n3 (number-of-lines-in-region high-mark bot))
-		  (diff (- (+ n1 n2 n3) (nb-elements cache))))
-	     (cond ((>= (+ n1 n2 n3) (+ (nb-elements cache) 20))
-		    (setf (offset bot) (offset top))
-		    (end-of-line bot)
-		    (loop for i from n1 below (nb-elements cache)
-			  do (setf (element* cache i) nil)))
-		   ((>= diff 0)
-		    (loop repeat diff do (insert* cache n1 nil))
-		    (loop for i from (+ n1 diff) below (+ n1 n2)
-			  do (setf (element* cache i) nil)))
-		   (t
-		    (loop repeat (- diff) do (delete* cache n1))
-		    (loop for i from n1 below (+ n1 n2)
-			  do (setf (element* cache i) nil))))))))
+	   (when (mark>= high-mark low-mark)
+	     (let* ((n1 (number-of-lines-in-region top low-mark))
+		    (n2 (1+ (number-of-lines-in-region low-mark high-mark)))
+		    (n3 (number-of-lines-in-region high-mark bot))
+		    (diff (- (+ n1 n2 n3) (nb-elements cache))))
+	       (cond ((>= (+ n1 n2 n3) (+ (nb-elements cache) 20))
+		      (setf (offset bot) (offset top))
+		      (end-of-line bot)
+		      (loop for i from n1 below (nb-elements cache)
+			    do (setf (element* cache i) nil)))
+		     ((>= diff 0)
+		      (loop repeat diff do (insert* cache n1 nil))
+		      (loop for i from (+ n1 diff) below (+ n1 n2)
+			    do (setf (element* cache i) nil)))
+		     (t
+		      (loop repeat (- diff) do (delete* cache n1))
+		      (loop for i from n1 below (+ n1 n2)
+			    do (setf (element* cache i) nil)))))))))
   (adjust-cache-size-and-bot pane syntax))
 
 (defun page-down (pane syntax)




More information about the Climacs-cvs mailing list