From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: emacs 24 problem: `revert` command forgets bindings from `occur` buffer for compressed files. Date: Tue, 10 Jul 2012 10:07:33 +0200 Message-ID: <87ehokuji2.fsf@thinkpad.tsdh.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1341907691 22212 80.91.229.3 (10 Jul 2012 08:08:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 Jul 2012 08:08:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 10 10:08:11 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SoVUP-0004dV-VI for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Jul 2012 10:08:10 +0200 Original-Received: from localhost ([::1]:33034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoVUO-0003hA-Ub for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Jul 2012 04:08:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoVUF-0003eB-97 for help-gnu-emacs@gnu.org; Tue, 10 Jul 2012 04:08:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoVU9-0002VN-3L for help-gnu-emacs@gnu.org; Tue, 10 Jul 2012 04:07:58 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:49418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoVU8-0002VH-SY for help-gnu-emacs@gnu.org; Tue, 10 Jul 2012 04:07:53 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SoVU7-0004GK-Fi for help-gnu-emacs@gnu.org; Tue, 10 Jul 2012 10:07:51 +0200 Original-Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Jul 2012 10:07:51 +0200 Original-Received: from tassilo by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 10 Jul 2012 10:07:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:+o5XXUwST+k5qwJETb9ZfwdbZnE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85754 Archived-At: Paul K 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 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