bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21207: 25.0.50; Cursor position behaves unpredictably on the 'displa


From: Artur Malabarba
Subject: bug#21207: 25.0.50; Cursor position behaves unpredictably on the 'display text property
Date: Fri, 7 Aug 2015 19:31:29 +0100


> > 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]