Ihor Radchenko <[email protected]> writes: > "J.D. Smith" <[email protected]> writes: > >>> 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 > ===================================
Indeed that behavior is essential for the feature to work correctly! The basic idea here is that the redisplay engine will skip over the invisible chars as it will, depending on direction of motion. The cursor will /show you/ which side you've landed on (as will unhiding, of course). > Also, see https://list.orgmode.org/orgmode/20240428093320.120843ae@enoush2o/ That seems to be another good example of the ambiguity of position of point when near invisible chars, which this feature is designed to disambiguate. >>> 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. I think that's more of a "box shape seems less inside the bar" point of view, which I can see, since the box "intrudes" more into the pixels of the visible string. But box is the default type. >> 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. Should be easy. What we can't do (and see any difference) is have box as the default type outside, but also a box type to show inside. Could also change color, if shape confusing. >> 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. So v31 reproduces? Sounds like an introduced bug which should be reported and fixed. Can you tell if it's just skipping the call to the cursor sensor function in some context? Or perhaps calling it with bad data?
