Thanks for your copious explanations!

On 2026-05-02  15:09, J.D. Smith wrote:

>> * Emacs Master Being the Culprit
>>
>> I can see that `org-inside--sensor' gets called in the example Org mode
>> document at point 21 ("outside"!) in Emacs master when approaching the
>> trailing emph marker from behind.  Which is too early for your code,
>> since the `next-single-property-change' rightfully returns nil when
>> called at that point.
>>
>> With Emacs 30.2 however, `org-inside--sensor' gets called at point 20
>> ("inside") and everything works out fine.
>
> Thanks.  That's strange (and unexpected).  v31 did add a new sensor type
> `moved' (which Ihor discovered), but I ignore that one.  I also had
> understood the issues you encountered were with v28, but here you are
> mentioning they occur with v31?  Can you confirm (or is it both)?

Sorry, this version information really was confusingly distributed all
over my mails.  The key take away: You get above bug when you execute my
test cases with Emacs master.  Only.  Emacs 30 does not exhibit that
bug. (And Emacs 28 I initially only used for *compiling* Org mode.)


> [...]  To make sure I understand your mental model, let me
> restate it: if an insertion at point would appear either inside the
> hidden markers OR /directly adjacent to/ (but outside) them, markers are
> revealed.

To be honest: I haven't been entirely honest so far, pretending I'd like
to have the default `org-appear' behavior, which you precisely describe
above.  In your initial mail you have mentioned exactly that behavior,
so I started harping on about that.  But not unlike you, I decided
already quite some time ago that I find dynamically (dis)appearing
markers distracting, the more that most of the time one navigates
through emphasized text without actually editing it.

So what I came up with in "my mode" is a command (hooked into C-c C-c in
my init file) that shows the markers when located inside emphasized text,
what then keeps them visible until you leave that text span (+/- that one
additional character).  Without that command explicit command markers
stay hidden all the time.  Not sure whether that would work out well with
org-inside, though, since it does not have that one additional
character.  (And I understand why.)


> Pink elephants, but not entirely your fault ;).

Meh.  You're right here.  I just have never been using bar-style cursors
in Emacs.


But here is another minor nit: When `org-inside-mode' is currently
enabled with

  org-inside-appearance == '(:cursor bar)

and you're in an emphasized region AND at that time decide to

  (setopt org-inside-appearance '(:face underline))

then the cursor stays bar-shaped, even if you leave the currently
emphasized region.  The same happens if you use `customize-variable'.
Probably you should extend the `defcustom' on `org-inside-appearance'
with some `:set'ter to avoid such effects?

Plus bonus points if your setter in the use case above not only disables
the bar-shaped cursor, but also immediately underlines the emphasized
region.  I think that would be what users would expect when they tweak
that variable to see what the various appearances look like.


Reply via email to