From: Eli Zaretskii <eliz@gnu.org>
To: bruce.connor.am@gmail.com
Cc: 21207@debbugs.gnu.org
Subject: bug#21207: 25.0.50; Cursor position behaves unpredictably on the 'display text property
Date: Fri, 07 Aug 2015 18:29:10 +0300 [thread overview]
Message-ID: <83twsbqfqx.fsf@gnu.org> (raw)
In-Reply-To: <CAAdUY-LkX_X2Qvo1R=fbrYNm4D6z3YLuEsW-DiV_amso6po8vw@mail.gmail.com>
> Date: Fri, 7 Aug 2015 16:07:27 +0100
> From: Artur Malabarba <bruce.connor.am@gmail.com>
>
> 1. Type `single line' into an empty buffer, and place the cursor at the space.
> 2. Hit M-: and evaluate the following snippet
> (add-text-properties (point) (1+ (point)) '(display "\n"))
> 3. When the space in the middle gets "turned" into a newline, the
> cursor is left where it was (at the fake end of the first line, right
> after the word `single').
> 4. Now follow the same steps on a new buffer, but evalate this instead:
> (add-text-properties (point) (1+ (point)) '(display "\n------"))
> 5. This time, the cursor will be moved down to the start of the second
> "fake" line (right before the `-----'). Furthermore, it is impossible
> to place it at the position we had in item 3, it just jumps straight
> from the first `e' to the first `-', skipping the actual newline char.
>
> 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).
> Is there a way around this?
Why do you need it? What is your real-life use case?
> 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.
next prev parent reply other threads:[~2015-08-07 15:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-07 15:07 bug#21207: 25.0.50; Cursor position behaves unpredictably on the 'display text property Artur Malabarba
2015-08-07 15:29 ` Eli Zaretskii [this message]
2015-08-07 18:23 ` Eli Zaretskii
2015-08-07 19:43 ` Artur Malabarba
2015-08-08 7:27 ` Eli Zaretskii
2015-08-08 18:08 ` Artur Malabarba
2015-08-07 18:31 ` Artur Malabarba
2015-08-07 19:04 ` Eli Zaretskii
2015-08-07 19:56 ` Artur Malabarba
2015-08-07 20:13 ` Eli Zaretskii
2015-08-08 3:39 ` Artur Malabarba
2015-08-08 6:52 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83twsbqfqx.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=21207@debbugs.gnu.org \
--cc=bruce.connor.am@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.