help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: emacs 24 problem: `revert` command forgets bindings from `occur` buf


From: Tassilo Horn
Subject: Re: emacs 24 problem: `revert` command forgets bindings from `occur` buffer for compressed files.
Date: Tue, 10 Jul 2012 10:07:33 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux)

Paul K <mafeuser@gmail.com> writes:

Hi Paul,

> Steps to reproduce:
> 1) visit some compressed file, for example: /tmp/file.txt.bz2
> 2) M-x occur: `on some string that exisits in the file`
> 3) visit line with string metched by pressing <ENTER> in `occur` buffer
> 4) modify contents of file.txt.bz2, but do not save it.
> 5) M-x revert-buffer. Answer Yes.
>     This action probably forgets all the pointers within file.txt.bz2
> buffer, even `point`.
> 6) go back to `occur` buffer and try to visit the same line again:
> EMACS JUMPS TO LAST LINE WITHIN file.txt.bz2.
>
> Is it a bug?

Not really a bug.  Occur uses markers in the "occured" buffer to specify
the match locations instead of line/colum numbers, and the links in the
*occur* buffer target those markers.  Thus, when you edit the buffer,
i.e., add or remove lines, the links are still valid for the occurences
that were already there before and haven't been removed by your editing,
because the markers are attached to the matched text and thus move
appropriately.

However, if you revert the buffer so that the file is found again, there
are no markers anymore.  When you click a link in the old *occur*
buffer, Emacs will try to find the given marker but fail, and thus point
ends up at the end of the buffer.

Bye,
Tassilo




reply via email to

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