[slime-cvs] CVS slime/contrib

CVS User trittweiler trittweiler at common-lisp.net
Fri May 15 20:02:43 UTC 2009


Update of /project/slime/cvsroot/slime/contrib
In directory cl-net:/tmp/cvs-serv7959

Modified Files:
	ChangeLog slime-fontifying-fu.el 
Log Message:
	* slime-fontifying-fu.el (slime-search-suppressed-forms-internal):
	Use `slime-reader-conditionals-regexp'.
	(slime-search-directly-preceding-reader-conditional): Catch scan
	errors due to improper feature expressions.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2009/05/15 19:02:19	1.208
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2009/05/15 20:02:43	1.209
@@ -1,5 +1,12 @@
 2009-05-15  Tobias C. Rittweiler  <tcr at freebits.de>
 
+	* slime-fontifying-fu.el (slime-search-suppressed-forms-internal):
+	Use `slime-reader-conditionals-regexp'.
+	(slime-search-directly-preceding-reader-conditional): Catch scan
+	errors due to improper feature expressions.
+
+2009-05-15  Tobias C. Rittweiler  <tcr at freebits.de>
+
 	* slime-repl.el (with-canonicalized-slime-repl-buffer): XEmacs
 	chokes on symbol-names with an initial dot.
 
--- /project/slime/cvsroot/slime/contrib/slime-fontifying-fu.el	2009/05/15 18:37:10	1.2
+++ /project/slime/cvsroot/slime/contrib/slime-fontifying-fu.el	2009/05/15 20:02:43	1.3
@@ -30,7 +30,7 @@
   :group 'slime-mode-faces)
 
 (defun slime-search-suppressed-forms-internal (limit)
-  (when (re-search-forward "^\\([^;\n]*?[ \t(]\\)?#[-+]" limit t)
+  (when (search-forward-regexp slime-reader-conditionals-regexp limit t)
     (if (let ((state (slime-current-parser-state)))
           (or (nth 3 state)             ; inside string?
               (nth 4 state)))           ; inside comment?
@@ -92,26 +92,28 @@
   ;;; between the reader conditional and the point where we started is
   ;;; no other intervening sexp, and we check that the reader
   ;;; conditional is at the same nesting level.
-  (let ((orig-pt (point)))
-    (multiple-value-bind (reader-conditional-pt parser-state)
-        (save-excursion
-          (when-let (pt (search-backward-regexp slime-reader-conditionals-regexp
-                                                ;; We restrict the search to the
-                                                ;; beginning of the /previous/ defun.
-                                                (save-match-data
-                                                  (save-excursion
-                                                    (beginning-of-defun) (point)))
-                                                t))
-            (values pt (parse-partial-sexp (progn (goto-char (+ pt 2))
-                                                  (forward-sexp) ; skip feature expr.
-                                                  (point))
-                                           orig-pt))))
-      (let ((paren-depth  (nth 0 parser-state))
-            (last-sexp-pt (nth 2 parser-state)))
-        (if (and paren-depth (not (plusp paren-depth)) ; no opening parenthesis in between?
-                 (not last-sexp-pt))                   ; no complete sexp in between?
-            reader-conditional-pt
-            nil)))))
+  (condition-case nil
+      (let ((orig-pt (point)))
+        (multiple-value-bind (reader-conditional-pt parser-state)
+            (save-excursion
+              (when-let (pt (search-backward-regexp slime-reader-conditionals-regexp
+                                                    ;; We restrict the search to the
+                                                    ;; beginning of the /previous/ defun.
+                                                    (save-match-data
+                                                      (save-excursion
+                                                        (beginning-of-defun) (point)))
+                                                    t))
+                (values pt (parse-partial-sexp (progn (goto-char (+ pt 2))
+                                                      (forward-sexp) ; skip feature expr.
+                                                      (point))
+                                               orig-pt))))
+          (let ((paren-depth  (nth 0 parser-state))
+                (last-sexp-pt (nth 2 parser-state)))
+            (if (and paren-depth (not (plusp paren-depth)) ; no opening parenthesis in between?
+                     (not last-sexp-pt))                   ; no complete sexp in between?
+                reader-conditional-pt
+                nil))))
+    (scan-error nil)))                                     ; improper feature expression
 
 
 ;;; We'll push this onto `font-lock-extend-region-functions'. In past,





More information about the slime-cvs mailing list