From 261eadb9d4959c8321d9ab1eb58f1d48b8870639 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 17 Mar 2016 16:50:54 +0100 Subject: [PATCH] Fix indentation bug * lisp/org.el (org--get-expected-indentation): Fix indentation. * testing/lisp/test-org.el (test-org/indent-line): Add test. --- lisp/org.el | 6 +----- testing/lisp/test-org.el | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 2b83aadea..5d6ad6dd9 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -23009,11 +23009,7 @@ ELEMENT." (let ((cend (org-element-property :contents-end element))) (and cend (<= cend pos)))) (if (memq type '(footnote-definition item plain-list)) - (let ((last (org-element-at-point))) - (org--get-expected-indentation - last - (memq (org-element-type last) - '(footnote-definition item plain-list)))) + (org--get-expected-indentation (org-element-at-point) nil) (goto-char start) (org-get-indentation))) ;; In any other case, indent like the current line. diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index ffdd1b359..d64da2a04 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -656,6 +656,11 @@ (goto-char (point-max)) (let ((org-adapt-indentation t)) (org-indent-line)) (org-get-indentation)))) + (should + (= 2 + (org-test-with-temp-text "- A\n B\n\n" + (let ((org-adapt-indentation nil)) (org-indent-line)) + (org-get-indentation)))) ;; Likewise, on a blank line at the end of a footnote definition, ;; indent at column 0 if line belongs to the definition. Otherwise, ;; indent like the definition itself.