[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] Source block indentation does not work properly for yaml-mode
From: |
Ihor Radchenko |
Subject: |
Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)] |
Date: |
Fri, 30 Jun 2023 11:43:26 +0000 |
Sébastien Miquel <sebastien.miquel@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>
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], (continued)
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Sébastien Miquel, 2023/06/21
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Ihor Radchenko, 2023/06/25
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Sébastien Miquel, 2023/06/26
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Sébastien Miquel, 2023/06/26
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Ihor Radchenko, 2023/06/26
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Sébastien Miquel, 2023/06/26
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Ihor Radchenko, 2023/06/26
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Sébastien Miquel, 2023/06/27
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Ihor Radchenko, 2023/06/28
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Sébastien Miquel, 2023/06/29
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)],
Ihor Radchenko <=
- Re: [BUG] Source block indentation does not work properly for yaml-mode [9.6.6 ( @ /home/user/.emacs.d/elpa/org-9.6.6/)], Sébastien Miquel, 2023/06/30