aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/hi-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2002-02-01 19:31:46 +0000
committerStefan Monnier <[email protected]>2002-02-01 19:31:46 +0000
commit62cec9fefe0b0b2e51736aac876011acc967f32c (patch)
tree08285943d239513db04d9f949dff993fcbb4ed1f /lisp/hi-lock.el
parent662c9e53fe1e14a18db748945c68b4903e3ffdc3 (diff)
*** empty log message ***
Diffstat (limited to 'lisp/hi-lock.el')
-rw-r--r--lisp/hi-lock.el31
1 files changed, 16 insertions, 15 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 6c7fb5d0c5..8d40852cf6 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)))))))