diff options
author | Juanma Barranquero <[email protected]> | 2005-07-07 01:51:48 +0000 |
---|---|---|
committer | Juanma Barranquero <[email protected]> | 2005-07-07 01:51:48 +0000 |
commit | ed6773fa23b9c8e858cbe91642db7251dbe60947 (patch) | |
tree | 3d996f0d233613bb0a1ce6017b91e162dc4828a5 /lisp/hi-lock.el | |
parent | dc2204be4f5aeee34eba13ea13f36d788cf8b343 (diff) |
(hi-lock-find-patterns): Protect also against invalid values for the pattern
lists which are `read'able but not `append'able (like symbols).
Diffstat (limited to 'lisp/hi-lock.el')
-rw-r--r-- | lisp/hi-lock.el | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index c649ed8d46..d7aec9112b 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))))))) |