Sébastien Miquel <sebastien.miq...@posteo.eu> writes:

> +         ;; Trim contents: `org-src--contents-for-write-back' may have
> +         ;; added indentation at the beginning, which we remove.

May you also mention that we remove the indentation to avoid adding
spaces to latex fragments in the middle of a paragraph?

>>> +          (when (or (not (eolp)) ; not an empty line
>>> +                    ;; If the current line is empty, we may
>>> +                    ;; want to indent it.
>>> +                    (and (eq (point) (marker-position marker))
>>>                            preserve-blank-line))
>> Do we still need this dance with special case for current line?
>
> Yes. This is fragile, but what it does is, if the line from which the
> original edit was called was blank and not empty, and the line from
> which the edit is ended is empty, we assume these two lines are the
> same, and we add the common block indentation to this empty line.
> This, and the pre-indentation in =org-indent-line=, make `TAB` work
> to indent an empty line.

But why do we need to avoid indenting empty lines?

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