diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2002-02-01 19:31:46 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2002-02-01 19:31:46 +0000 |
commit | 62cec9fefe0b0b2e51736aac876011acc967f32c (patch) | |
tree | 08285943d239513db04d9f949dff993fcbb4ed1f /lisp/hi-lock.el | |
parent | 662c9e53fe1e14a18db748945c68b4903e3ffdc3 (diff) | |
download | emacs-62cec9fefe0b0b2e51736aac876011acc967f32c.tar.gz |
*** empty log message ***
Diffstat (limited to 'lisp/hi-lock.el')
-rw-r--r-- | lisp/hi-lock.el | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 6c7fb5d0c58..8d40852cf68 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -537,21 +537,22 @@ Optional argument END is maximum excursion." (let ((all-patterns nil) (target-regexp (concat "\\<" hi-lock-file-patterns-prefix ":"))) (save-excursion - (widen) - (goto-char (point-min)) - (re-search-forward target-regexp - (+ (point) hi-lock-file-patterns-range) t) - (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)))))) + (save-restriction + (widen) + (goto-char (point-min)) + (re-search-forward target-regexp + (+ (point) hi-lock-file-patterns-range) t) + (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))))))) (when hi-lock-mode (hi-lock-set-file-patterns all-patterns)) (if (interactive-p) (message (format "Hi-lock added %d patterns." (length all-patterns))))))) |