From: Juanma Barranquero Date: Thu, 7 Jul 2005 01:51:48 +0000 (+0000) Subject: (hi-lock-find-patterns): Protect also against invalid values for the pattern X-Git-Tag: emacs-pretest-22.0.90~8333 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ed6773fa23b9c8e858cbe91642db7251dbe60947;p=emacs.git (hi-lock-find-patterns): Protect also against invalid values for the pattern lists which are `read'able but not `append'able (like symbols). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index df7a4b270ea..f1e29e1bdbd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-07-07 Juanma Barranquero + + * 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 * progmodes/flymake.el (flymake-float-time): Instead of diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index c649ed8d465..d7aec9112bc 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -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)))))))