[mcclim-cvs] CVS mcclim/Drei

thenriksen thenriksen at common-lisp.net
Tue Jan 22 23:00:09 UTC 2008


Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv7026/Drei

Modified Files:
	lisp-syntax.lisp 
Log Message:
Only highlight parentheses when the view is active.


--- /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax.lisp	2008/01/20 19:45:24	1.70
+++ /project/mcclim/cvsroot/mcclim/Drei/lisp-syntax.lisp	2008/01/22 23:00:04	1.71
@@ -1832,6 +1832,17 @@
       (progn (cache-symbol-info syntax symbol-form)
              (global-boundp symbol-form))))
 
+(defun parenthesis-highlighter (view form)
+  "Return the drawing style with which the parenthesis lexeme
+`form' should be highlighted."
+  (if (and (typep view 'point-mark-view)
+           (active view)
+           (or (mark= (point view) (start-offset (parent form)))
+               (mark= (point view) (end-offset (parent form))))
+           (form-complete-p (parent form)))
+      +bold-face-drawing-options+
+      +default-drawing-options+))
+
 (define-syntax-highlighting-rules emacs-style-highlighting
   (error-lexeme (*error-drawing-options*))
   (string-form (*string-drawing-options*))
@@ -1845,13 +1856,7 @@
                                             ((symbol-form-is-boundp (syntax view) form)
                                              *special-variable-drawing-options*)
                                             (t +default-drawing-options+)))))
-  (parenthesis-lexeme (:function #'(lambda (view form)
-                                     (if (and (typep view 'point-mark-view)
-                                              (or (mark= (point view) (start-offset (parent form)))
-                                                  (mark= (point view) (end-offset (parent form))))
-                                              (form-complete-p (parent form)))
-                                         +bold-face-drawing-options+
-                                         +default-drawing-options+)))))
+  (parenthesis-lexeme (:function #'parenthesis-highlighter)))
 
 (define-syntax-highlighting-rules retro-highlighting
   (error-symbol (*error-drawing-options*))
@@ -1863,13 +1868,7 @@
                                              +bold-face-drawing-options+)
                                             (t +default-drawing-options+)))))
   ;; XXX: Ugh, copied from above.
-  (parenthesis-lexeme (:function #'(lambda (view form)
-                                     (if (and (typep view 'point-mark-view)
-                                              (or (mark= (point view) (start-offset (parent form)))
-                                                  (mark= (point view) (end-offset (parent form))))
-                                              (form-complete-p (parent form)))
-                                         +bold-face-drawing-options+
-                                         +default-drawing-options+)))))
+  (parenthesis-lexeme (:function #'parenthesis-highlighter)))
 
 (defparameter *syntax-highlighting-rules* 'emacs-style-highlighting
   "The syntax highlighting rules used for highlighting Lisp




More information about the Mcclim-cvs mailing list