]> code.delx.au - gnu-emacs-elpa/commitdiff
Add comments and strings to condition-case test.
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sat, 6 Jun 2015 22:00:45 +0000 (15:00 -0700)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sat, 6 Jun 2015 22:00:45 +0000 (15:00 -0700)
context-coloring.el
test/context-coloring-test.el
test/fixtures/condition-case.el

index de220142012d94fa6d0273b581279498506e86c1..afc05e457559ffd52e6f8911803d6569b1f05f85 100644 (file)
@@ -288,6 +288,14 @@ them along the way."
     (context-coloring-elisp-colorize-comments-and-strings-in-region
      start (point))))
 
+(defsubst context-coloring-elisp-forward-sexp ()
+  "Like `forward-sexp', but colorize comments and strings along
+the way."
+  (let ((start (point)))
+    (forward-sexp)
+    (context-coloring-elisp-colorize-comments-and-strings-in-region
+     start (point))))
+
 (defsubst context-coloring-get-syntax-code ()
   (syntax-class
    ;; Faster version of `syntax-after':
@@ -412,7 +420,7 @@ provide visually \"instant\" updates at 60 frames per second.")
 (defsubst context-coloring-elisp-parse-arg (callback)
   (let* ((arg-string (buffer-substring-no-properties
                       (point)
-                      (progn (forward-sexp)
+                      (progn (context-coloring-elisp-forward-sexp)
                              (point)))))
     (when (not (string-match-p
                 context-coloring-ignored-word-regexp
@@ -614,7 +622,7 @@ provide visually \"instant\" updates at 60 frames per second.")
       (cond
        ((= syntax-code context-coloring-OPEN-PARENTHESIS-CODE)
         (setq case-pos (point))
-        (forward-sexp)
+        (context-coloring-elisp-forward-sexp)
         (setq case-end (point))
         (goto-char case-pos)
         ;; Enter.
@@ -623,7 +631,7 @@ provide visually \"instant\" updates at 60 frames per second.")
         (setq syntax-code (context-coloring-get-syntax-code))
         (when (/= syntax-code context-coloring-CLOSE-PARENTHESIS-CODE)
           ;; Skip the condition name(s).
-          (forward-sexp)
+          (context-coloring-elisp-forward-sexp)
           ;; Color the remaining portion of the handler.
           (context-coloring-elisp-colorize-region
            (point)
@@ -632,7 +640,7 @@ provide visually \"instant\" updates at 60 frames per second.")
         (forward-char))
        (t
         ;; Ignore artifacts.
-        (forward-sexp)))
+        (context-coloring-elisp-forward-sexp)))
       (context-coloring-elisp-forward-sws))
     ;; Exit.
     (forward-char)
index 2cfd64aa2b3948b157b62fdc8bac0c740d310f4b..e6e6a594b856b7e0f37054956110e4ca4e6b633f 100644 (file)
@@ -1173,8 +1173,10 @@ ssssssssssss0"))
   1111111 111111 111 000011
 
 (111111111-1111-111111-11111 111
+    cc c
     (xxx () 222)
-  (11111 (xxx () 222)))")))
+  (11111 (xxx () 222))
+  sss)")))
 
 (defun context-coloring-test-insert-unread-space ()
   "Simulate the insertion of a space as if by a user."
index bdbca7e2aa6f4704d4244d479fb7c9b7b07157cb..151f5911ac40bc8a617f191013fe23267cdfc38d 100644 (file)
@@ -4,5 +4,7 @@
   ((debug error) err free))
 
 (condition-case-unless-debug nil
+    ;; c
     (let () nil)
-  (error (let () nil)))
+  (error (let () nil))
+  "s")