Kaushal Modi writes: > Today I was debugging something where a subtree export wasn't recognizing > the EXPORT_OPTIONS property set in that subtree. > > MWE: > > ===== > * Top level > ** Allow broken links, but mark them > :PROPERTIES: > :EXPORT_FILE_NAME: allow-broken-links-but-mark-them > :EXPORT_OPTIONS: broken-links:mark > :END: > ===== > > 1. Move cursor to BOL of "** Allow broken links, but mark them" line. > 2. M-: (org-export--get-subtree-options) > > Output: > > (:title (#("Top level" 0 9 (:parent #1)))) > > Issue: Point is already on a heading, but it is jumping to the parent > heading and returning that heading's properties. > > Debugging through how the export options got parsed in subtree exports, I > reached the `org-export--get-subtree-options' function and this line in > there: > > ;; > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/ox.el#n1425 > (if (org-at-heading-p) (org-up-heading-safe) (org-back-to-heading t)) > > It looks like the if condition actions are swapped here. Not really swapped. A simple (org-back-to-heading t) will probably be enough. See the attached patch. However, I am concerned that one of the tests is actually assuming that current subtree in the below example includes "Heading". * Heading ** Child ** Child