emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in highlight-lines-matching-regexp?


From: martin rudalics
Subject: Re: Bug in highlight-lines-matching-regexp?
Date: Mon, 20 Apr 2009 17:53:28 +0200
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

> 1. Open a text file with any relevant contents.
> 2. M-x highlight-lines-matching-regexp and highlight something in the file.
> 3. M-x revert-buffer RET yes RET
> 4. Now the highlighting is gone, which I can accept, however...
> 5. M-x highlight-lines-matching-regexp RET RET
> 6. Nothing is highlighted this second time!
>
> Is this a bug or expected behavior?

It's unexpected behavior.  You can, after reverting, turn _off_
`hi-lock-mode' and enter your pattern then, but that's clumsy.

Either `hi-lock-mode' should add a function to `before-revert-hook'
which resets `hi-lock-interactive-patterns' or add a function to
`after-revert-hook' which either resets `hi-lock-interactive-patterns'
or adds the interactive patterns to `font-lock-keywords' so that all
patterns are preserved.  I'm not sure which behavior is preferable.

For non-font-locked buffers all hi-lock overlays should probably be
removed (and possibly regenerated) too.

martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]