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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 21468 <at> debbugs.gnu.org
Subject: bug#21468: 24.5; When next-line (visual) crosses overlay with before-string="\n" point goes to column 0
Date: Fri, 02 Oct 2015 13:01:06 +0300
> Date: Thu, 1 Oct 2015 16:43:11 -0400
> From: Noam Postavsky <npostavs <at> users.sourceforge.net>
> Cc: 21468 <at> debbugs.gnu.org
> 
> > I think you should be able to extend the face by using a display
> > property with :align-to value.  The value should be computed to go all
> > the way to the edge of the window.
> 
> We tried something like this:
> 
> (let ((align `(space :align-to (+ (,(window-body-width nil t))
>                                   ,(window-hscroll)))))
>   (ov rbeg eol 'face (list :overline color)
>       'after-string (propertize "\s" 'face face 'display align)))
> 
> But when moving point to end of line this causes the cursor to appear
> at the edge of the window instead of at the "real" end of line. I
> guess it's because the aligned space pushes the newline character to
> the edge of the window.

Yes.  But why is that a problem?

If you dislike that, you could make the stretch one column shorter,
like this:

  (let* ((align (list 'space :align-to `(+ (,(- (window-body-width nil t)
						(default-font-width)))
					   ,(window-hscroll))))

(Btw, I think adding window-hscroll is incorrect here, as its value is
in columns, while window-body-width returns the width in pixels.)

> > I cannot do anything about these issues besides explaining how they
> > harm Emacs maintenance, and asking people to look for alternative
> > solutions.
> 
> Well you *could* refuse to fix bugs like this, i.e. declare that
> creating overlays with newlines invokes undefined behaviour.

I could, but I consider that a "doomsday weapon", hopefully never to
be used in Emacs development, certainly not by me.  I don't think it
was ever done.




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

Previous Next


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