GNU bug report logs - #5620
23.1.92.1; next-error no longer takes into account buffer modifications

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmx.net>

Date: Mon, 22 Feb 2010 16:19:02 UTC

Severity: normal

Tags: moreinfo, wontfix

Merged with 7351

Found in version 24.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5620 in the body.
You can then email your comments to 5620 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5620; Package emacs. (Mon, 22 Feb 2010 16:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Pogonyshev <pogonyshev <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 22 Feb 2010 16:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1.92.1;
	next-error no longer takes into account buffer modifications
Date: Mon, 22 Feb 2010 17:48:38 +0200
When hitting C-x ` (next-error) the point is positioned correctly only
if the buffer is not modified.  If number of lines before the target
position is changed, point is positioned wrongly.

For instance, say 'test.txt' contains these lines:

    foo
    bar
    baz

I then run 'grep' from Emacs like this:

    grep -nH -e ba test.txt

Results:

    -*- mode: grep; default-directory: "/home/paul/test/" -*-
    Grep started at Mon Feb 22 17:41:30

    grep -nH -e ba test.txt
    test.txt:2:bar
    test.txt:3:baz

    Grep finished (matches found) at Mon Feb 22 17:41:30

Then I insert a few more lines in 'test.txt' buffer:

    foo
    bar
    spam
    ham
    baz

Now if I hit C-x ` the first time point is moved to line 2 --
correctly.  The second time, however, the point is moved to line 3,
i.e. the original location of 'baz'.  However, 'baz' is now at line 5
and that's where I expect C-x ` to move point to.  Note that at no
point I closed the buffer, so Emacs should be able to track changes
between 'grep' run and current buffer/file contents.

This is especially unhelpful with compilation errors.  Often, you'd go
through errors fixing them in process, sometimes adding or removing
lines.  However, any such change makes finding subsequent errors
difficult as C-x ` will no longer locate errors correctly.

I believe this used to work fine in past.

Paul





Severity set to 'wishlist' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 23 Feb 2010 20:57:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5620; Package emacs. (Tue, 23 Mar 2010 18:36:01 GMT) Full text and rfc822 format available.

Message #10 received at 5620 <at> debbugs.gnu.org (full text, mbox):

From: Sam Steingold <sds <at> gnu.org>
To: 5620 <at> debbugs.gnu.org
Subject: bug fixed in revno: 99732
Date: Tue, 23 Mar 2010 14:25:05 -0400
bug fixed in

revno: 99732
committer: Sam Steingold <sds <at> gnu.org>
branch nick: trunk
timestamp: Tue 2010-03-23 14:22:46 -0400
message:
  Fix bug#5620: recalculate all markers on compilation buffer
  modifications, not on file modifications.
  (buffer-modtime): New buffer-local variable:
  the buffer modification time, for buffers not associated with files.
  (compilation-mode): Create it.
  (compilation-filter): Update it.
  (compilation-next-error-function): Use it instead of
  `visited-file-modtime' for timestamp.

-- 
Sam Steingold <http://sds.podval.org>




bug closed, send any further explanations to Paul Pogonyshev <pogonyshev <at> gmx.net> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Tue, 23 Mar 2010 20:05:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 21 Apr 2010 11:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Paul Pogonyshev <p.pogonyshev <at> anakreon.net> to control <at> debbugs.gnu.org. (Wed, 28 Apr 2010 15:07:01 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Apr 2010 15:07:01 GMT) Full text and rfc822 format available.

Merged 5620 7351. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 07 Nov 2010 00:44:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5620; Package emacs. (Sat, 04 Dec 2021 21:01:02 GMT) Full text and rfc822 format available.

Message #23 received at 5620 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Pogonyshev <p.pogonyshev <at> anakreon.net>
Cc: 5620 <at> debbugs.gnu.org
Subject: Re: bug#5620: 23.1.92.1; next-error no longer takes into account
 buffer modifications
Date: Sat, 04 Dec 2021 22:00:20 +0100
Paul Pogonyshev <p.pogonyshev <at> anakreon.net> writes:

> I wonder if the supposed fix was checked at all.  It fixes neither the
> original test case in the bug report, nor compilation error messages.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

The problem (as demonstrated by the original test case) is still present
in Emacs to this day.  But it does seem to work sometimes, in my vague
recollection?  Let's see...

Right, this is supposed to work by setting markers in the buffers where
you have the hits, so if you change the buffer in a way that doesn't
make the markers move, then you'll get the wrong line.

In this case:

foo
bar
baz

The marker is a 9, the start of the "baz" line.  Then we yank two lines:

foo
bar
spam
ham
baz

But this doesn't make the "baz" marker move -- we're inserting before
that marker.

So I'm not sure how this could be fixed in general, as this is just the
way markers work.  We could set the marker on the second char of the
line, perhaps, and that'd be marginally less likely to have this effect
(since people commonly insert new lines), but that seems like a pretty
gross hack.

So I don't know what, if anything, could be done here.  Anybody?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 04 Dec 2021 21:01:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5620; Package emacs. (Fri, 21 Jan 2022 13:48:02 GMT) Full text and rfc822 format available.

Message #28 received at 5620 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Pogonyshev <p.pogonyshev <at> anakreon.net>
Cc: 5620 <at> debbugs.gnu.org
Subject: Re: bug#5620: 23.1.92.1; next-error no longer takes into account
 buffer modifications
Date: Fri, 21 Jan 2022 14:47:22 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> So I'm not sure how this could be fixed in general, as this is just the
> way markers work.  We could set the marker on the second char of the
> line, perhaps, and that'd be marginally less likely to have this effect
> (since people commonly insert new lines), but that seems like a pretty
> gross hack.
>
> So I don't know what, if anything, could be done here.  Anybody?

Nobody had an opinion in a month, so I think we'll keep the current
semantics, and I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 21 Jan 2022 13:48:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 5620 <at> debbugs.gnu.org and Paul Pogonyshev <pogonyshev <at> gmx.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 21 Jan 2022 13:48:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 19 Feb 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.