GNU bug report logs - #21468
24.5; When next-line (visual) crosses overlay with before-string="\n" point goes to column 0

Previous Next

Package: emacs;

Reported by: Noam Postavsky <npostavs <at> users.sourceforge.net>

Date: Sun, 13 Sep 2015 05:18:01 UTC

Severity: normal

Found in version 24.5

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 21468 <at> debbugs.gnu.org
Subject: Re: bug#21468: 24.5;
 When next-line (visual) crosses overlay with before-string="\n" point
 goes to column 0
Date: Mon, 14 Sep 2015 16:33:30 +0300
> Date: Mon, 14 Sep 2015 08:46:57 -0400
> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
> Cc: 21468 <at> debbugs.gnu.org
> 
> On Mon, Sep 14, 2015 at 2:17 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > Of course: that's a line of text.  Why is that a problem?  (I have no
> > idea what role is that thin line serving in Magit.)
> 
> In this particular case, the overlays are delimiting a "magit region"
> (consisting of whole logical lines touched by Emacs' region). This
> means the thin line has to move with point, staying just ahead of it.

What's wrong with marking the region with some special background
color?

Anyway, if you must use overlays here, by all means do, just try to
avoid newlines in its strings, if you want reliable cursor movement
across that overlay.

Please understand: what you originally perceived as a "bug" was
actually normal Emacs routine of placing point immediately after the
end of the overlay string.  It ended up in column zero because the
overlay string ended in a newline.  If there were no newline, the
problem would not have happened.  We now have special code in
vertical-motion that caters to this specific scenario.  That's why
using such overlay strings should be discouraged: they tend to force
us add similar special-case code all over the place.

> Here is a demo, eval this in a buffer, then do set-mark-command and
> move around a bit:

What am I supposed to see?  I see nothing that I don't see without
this.




This bug report was last modified 9 years and 304 days ago.

Previous Next


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