unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bug in highlight-lines-matching-regexp?
@ 2009-04-20 14:25 Deniz Dogan
  2009-04-20 15:02 ` Tassilo Horn
  2009-04-20 15:53 ` martin rudalics
  0 siblings, 2 replies; 8+ messages in thread
From: Deniz Dogan @ 2009-04-20 14:25 UTC (permalink / raw)
  To: emacs-devel

Hi

I recently found some strange behavior in the highlighting
functionality provided by highlight-lines-matching-regexp. I'm not
sure whether this is a bug or not, which is why I'm asking.

Reproduction:
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?

Thanks,
Deniz Dogan




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug in highlight-lines-matching-regexp?
  2009-04-20 14:25 Bug in highlight-lines-matching-regexp? Deniz Dogan
@ 2009-04-20 15:02 ` Tassilo Horn
  2009-04-20 15:09   ` Deniz Dogan
  2009-04-20 15:53 ` martin rudalics
  1 sibling, 1 reply; 8+ messages in thread
From: Tassilo Horn @ 2009-04-20 15:02 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: emacs-devel

Deniz Dogan <deniz.a.m.dogan@gmail.com> writes:

Hi Deniz,

> I recently found some strange behavior in the highlighting
> functionality provided by highlight-lines-matching-regexp. I'm not
> sure whether this is a bug or not, which is why I'm asking.
>
> Reproduction:
> 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?

I've just tried it, and it works for me as it should when reusing the
previous regexp (which is the default) in step 5.

Did you try with "emacs -Q" to be sure that no local customization
causes the breakage?

Bye,
Tassilo




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug in highlight-lines-matching-regexp?
  2009-04-20 15:02 ` Tassilo Horn
@ 2009-04-20 15:09   ` Deniz Dogan
  2009-04-20 15:10     ` Deniz Dogan
  0 siblings, 1 reply; 8+ messages in thread
From: Deniz Dogan @ 2009-04-20 15:09 UTC (permalink / raw)
  To: Deniz Dogan, emacs-devel

2009/4/20 Tassilo Horn <tassilo@member.fsf.org>:
> Deniz Dogan <deniz.a.m.dogan@gmail.com> writes:
>
> Hi Deniz,
>
>> I recently found some strange behavior in the highlighting
>> functionality provided by highlight-lines-matching-regexp. I'm not
>> sure whether this is a bug or not, which is why I'm asking.
>>
>> Reproduction:
>> 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?
>
> I've just tried it, and it works for me as it should when reusing the
> previous regexp (which is the default) in step 5.
>
> Did you try with "emacs -Q" to be sure that no local customization
> causes the breakage?
>
> Bye,
> Tassilo

Yes, I tried this with emacs -Q and I still experience the same
behaviour. FWIW, here's the output from view-lossage:

M-x h i g h l <tab> l i n <tab> <return> S T R O K E <return> <return>
M-x r e v e r t - b u f <tab> <return> y e s <return> M-x <up> <up>
<return> <return> <return>

I should also mention that I didn't modify the file before reverting
the buffer, so the contents were exactly the same.

--
Deniz Dogan




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug in highlight-lines-matching-regexp?
  2009-04-20 15:09   ` Deniz Dogan
@ 2009-04-20 15:10     ` Deniz Dogan
  2009-04-20 15:44       ` Tassilo Horn
  0 siblings, 1 reply; 8+ messages in thread
From: Deniz Dogan @ 2009-04-20 15:10 UTC (permalink / raw)
  To: Deniz Dogan, emacs-devel

2009/4/20 Deniz Dogan <deniz.a.m.dogan@gmail.com>:
> 2009/4/20 Tassilo Horn <tassilo@member.fsf.org>:
>> Deniz Dogan <deniz.a.m.dogan@gmail.com> writes:
>>
>> Hi Deniz,
>>
>>> I recently found some strange behavior in the highlighting
>>> functionality provided by highlight-lines-matching-regexp. I'm not
>>> sure whether this is a bug or not, which is why I'm asking.
>>>
>>> Reproduction:
>>> 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?
>>
>> I've just tried it, and it works for me as it should when reusing the
>> previous regexp (which is the default) in step 5.
>>
>> Did you try with "emacs -Q" to be sure that no local customization
>> causes the breakage?
>>
>> Bye,
>> Tassilo
>
> Yes, I tried this with emacs -Q and I still experience the same
> behaviour. FWIW, here's the output from view-lossage:
>
> M-x h i g h l <tab> l i n <tab> <return> S T R O K E <return> <return>
> M-x r e v e r t - b u f <tab> <return> y e s <return> M-x <up> <up>
> <return> <return> <return>
>
> I should also mention that I didn't modify the file before reverting
> the buffer, so the contents were exactly the same.

And oh, yeah, I'm using Emacs 23.0.92.1.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug in highlight-lines-matching-regexp?
  2009-04-20 15:10     ` Deniz Dogan
@ 2009-04-20 15:44       ` Tassilo Horn
  0 siblings, 0 replies; 8+ messages in thread
From: Tassilo Horn @ 2009-04-20 15:44 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: emacs-devel

Deniz Dogan <deniz.a.m.dogan@gmail.com> writes:

Hi Deniz,

>>>> I recently found some strange behavior in the highlighting
>>>> functionality provided by highlight-lines-matching-regexp. I'm not
>>>> sure whether this is a bug or not, which is why I'm asking.
>>>>
>>>> Reproduction:
>>>> 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?
>>>
>>> I've just tried it, and it works for me as it should when reusing
>>> the previous regexp (which is the default) in step 5.
>>>
>>> Did you try with "emacs -Q" to be sure that no local customization
>>> causes the breakage?
>>
>> Yes, I tried this with emacs -Q and I still experience the same
>> behaviour. FWIW, here's the output from view-lossage:
>
> And oh, yeah, I'm using Emacs 23.0.92.1.

Oh, I can reproduce this problem using "emacs -Q" and

    M-x view-hello-file RET

followed by your recipe.

It's not possible to highlight lines matching the previous regexp
altogether.  No matter if I use the default (previous) value at the
highlight-lines-matching-regexp prompt or if I enter the regexp anew,
nothing will be highlighted.  Different regexps work, though.

But if I try the same and use my ~/.emacs as file, it works as expected.
Maybe it's related to some encoding issues?  The HELLO file uses
iso-2022-7bit-unix whereas my ~/.emacs uses utf-8-unix.

Bye,
Tassilo




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug in highlight-lines-matching-regexp?
  2009-04-20 14:25 Bug in highlight-lines-matching-regexp? Deniz Dogan
  2009-04-20 15:02 ` Tassilo Horn
@ 2009-04-20 15:53 ` martin rudalics
  2009-04-20 15:59   ` Deniz Dogan
  1 sibling, 1 reply; 8+ messages in thread
From: martin rudalics @ 2009-04-20 15:53 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: emacs-devel

 > 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




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug in highlight-lines-matching-regexp?
  2009-04-20 15:53 ` martin rudalics
@ 2009-04-20 15:59   ` Deniz Dogan
  2009-04-21  7:19     ` martin rudalics
  0 siblings, 1 reply; 8+ messages in thread
From: Deniz Dogan @ 2009-04-20 15:59 UTC (permalink / raw)
  To: martin rudalics; +Cc: emacs-devel

2009/4/20 martin rudalics <rudalics@gmx.at>:
>> 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.

FWIW, personally, I would expect the highlighting to preserved (or
rather "repeated") even after revert-buffer.

--
Deniz Dogan




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug in highlight-lines-matching-regexp?
  2009-04-20 15:59   ` Deniz Dogan
@ 2009-04-21  7:19     ` martin rudalics
  0 siblings, 0 replies; 8+ messages in thread
From: martin rudalics @ 2009-04-21  7:19 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: emacs-devel

 > FWIW, personally, I would expect the highlighting to preserved (or
 > rather "repeated") even after revert-buffer.

Please file a bug report so this gets the necessary attention.

martin





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-04-21  7:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 14:25 Bug in highlight-lines-matching-regexp? Deniz Dogan
2009-04-20 15:02 ` Tassilo Horn
2009-04-20 15:09   ` Deniz Dogan
2009-04-20 15:10     ` Deniz Dogan
2009-04-20 15:44       ` Tassilo Horn
2009-04-20 15:53 ` martin rudalics
2009-04-20 15:59   ` Deniz Dogan
2009-04-21  7:19     ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).