GNU bug report logs -
#51095
28.0.50; Counter-intuitive `cursor-intangible-mode' behavior
Previous Next
Reported by: Brahimi Saifullah <brahimi.saifullah <at> gmail.com>
Date: Fri, 8 Oct 2021 14:59:01 UTC
Severity: normal
Tags: moreinfo
Found in version 28.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #24 received at 51095 <at> debbugs.gnu.org (full text, mbox):
> 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
>
> To clarify, although all the `X's are set to be intangible, you can still move
> your cursor to the first one. Furthermore, even though neither `|' has a text
> property, you cannot move your cursor to the last one.
If you want `xxxxx` to be intangible, that means you presumably still
want to be able to move the cursor between the two `|` but the cursor
movement should be "as if" the `xxxxx` was absent (so the `xxxxx` will
be either attached to the first `|` or to the second).
If so, where do you want to place the cursor when it's between the two `|`?
One choice is to place it right after the first `|`, another is to place
it right before the second `|`. Both choices make sense, AFAICT, and
you haven't explicitly specified which you want (other than in this bug
report, that is), so the behavior you see looks OK to me.
You can control this behavior via the stickiness property.
> Basically, make the first character front-sticky, and the last character
> rear-nonsticky. Now it works as expected.
But now you allow the cursor to be either before the `xxxxx` or after
the `xxxxx`, so they're not really intangible any more. It seems you
want them to be "atomic" instead, which we do not directly support (you
can simulate it by marking the first four `x` as `intangible`, for
example).
> The question is: Is this behavior intuitive?
Depends what you want, obviously.
Stefan
This bug report was last modified 3 years and 188 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.