[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: auto-compression-mode, tar-mode and hi-lock-mode
From: |
Stefan Monnier |
Subject: |
Re: auto-compression-mode, tar-mode and hi-lock-mode |
Date: |
06 Dec 2001 09:52:44 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50 |
>>>>> "Klaus" == Klaus Zeitler <kzeitler@lucent.com> writes:
> 1. start emacs with -q --no-site-file
> 2. in scratch buffer execute (auto-compression-mode)
> 3. in scratch buffer execute (hi-lock-mode)
> 4. M-x find-file <filename>.tar.gz
> At first glance the tar file looks garbled, but I think that for some reason
> only narrowing is disabled. My guess is that hi-lock-mode interfers with
> narrowing.
Good spotting. I don't think the auto-compression-mode call was
needed (except that you probably don't have too many uncompressed
.tar files I guess).
The patch below should fix it,
Stefan
--- hi-lock.el.~1.15.~ Mon Sep 3 19:31:47 2001
+++ hi-lock.el Thu Dec 6 09:51:34 2001
@@ -537,6 +537,7 @@
(let ((all-patterns nil)
(target-regexp (concat "\\<" hi-lock-file-patterns-prefix ":")))
(save-excursion
+ (save-restriction
(widen)
(goto-char (point-min))
(re-search-forward target-regexp
@@ -551,7 +552,7 @@
(format "Could not read expression at %d"
(hi-lock-current-line))) nil))))
(if patterns
- (setq all-patterns (append patterns all-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)))))))