From c20402fd145fcdd01490fbdb35d074c5ded101e8 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 22 Feb 2012 19:29:05 +0100 Subject: [PATCH] org-export: Fix export to subtree * contrib/lisp/org-export.el (org-export-as): Subtree option was ignored. Also, narrowing to region and to subtree are exclusive. --- contrib/lisp/org-export.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/contrib/lisp/org-export.el b/contrib/lisp/org-export.el index 5e44a2fe7..697a56988 100644 --- a/contrib/lisp/org-export.el +++ b/contrib/lisp/org-export.el @@ -2065,11 +2065,9 @@ Return code as a string." (save-excursion (save-restriction ;; Narrow buffer to an appropriate region for parsing. - (when (org-region-active-p) - (narrow-to-region (region-beginning) (region-end))) - (when (and subtreep (not (org-at-heading-p))) - ;; Ensure point is at sub-tree's beginning. - (org-narrow-to-subtree)) + (cond ((org-region-active-p) + (narrow-to-region (region-beginning) (region-end))) + (subtreep (org-narrow-to-subtree))) ;; Retrieve export options (INFO) and parsed tree (RAW-DATA), ;; Then options can be completed with tree properties. Note: ;; Buffer isn't parsed directly. Instead, a temporary copy is -- 2.11.4.GIT