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

Brian Mastenbrook bmastenbrook at common-lisp.net
Wed Jun 22 18:36:00 UTC 2005


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

Modified Files:
	gui.lisp pane.lisp 
Log Message:
Add an :after method on (setf syntax) for buffers; this updates the top and bottom marks correctly

Date: Wed Jun 22 20:35:59 2005
Author: bmastenbrook

Index: climacs/gui.lisp
diff -u climacs/gui.lisp:1.146 climacs/gui.lisp:1.147
--- climacs/gui.lisp:1.146	Sat Jun 18 04:01:56 2005
+++ climacs/gui.lisp	Wed Jun 22 20:35:59 2005
@@ -904,13 +904,6 @@
     (psetf (offset (mark pane)) (offset (point pane))
 	   (offset (point pane)) (offset (mark pane)))))
 
-(defun set-syntax (syntax)
-  (let* ((pane (current-window))
-	 (buffer (buffer pane)))
-    (setf (syntax buffer) syntax)
-    (setf (offset (low-mark buffer)) 0
-	  (offset (high-mark buffer)) (size buffer))))
-
 (define-named-command com-set-syntax ()
   (let* ((pane (current-window))
 	 (buffer (buffer pane)))
@@ -919,9 +912,7 @@
 			     (progn (beep)
 				    (display-message "No such syntax")
 				    (return-from com-set-syntax nil)))
-	     :buffer (buffer (point pane))))
-    (setf (offset (low-mark buffer)) 0
-	  (offset (high-mark buffer)) (size buffer))))
+	     :buffer (buffer (point pane))))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; 


Index: climacs/pane.lisp
diff -u climacs/pane.lisp:1.26 climacs/pane.lisp:1.27
--- climacs/pane.lisp:1.26	Mon May  9 16:47:45 2005
+++ climacs/pane.lisp	Wed Jun 22 20:35:59 2005
@@ -210,6 +210,10 @@
 		   'basic-syntax :buffer (implementation buffer))
 	   point (clone-mark (low-mark buffer) :right))))
 
+(defmethod (setf syntax) :after (syntax (buffer climacs-buffer))
+  (setf (offset (low-mark buffer)) 0
+        (offset (high-mark buffer)) (size buffer)))
+
 (defclass climacs-pane (application-pane)
   ((buffer :initform (make-instance 'climacs-buffer) :accessor buffer)
    (point :initform nil :initarg :point :accessor point)
@@ -250,7 +254,7 @@
   (with-slots (buffer top bot scan) pane
      (setf top (clone-mark (low-mark buffer) :left)
 	   bot (clone-mark (high-mark buffer) :right)))
-  (setf (stream-default-view pane) (make-instance 'climacs-textual-view))
+  (setf (stream-default-view pane) (make-instance 'climacs-textual-view)) 
   (with-slots (space-width tab-width) (stream-default-view pane)
      (let* ((medium (sheet-medium pane))
 	    (style (medium-text-style medium)))




More information about the Climacs-cvs mailing list