org-export-as: Fix edge case during subtree export

* lisp/ox.el (org-export-as): Make sure that narrowing includes top
heading in a subtree when subtree export is requested.  This is needed
after 927621910 changed `org-export--get-subtree-options' behavior.

Reported-by: Alejandro Pérez Carballo <apc@umass.edu>
Link: https://orgmode.org/list/m2sfhpffui.fsf@umass.edu
This commit is contained in:
Ihor Radchenko 2022-12-10 12:43:19 +03:00
parent aba51fb584
commit 0616b3c375
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 5 additions and 0 deletions

View File

@ -3036,6 +3036,11 @@ Return code as a string."
(org-narrow-to-subtree)
(goto-char (point-min))
(org-end-of-meta-data)
;; Make the region include top heading in the subtree.
;; This way, we will be able to retrieve its export
;; options when calling
;; `org-export--get-subtree-options'.
(backward-char)
(narrow-to-region (point) (point-max))))
;; Initialize communication channel with original buffer
;; attributes, unavailable in its copy.