537 |
(let ((all-patterns nil) |
(let ((all-patterns nil) |
538 |
(target-regexp (concat "\\<" hi-lock-file-patterns-prefix ":"))) |
(target-regexp (concat "\\<" hi-lock-file-patterns-prefix ":"))) |
539 |
(save-excursion |
(save-excursion |
540 |
(widen) |
(save-restriction |
541 |
(goto-char (point-min)) |
(widen) |
542 |
(re-search-forward target-regexp |
(goto-char (point-min)) |
543 |
(+ (point) hi-lock-file-patterns-range) t) |
(re-search-forward target-regexp |
544 |
(beginning-of-line) |
(+ (point) hi-lock-file-patterns-range) t) |
545 |
(while (and (re-search-forward target-regexp (+ (point) 100) t) |
(beginning-of-line) |
546 |
(not (looking-at "\\s-*end"))) |
(while (and (re-search-forward target-regexp (+ (point) 100) t) |
547 |
(let ((patterns |
(not (looking-at "\\s-*end"))) |
548 |
(condition-case nil |
(let ((patterns |
549 |
(read (current-buffer)) |
(condition-case nil |
550 |
(error (message |
(read (current-buffer)) |
551 |
(format "Could not read expression at %d" |
(error (message |
552 |
(hi-lock-current-line))) nil)))) |
(format "Could not read expression at %d" |
553 |
(if patterns |
(hi-lock-current-line))) nil)))) |
554 |
(setq all-patterns (append patterns all-patterns)))))) |
(if patterns |
555 |
|
(setq all-patterns (append patterns all-patterns))))))) |
556 |
(when hi-lock-mode (hi-lock-set-file-patterns all-patterns)) |
(when hi-lock-mode (hi-lock-set-file-patterns all-patterns)) |
557 |
(if (interactive-p) |
(if (interactive-p) |
558 |
(message (format "Hi-lock added %d patterns." (length all-patterns))))))) |
(message (format "Hi-lock added %d patterns." (length all-patterns))))))) |