Subject: bug#51095: 28.0.50; Counter-intuitive `cursor-intangible-mode' behavior

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 09 Oct 2021 15:17:44 +0200

Brahimi Saifullah <[email-masked]> writes:

> Let's start with the following example:
> emacs -Q
> M-: (insert "|" (propertize "xxxxx" 'cursor-intangible t) "|")
> M-x cursor-intangible-mode
>
> Result:
> |xxxxx|
>   ^^^^^ You can't move the cursor here
>
> What I expected:
> |xxxxx|
>  ^^^^^ You can't move the cursor here

I can reproduce the behaviour, but unless I misunderstand something,
this seems like it's working as designed.

The cursor is really "between" two characters conceptually -- this is
easier to understand if you use a "bar" cursor.  So if you put the point
here:

|xxxxx|
 ^

then it's before the first x and after the first |.  (You can confirm by
entering a character when it's at that point.)

The behaviour at the end is more puzzling, but as you've found out, it's
because the properties don't have rear-nonsticky, so you can't put point
right after the final x.

So I think everything here is working as designed.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no