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

>> 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.
>
> IMO it *is* correct, since the (default) block cursor indicates "outside
> of the hidden-marker-wrapped text".  At that <point>, edits will happen
> "outside", so 'block is correct.

Is it? AFAIK, the position of the point depends on the command
direction.

    22.6 Adjusting Point After Commands
    ===================================

    When a sequence of text has the ‘display’ or ‘composition’ property, or
    is invisible, there can be several buffer positions that result in the
    cursor being displayed at same place on the screen.  Therefore, after a
    command finishes and returns to the command loop, if point is in such a
    sequence, the command loop normally moves point to try and make this
    sequence effectively intangible.

       This _point adjustment_ follows the following general rules: first,
    the adjustment should not change the overall direction of the command;
    second if the command moved point, the adjustment tries to ensure the
    cursor is also moved; third, Emacs prefers the edges of an intangible
    sequence and among those edges it prefers the non-sticky ones, such that
    newly inserted text is visible.

Also, see https://list.orgmode.org/orgmode/20240428093320.120843ae@enoush2o/

>> 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
>
> I'm afraid I don't understand how this would be more intuitive.  The
> "inside" cursor type is the bar.  The outside cursor type is box.
> Expanding on your scenario, my current code does this:
>
>   OUT<point>SIDE *FOO* -> OUT[S]IDE FOO  ; definitely in outside text: 
> default box cursor
>   OUTSIDE <point>*FOO* -> OUTSIDE [F]OO  ; adjacent to, but still outside: box

I can get your argument (although, see above), but when the cursor is
literally displayed over the latter [F], it is counter-intuitive for me
that the cursor is outside.

>   OUTSIDE *<point>FOO* -> OUTSIDE |FOO   ; inside (just): bar
>   OUTSIDE *FO<point>O* -> OUTSIDE FO|O   ; definitely inside: bar
>   OUTSIDE *FOO<point>* -> OUTSIDE FOO|   ; still inside!
>   OUTSIDE *FOO*<point> -> OUTSIDE FOO[ ] ; now outside again: box
>
> So maybe what you prefer is for your default (outside) cursor to be 'bar
> and your "inside" cursor to be 'box?  That should definitely be
> possible.

Maybe. But since you find an opposite intuitive, maybe it should be a
question of customization.

>> As I said, unhiding markers could be an option - many users quite like
>> what org-appear does. But your approach alone is also viable.
>
> Yes, definitely both approaches should be an option.  In terms of
> hiding/unhiding, does org-appear do anything differently that you know?
> I have only ever tried it out briefly.

I tried it only briefly as well.
defcustom from
https://github.com/awth13/org-appear/blob/master/org-appear.el
might be worth considering.

>> 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)
>
> That definitely isn't intended.  With this I get the expected:
>
>  Some *F|OO* or another
>
> from emacs -Q.  Can you try from that?  It should never be a block
> inside.  Do you customize your cursor (which shouldn't matter)?

I did it with emacs -Q. On Emacs master.
On Emacs 30 and Emacs 29, I cannot reproduce.

-- 
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