GNU bug report logs - #21207
25.0.50; Cursor position behaves unpredictably on the 'display text property

Previous Next

Package: emacs;

Reported by: bruce.connor.am <at> gmail.com

Date: Fri, 7 Aug 2015 15:08:01 UTC

Severity: minor

Found in version 25.0.50

Full log


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

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21207 <at> debbugs.gnu.org
Subject: Re: bug#21207: 25.0.50; Cursor position behaves unpredictably on the
 'display text property
Date: Fri, 7 Aug 2015 19:31:29 +0100
[Message part 1 (text/plain, inline)]
> > If I can place the cursor on the newline in the first scenario, why
> > can't I do so in the second?
>
> Because we have special support for cursor positioning on display
> strings that end in a newline (AFAIR, since some packages that change
> how a newline is displayed needed that).
>
> > I tried adding a '(cursor t) property to the "\n" substring, but
> > nothing changed.
>
> You cannot put a 'cursor' property on a newline, because a newline
> leaves no glyphs on display.  To be effective, the 'cursor' property
> needs to be placed on a character that produces some glyph.

That makes sense. Thanks for the explanations, Eli.

> > Is there a way around this?
>
> Why do you need it?  What is your real-life use case?

I'm using this to visually wrap some lines, but not others (as part of
rewriting longlines-mode to work without editing the buffer).
I can wrap only the lines I want by doing the procedure in item 2
(displaying a space as a newline). When the line I'm wrapping happens to be
indented, I have to use the procedure in item 4 (so the second line gets
indented too), and it's mildly annoying that I can't place the cursor at
the end of the line.
[Message part 2 (text/html, inline)]

This bug report was last modified 10 years and 4 days ago.

Previous Next


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