Jens Schmidt <jschmidt4...@vodafonemail.de> writes:

>> Fixed, on main.
>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3e3b873d3
>
> Well, I have one not-so-minor nit here: With that commit you cannot 
> insert text *before* some text having hidden emphasis without breaking 
> the emphasis.  More concretely (in an empty org-mode buffer):
>
> ...
>   C-<left>    ;; left-word
>   C-<left>    ;; left-word
>   SPC      ;; org-self-insert-command
>
> The last SPC breaks the emphasis around the middle "test", which it did 
> not previously.  Previously, the SPC would just move the whole 
> emphasized word one space to the right.  Which I somehow got used to, 
> and probably many others as well.

OMG. What we had in the past is because of an obscure internal,
undocumented implementation detail of how Emacs adjusts point when it
ends up inside invisible region:

          /* If the preceding character is both intangible and invisible,
             and the invisible property is `rear-sticky', perturb it so
             that the search starts one character earlier -- this ensures
             that point can never move to the end of an invisible/
             intangible/rear-sticky region.  */

Except that we do not have intanglible property there and the code below
that comment does not always check for intanglible property.

> OTOH, to fix my bug, only the first of the new `org-rear-nonsticky-at' 
> calls is actually needed.  So probably we could have something like the 
> following to get my bug fixed without any changes in behavior (diff on 
> top of main, that is, in addition to your commit):

I am not sure if it is a proper fix. The basic problem is that Org's
syntax table does not declare emphasis markup as part of a word.

I need to consult Emacs devs about rules of point adjustment.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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