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

Robert Strandh rstrandh at common-lisp.net
Sat Dec 25 14:50:00 UTC 2004


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

Modified Files:
	gui.lisp packages.lisp syntax.lisp 
Log Message:
Simplified the syntax protocol according to suggestions from Teemu Kalvas.

Date: Sat Dec 25 15:49:56 2004
Author: rstrandh

Index: climacs/gui.lisp
diff -u climacs/gui.lisp:1.15 climacs/gui.lisp:1.16
--- climacs/gui.lisp:1.15	Sat Dec 25 14:36:20 2004
+++ climacs/gui.lisp	Sat Dec 25 15:49:54 2004
@@ -40,7 +40,7 @@
      (when (null point)
        (setf point (make-instance 'standard-right-sticky-mark
 		      :buffer buffer)))
-     (setf syntax (make-instance 'texinfo-syntax :buffer buffer :pane pane))))
+     (setf syntax (make-instance 'texinfo-syntax :pane pane))))
 
 (define-application-frame climacs ()
   ((win :reader win))
@@ -65,7 +65,7 @@
 (defun display-win (frame pane)
   "The display function used by the climacs application frame."
   (declare (ignore frame))
-  (redisplay-with-syntax pane (syntax pane)))
+  (redisplay-pane pane))
 
 (defun find-gestures (gestures start-table)
   (loop with table = (find-command-table start-table)
@@ -246,7 +246,7 @@
     (with-slots (buffer point syntax) (win *application-frame*)
        (setf buffer (make-instance 'climacs-buffer)
 	     point (make-instance 'standard-right-sticky-mark :buffer buffer)
-	     syntax (make-instance 'texinfo-syntax :buffer buffer :pane (win *application-frame*))
+	     syntax (make-instance 'texinfo-syntax :pane (win *application-frame*))
 	     (filename buffer) filename)
        (with-open-file (stream filename :direction :input)
 	 (input-from-stream stream buffer 0))


Index: climacs/packages.lisp
diff -u climacs/packages.lisp:1.9 climacs/packages.lisp:1.10
--- climacs/packages.lisp:1.9	Sat Dec 25 13:29:24 2004
+++ climacs/packages.lisp	Sat Dec 25 15:49:54 2004
@@ -56,7 +56,7 @@
 (defpackage :climacs-syntax
   (:use :clim-lisp :clim :climacs-buffer :climacs-base)
   (:export #:syntax #:basic-syntax #:texinfo-syntax
-	   #:redisplay-with-syntax #:full-redisplay
+	   #:redisplay-pane #:redisplay-with-syntax #:full-redisplay
 	   #:url))
 
 (defpackage :climacs-gui


Index: climacs/syntax.lisp
diff -u climacs/syntax.lisp:1.3 climacs/syntax.lisp:1.4
--- climacs/syntax.lisp:1.3	Sat Dec 25 13:29:24 2004
+++ climacs/syntax.lisp	Sat Dec 25 15:49:54 2004
@@ -28,6 +28,10 @@
 
 (defgeneric redisplay-with-syntax (pane syntax))
 
+(defun redisplay-pane (pane)
+  "redisplay the pane according to its syntax"
+  (redisplay-with-syntax pane (syntax pane)))
+
 (defgeneric full-redisplay (pane syntax))
 
 (defclass basic-syntax (syntax)
@@ -40,16 +44,17 @@
    (space-width :initform nil)
    (tab-width :initform nil)))
 
-(defmethod initialize-instance :after ((syntax basic-syntax) &rest args &key buffer pane)
+(defmethod initialize-instance :after ((syntax basic-syntax) &rest args &key pane)
   (declare (ignore args))
-  (with-slots (top bot scan space-width tab-width) syntax
-     (setf top (make-instance 'standard-left-sticky-mark :buffer buffer)
-	   bot (make-instance 'standard-right-sticky-mark :buffer buffer)
-	   scan (make-instance 'standard-left-sticky-mark :buffer buffer))
-     (let* ((medium (sheet-medium pane))
-	    (style (medium-text-style medium)))
-       (setf space-width (text-style-width style medium)
-	     tab-width (* 8 space-width)))))
+  (let ((buffer (buffer pane)))
+    (with-slots (top bot scan space-width tab-width) syntax
+       (setf top (make-instance 'standard-left-sticky-mark :buffer buffer)
+	     bot (make-instance 'standard-right-sticky-mark :buffer buffer)
+	     scan (make-instance 'standard-left-sticky-mark :buffer buffer))
+       (let* ((medium (sheet-medium pane))
+	      (style (medium-text-style medium)))
+	 (setf space-width (text-style-width style medium)
+	       tab-width (* 8 space-width))))))
 
 (define-presentation-type url ()
   :inherit-from 'string)




More information about the Climacs-cvs mailing list