]> git.eshelyaron.com Git - emacs.git/commitdiff
(hi-lock-find-patterns): Protect also against invalid values for the pattern
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 7 Jul 2005 01:51:48 +0000 (01:51 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 7 Jul 2005 01:51:48 +0000 (01:51 +0000)
lists which are `read'able but not `append'able (like symbols).

lisp/ChangeLog
lisp/hi-lock.el

index df7a4b270eadd4e435705d36a6b45a99a07fb8d4..f1e29e1bdbd3432794cc55e40ba1f9a27fba6ef0 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-07  Juanma Barranquero  <lekktu@gmail.com>
+
+       * hi-lock.el (hi-lock-find-patterns): Protect also against invalid
+       values for the pattern lists which are `read'able but not
+       `append'able (like symbols).
+
 2005-07-06  Richard M. Stallman  <rms@gnu.org>
 
        * progmodes/flymake.el (flymake-float-time): Instead of
index c649ed8d465a65e8ee618e5bbddbfbadbd9874db..d7aec9112bcb6651f590e87c652a334301d17622 100644 (file)
@@ -557,14 +557,10 @@ Optional argument END is maximum excursion."
          (beginning-of-line)
          (while (and (re-search-forward target-regexp (+ (point) 100) t)
                      (not (looking-at "\\s-*end")))
-           (let ((patterns
-                  (condition-case nil
-                      (read (current-buffer))
-                    (error  (message
-                             (format "Could not read expression at %d"
-                                     (hi-lock-current-line))) nil))))
-             (if patterns
-                 (setq all-patterns (append patterns all-patterns)))))))
+            (condition-case nil
+                (setq all-patterns (append (read (current-buffer)) all-patterns))
+              (error (message "Invalid pattern list expression at %d"
+                              (hi-lock-current-line)))))))
       (when hi-lock-mode (hi-lock-set-file-patterns all-patterns))
       (if (interactive-p)
         (message (format "Hi-lock added %d patterns." (length all-patterns)))))))