]> git.eshelyaron.com Git - emacs.git/commitdiff
*** empty log message ***
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 1 Feb 2002 19:31:46 +0000 (19:31 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 1 Feb 2002 19:31:46 +0000 (19:31 +0000)
lisp/ChangeLog
lisp/hi-lock.el

index dc287e09232b48960c42998762559d940ccf434b..099f5334cac1bc90b9425be42bddc5b7cdc39cc0 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-01  Stefan Monnier  <monnier@cs.yale.edu>
+
+       * hi-lock.el (hi-lock-find-patterns): Save restriction.
+
 2002-02-01  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * calendar/time-date.el: Moved from lisp/gnus.
@@ -37,7 +41,7 @@
        (compile-always): Renamed from compile-files.
        (compile-after-backup): Renamed from compile.
        (bootstrap): Depend on compile-always, not compile-files.
-       
+
        * emulation/pc-select.el (pc-select-save-and-set-mode):
        Properly use MODE-VAR.
 
index 6c7fb5d0c5854b42c5c1273c1648556d5ec97daa..8d40852cf6889d8291143f30dca4f4c7ca1ad21b 100644 (file)
@@ -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)))))))