[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 5f4fd08 1/5: org--get-expected-indentation: Conside
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 5f4fd08 1/5: org--get-expected-indentation: Consider section parent type |
Date: |
Mon, 25 Oct 2021 09:57:30 -0400 (EDT) |
branch: externals/org
commit 5f4fd0880a47baa062adc669dd71b5c3bb917081
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org--get-expected-indentation: Consider section parent type
* lisp/org.el (org--get-expected-indentation): Consider new :parent
structure when `org-element-at-point' returns parent section and
headline elements.
* testing/lisp/test-org.el (test-org/indent-region): Add test.
Fixes https://list.orgmode.org/87pmrupu0s.fsf@gmail.com/T/#t
---
lisp/org.el | 4 ++++
testing/lisp/test-org.el | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/lisp/org.el b/lisp/org.el
index 0a83c00..90804d2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19218,6 +19218,10 @@ ELEMENT."
(contentsp
(cl-case type
((diary-sexp footnote-definition) 0)
+ (section
+ (org--get-expected-indentation
+ (org-element-property :parent element)
+ t))
((headline inlinetask nil)
(if (not org-adapt-indentation) 0
(let ((level (org-current-level)))
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 47a5f56..5838b19 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -1168,6 +1168,13 @@
(org-adapt-indentation nil))
(org-indent-region (point) (point-max)))
(buffer-string))))
+ ;; Indent property drawers according to `org-adapt-indentation'.
+ (let ((org-adapt-indentation 'headline-data))
+ (should
+ (equal "* H\n :PROPERTIES:\n :key:\n :END:"
+ (org-test-with-temp-text "* H\n:PROPERTIES:\n:key:\n:END:"
+ (org-indent-region (point-min) (point-max))
+ (buffer-string)))))
;; Indent plain lists.
(let ((org-adapt-indentation t))
(should