all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael_heerdegen@web.de, jonas@bernoul.li, 19200@debbugs.gnu.org
Subject: bug#19200: Point adjustemnt moves *into* invisible text
Date: Wed, 23 Mar 2016 12:10:26 -0400	[thread overview]
Message-ID: <jwvoaa5b39c.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83poul2ob9.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 23 Mar 2016 17:42:34 +0200")

> But we display characters, not positions.  And the cursor is displayed
> "on" some character as well.

Yes.  And from that point of view, there's no difference whether point
is at position 3, 4, or 5: the display will be the same.

So the choice of whether to put point at 3, 4, or 5 can't be just based
on "what it looks like" but on what happens when the user performs
an operation.

And "The Right Thing" will then depend on the operation, and the reason
why the text was made invisible.  Which is why the chosen position needs
to be controllable (the fact that it's controlled by stickiness is
somewhat arbitrary in this respect).

The choice of using stickiness is based on the idea that an important
operation is insertion, in which case it's important to make sure that
when the user moves around and edits a buffer that has invisible text,
she doesn't end up inserting text that's invisible (and hence get the
impression that the insertion somehow didn't even happen).

> And it isn't important what I remember, because above I was talking
> about what the display code does: it examines properties of characters
> using the likes of get-char-property, and behaves accordingly.

I still don't see any relationship with point-adjustment.

>> > The other notion of "invisible" also has its disadvantages, so it's
>> > not easy to decide which one is "right", but at least it doesn't fight
>> > an uphill battle against the display engine.)
>> AFAIK there's no relevant interaction with the display engine.
> Read the code: it's all over the place.  Why do you think
> vertical-motion ends up at position 5 in the test case you presented
> in this bug report?

I don't see how that relates.  Point-adjustment has to work regardless
of which command was used, and point can end up at position 4 or
5 rather than position 3 for all kinds of reasons unrelated to
invisibility, so if vertical-motion goes to position 5, it's really (or
at least should be) a non-issue for point-adjustment.

>> The issue of the main bug is not so much that we don't know how to fix
>> it, but that noone has bothered to investigate it to try and figure out
>> what is actually happening.
> Didn't I do that?  Doesn't the fact that the relevant code calls
> get-char-property-and-overlay explain what happens?

No: the get-char-property-and-overlay calls will only determine the
boundaries of the invisible text (i.e. they should find that the
invisible chunk goes between 3 and 5).

After that, adjust_point_for_property should start by moving point to
position 3 (because last_pt should be < 3).

And after that it should use Fget_pos_property to decide whether to stay
at position 3 or to move to position 5, and in this case it should
choose to stay at position 3.

So someone needs to step through the code and figure out why this
doesn't happen.  E.g. maybe it doesn't happen because
adjust_point_for_property is not called at all.


        Stefan





  reply	other threads:[~2016-03-23 16:10 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 22:22 bug#19200: Point adjustemnt moves *into* invisible text Stefan Monnier
2016-03-20 22:58 ` Michael Heerdegen
2016-03-21  1:21   ` Stefan Monnier
2016-03-21  2:15     ` Michael Heerdegen
2016-03-21  2:23       ` Michael Heerdegen
2016-03-21 18:30         ` Eli Zaretskii
2016-03-21 12:08       ` Stefan Monnier
2016-03-21 14:52         ` Michael Heerdegen
2016-03-21 15:36           ` Stefan Monnier
2016-03-21 15:54             ` Michael Heerdegen
2016-03-21 18:08               ` Stefan Monnier
2016-03-21 18:28             ` Eli Zaretskii
2016-03-21 19:24               ` Michael Heerdegen
2016-03-21 19:40                 ` Eli Zaretskii
2016-03-21 20:10                   ` Michael Heerdegen
2016-03-21 20:21                     ` Michael Heerdegen
2016-03-21 20:43               ` Stefan Monnier
2016-03-22 16:39                 ` Eli Zaretskii
2016-03-22 18:36                   ` Stefan Monnier
2016-03-22 18:52                     ` Eli Zaretskii
2016-03-23  2:13                       ` Stefan Monnier
2016-03-23 15:15                         ` Eli Zaretskii
2016-03-23 15:32                           ` Stefan Monnier
2016-03-23 15:42                             ` Eli Zaretskii
2016-03-23 16:10                               ` Stefan Monnier [this message]
2016-03-31 17:17                                 ` Eli Zaretskii
2016-03-31 18:04                                   ` Stefan Monnier
2016-03-31 23:32                                     ` Michael Heerdegen
2016-03-26 21:49                             ` bug#19200: Point adjustment " John Wiegley
2016-03-21 18:31       ` bug#19200: Point adjustemnt " Eli Zaretskii
2016-03-21 18:50         ` Michael Heerdegen

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=jwvoaa5b39c.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=19200@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jonas@bernoul.li \
    --cc=michael_heerdegen@web.de \
    /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.