unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Platon Pronko <platon7pronko@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, help-gnu-emacs@gnu.org
Subject: Re: Moving point around empty overlays with 'after-text
Date: Tue, 11 Apr 2023 16:41:00 +0700	[thread overview]
Message-ID: <CAP_d_8Vt4iwRh0yani0bbbi+3p9e8u5oVWfAOn8Z4fLvtxx4Ow@mail.gmail.com> (raw)
In-Reply-To: <dc397234-064a-0f2e-19d7-a75da3f97376@gmail.com>

On Tue, 11 Apr 2023 at 15:49, Platon Pronko <platon7pronko@gmail.com> wrote:

> I'm talking more about the user intention, before he actually types anything, and consequently the confusion he will temporarily experience when he will try to execute this intention. We here in Emacs mailing list understand the internals quite well and thus can understand that the overlay is zero-width and cursor position is actually the same on both sides. Less-enlightened user won't - for him the inlay is something tangible, present in the buffer the same way as the characters are present in the buffer.

Then the less-enlightened user is screwed, because treating the inlay
text as ordinary code may teach them wrong syntax.

Example 1: C++ does not have named arguments, but inlays will still
show them. And, presumably, not in /* comment markers */.

Example 2: In Python, named arguments are allowed only after all the
positional arguments. If a user sees test(a1=42) and does not realize
“a1=” is an inlay, they may try to prepend an explicitly named a0=3.14
argument and be stumped at a syntax error message for “test(a0=3.14,
42)”.


> And in the discussed example the user can have two different intentions:
>
> […]
>
> Intention 2: prepending another argument. In this case he will want to position the cursor before the overlay:
>
> test(<cursor>a1=42)

Yes, but in order to consistently act on this intention, the editor
must insert the argument separator as soon as a character is inserted
before the inlay, and also be prepared to deal with the user typing it
in manually after the argument value.

> // User tries to type "a0=1," (let's imagine there was such an argument)
> test(a<cursor>a1=42)
> // More typing
> test(a0=1,<cursor>a1=42)


All that said, I think it may be considered an argument in favor of
suppressing the inlay when the point is adjacent to it, the same way
prettify-symbols-unprettify-at-point does for prettify-symbols-mode.



  reply	other threads:[~2023-04-11  9:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-08  5:46 Moving point around empty overlays with 'after-text Ash
2023-04-08 10:06 ` Eli Zaretskii
2023-04-08 10:14   ` Platon Pronko
2023-04-08 10:10 ` Platon Pronko
2023-04-08 23:06   ` Ash
2023-04-09 12:15     ` Platon Pronko
2023-04-09 14:49       ` tomas
2023-04-10  1:52         ` Platon Pronko
2023-04-10  4:56           ` Eli Zaretskii
2023-04-10  5:22             ` Platon Pronko
2023-04-10  9:56               ` Yuri Khan
2023-04-11  8:49                 ` Platon Pronko
2023-04-11  9:41                   ` Yuri Khan [this message]
2023-04-10  5:35           ` tomas
2023-04-10  5:48             ` Platon Pronko
2023-04-09 20:44       ` Ash
2023-04-10  2:00         ` Platon Pronko
2023-04-10  3:21           ` Ash
2023-04-10  3:31             ` Platon Pronko
2023-04-11  0:22               ` Ash
2023-04-10  5:09             ` Eli Zaretskii
2023-04-10  5:37               ` Platon Pronko
2023-04-10  8:03                 ` Eli Zaretskii
2023-04-10  9:05                   ` Platon Pronko
2023-04-10  5:01           ` Eli Zaretskii
2023-04-10  5:26             ` Platon Pronko

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP_d_8Vt4iwRh0yani0bbbi+3p9e8u5oVWfAOn8Z4fLvtxx4Ow@mail.gmail.com \
    --to=yuri.v.khan@gmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=platon7pronko@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).