unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Platon Pronko <platon7pronko@gmail.com>
To: tomas@tuxteam.de
Cc: help-gnu-emacs@gnu.org
Subject: Re: Moving point around empty overlays with 'after-text
Date: Mon, 10 Apr 2023 13:48:55 +0800	[thread overview]
Message-ID: <441f52ef-10e5-1b3b-c2c9-e1c79dd09190@gmail.com> (raw)
In-Reply-To: <ZDOgNUd3EVWiKhiM@tuxteam.de>

On 2023-04-10 13:35, tomas@tuxteam.de wrote:
> For non-zero width overlays, it is quite easy to have
> point to each side of the overlay's "border": it depends
> on which side you are coming from. For me, at least, it
> is intuitive.

Does it work that way for you? For me the default non-propertized overlay always shows the cursor at the end, regardless of which direction I arrived from.

Here's the test file I used:

```
ABEF

(defun test-overlay-cursor (completion pt)
   (remove-overlays)
   (save-excursion
     (let* ((p-completion (propertize completion 'face 'error))
            (ov (make-overlay pt pt nil t t)))
       (overlay-put ov 'display "")
       (overlay-put ov 'after-string p-completion)))
   (goto-char 0))
(test-overlay-cursor "CD" 3)
```

I can navigate so I see "AB{CD}<cursor>EF" or "A<cusor>B{CD}EF", but I can't get the cursor to be before the overlay: "AB<cursor>{CD}EF".

Of course one can add properties to the overlay to get the cursor be positioned always in front, but then you can't get to show it at end.

The main point of the discussion is that it would be nice if it would be possible use usual navigation commands to get from "AB<cusror>{CD}EF" to "AB{CD}<cusor>EF".

-- 
Best regards,
Platon Pronko
PGP 2A62D77A7A2CB94E




  reply	other threads:[~2023-04-10  5:48 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
2023-04-10  5:35           ` tomas
2023-04-10  5:48             ` Platon Pronko [this message]
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=441f52ef-10e5-1b3b-c2c9-e1c79dd09190@gmail.com \
    --to=platon7pronko@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=tomas@tuxteam.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.
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).