"J.D. Smith" <[email protected]> writes:

>> Can simply specify 'invisible nil.
>
> Not in my testing.  There are many scenarios where a `nil' value does
> not override a non-`nil' value in Emacs, despite what is advertised
> (IME).  This is on v30.

You may be right. I recall being confused by these things in the past.

>> 2. Moving -> out of the emphasis followed by <- feels not right
>
> Is that because point moves to the position it would have occupied if
> there were no `*' at all?  Maybe you prefer the movement to "stay
> adjacent" to the formerly hidden-marker text.

Not really.
Let me explain better, using my observations with your latest code.
When I have
<point>*FOO*, the cursor is a block cursor on top of "F", which is not
right.
When I move C-f *<point>FOO*, the cursor is a *|FOO*.
I think a more intuitive approach would be

<point>*FOO* -> |FOO
*<point>FOO* -> [F]OO

Aside: note that some users customize the default cursor shape.

> If you comment out the overlay moves, you'll see that this type of
> motion is more awkward with cursor-only changes, as point seems "not to
> make progress" as you move out from the hidden text.  Some people might
> prefer that behavior, so it could be an option.  Or could just:
>
> - Unhiding markers?  Moving out keeps point adjacent.
> - Just changing cursor?  Moving out continues naturally.

As I said, unhiding markers could be an option - many users quite like
what org-appear does. But your approach alone is also viable.

> Please try the below demo command `my/try-inside'.  This version fixes
> both issues you noticed, and handles edits at the boundary better
> (though in real org, font-lock would supersede this).

What I do

Some<point> FOO or another
Some FOO or another

C-f C-f C-f
Some F[O]O or another (block cursor)
C-n

Some FOO or another
Some *F|OO* or another

The above is inconsistent.

> - A feature branch on savannah, or mailing list patches?

Up to you.
We usually do mailing list for small-ish patches, but this is not a hard
rule. Whatever works better for your habits.

> - A separate file (thinking `org-inside.el' or similar), or implement
>   within `org.el'?  I guess either way the font-locking support would
>   need to be there.

Better go for separate file.
The long-term plan is splitting Org into smaller libraries.

> Options I'm considering:
>
> - A minor mode users can enabled/disable (would turn off/on
>   cursor-sensor-mode).  Or this could require `org-mode-restart'.
>
> - A custom var to configure desired options when "inside": cursor change
>   (if desired, including cursor type and/or face), marker unhiding.

I think a minor mode will be better.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to