# HG changeset patch # User Stefan Monnier # Date 1012591906 0 # Node ID 4037178317df2f9850627b287235f7ee793cf2ee # Parent 1be1134989cd7544ff2f24a775d0eee36e17157a *** empty log message *** diff -r 1be1134989cd -r 4037178317df lisp/ChangeLog --- a/lisp/ChangeLog Fri Feb 01 18:31:48 2002 +0000 +++ b/lisp/ChangeLog Fri Feb 01 19:31:46 2002 +0000 @@ -1,3 +1,7 @@ +2002-02-01 Stefan Monnier + + * hi-lock.el (hi-lock-find-patterns): Save restriction. + 2002-02-01 Eli Zaretskii * 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. diff -r 1be1134989cd -r 4037178317df lisp/hi-lock.el --- a/lisp/hi-lock.el Fri Feb 01 18:31:48 2002 +0000 +++ b/lisp/hi-lock.el Fri Feb 01 19:31:46 2002 +0000 @@ -537,21 +537,22 @@ (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)))))))