From e2c1dc3955eb54cee7ce137d548c687e378f4c8a Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Tue, 18 Oct 2022 12:07:37 +0800 Subject: [PATCH] org-export--get-subtree-options: Do not jump to parent subtree * lisp/ox.el: Never jump to parent heading even when point is at an existing heading. * testing/lisp/test-ox.el (test-org-export/get-subtree-options): Fix test assuming that current subtree may include parent. Reported-by: Kaushal Modi Link: https://orgmode.org/list/CAFyQvY3mxi4DRTS+W-AX7bFELVujqH4DODEYPy3hyGRRuMEPSw@mail.gmail.com --- lisp/ox.el | 2 +- testing/lisp/test-ox.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index 92f6010a0..9f44ec3ef 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -1434,7 +1434,7 @@ (defun org-export--get-subtree-options (&optional backend) ;; property is the keyword with "EXPORT_" appended to it. (org-with-wide-buffer ;; Make sure point is at a heading. - (if (org-at-heading-p) (org-up-heading-safe) (org-back-to-heading t)) + (org-back-to-heading t) (let ((plist ;; EXPORT_OPTIONS are parsed in a non-standard way. Take ;; care of them right from the start. diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index 42867919b..0d39160b6 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -388,7 +388,7 @@ (ert-deftest test-org-export/get-subtree-options () (plist-get (org-export-get-environment nil t) :date)))) ;; Still grab correct options when section above is empty. (should - (equal '("H1") + (equal '("H12") (org-test-with-temp-text "* H1\n** H11\n** H12" (plist-get (org-export-get-environment nil t) :title)))) ;; More than one property can refer to the same node property. -- 2.35.1