diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2020-06-05 14:06:35 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2020-06-05 14:06:35 +0200 |
commit | b4e379846e5738d36860a6ab002b009a9a68f4d2 (patch) | |
tree | b84fb2e1e0a24e6d2432f21d001b722a039dbe07 | |
parent | c7a86a43ae1f3aba0f3f1c20196cfdb8c9ddd891 (diff) | |
download | org-mode-b4e379846e5738d36860a6ab002b009a9a68f4d2.tar.gz |
Do not insert unwanted TAB characters in some places
* lisp/org.el (org-indent-line): Do not return `noindent'.
Returning `noindent' is not synonymous to "no indentation change
needed". In particular, `noindent' triggers insertion of
TAB-character, ignoring `tab-always-indent' value.
-rw-r--r-- | lisp/org.el | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lisp/org.el b/lisp/org.el index c388224..c04bbd6 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18900,29 +18900,28 @@ list structure. Instead, use \\<org-mode-map>`\\[org-shiftmetaleft]' or \ Also align node properties according to `org-property-format'." (interactive) - (if (org-at-heading-p) 'noindent + (unless (org-at-heading-p) (let* ((element (save-excursion (beginning-of-line) (org-element-at-point))) (type (org-element-type element))) (cond ((and (memq type '(plain-list item)) (= (line-beginning-position) (org-element-property :post-affiliated element))) - 'noindent) + nil) ((and (eq type 'latex-environment) (>= (point) (org-element-property :post-affiliated element)) - (< (point) (org-with-wide-buffer - (goto-char (org-element-property :end element)) - (skip-chars-backward " \r\t\n") - (line-beginning-position 2)))) - 'noindent) + (< (point) + (org-with-point-at (org-element-property :end element) + (skip-chars-backward " \t\n") + (line-beginning-position 2)))) + nil) ((and (eq type 'src-block) org-src-tab-acts-natively (> (line-beginning-position) (org-element-property :post-affiliated element)) (< (line-beginning-position) - (org-with-wide-buffer - (goto-char (org-element-property :end element)) - (skip-chars-backward " \r\t\n") - (line-beginning-position)))) + (org-with-point-at (org-element-property :end element) + (skip-chars-backward " \t\n") + (line-beginning-position)))) (org-babel-do-key-sequence-in-edit-buffer (kbd "TAB"))) (t (let ((column (org--get-expected-indentation element nil))) |