diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-02-04 12:39:31 +0100 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-02-04 12:39:31 +0100 |
commit | c8d9f1438fa5ac4762db4b29cd349908be189823 (patch) | |
tree | cfaaac73e1aeaba2d8e5db64fcec72397c45b88c | |
parent | 42c96c4c2636d010e2a33e4ea26e943212107f72 (diff) | |
download | org-mode-c8d9f1438fa5ac4762db4b29cd349908be189823.tar.gz |
Fix bugs related to includes files in new export system
-rw-r--r-- | contrib/lisp/org-element.el | 10 | ||||
-rw-r--r-- | contrib/lisp/org-export.el | 16 |
2 files changed, 14 insertions, 12 deletions
diff --git a/contrib/lisp/org-element.el b/contrib/lisp/org-element.el index 73687e8..9f9f9da 100644 --- a/contrib/lisp/org-element.el +++ b/contrib/lisp/org-element.el @@ -3038,10 +3038,12 @@ Nil values returned from FUN are ignored in the result." ;; included file becomes a direct child of ;; the current headline in the buffer. :headline-offset - ,(- (+ (plist-get - (plist-get --local :inherited-properties) - :level) - (or (plist-get --local :headline-offset) 0)) + ,(- (let ((parent + (org-export-get-parent-headline + --blob --local))) + (if (not parent) 0 + (org-export-get-relative-level + parent --local))) (1- (org-export-get-min-level --data --local)))))))) ;; Limiting recursion to greater elements, and --BLOB diff --git a/contrib/lisp/org-export.el b/contrib/lisp/org-export.el index 9483472..974ec60 100644 --- a/contrib/lisp/org-export.el +++ b/contrib/lisp/org-export.el @@ -2267,17 +2267,17 @@ Return the transcoded string." data backend (org-combine-plists info - ;; Store full path of already included files to avoid - ;; recursive file inclusion. + ;; Store full path of already included files to avoid recursive + ;; file inclusion. `(:included-files ,(cons (expand-file-name file) (plist-get info :included-files)) - ;; Ensure that a top-level headline in the included - ;; file becomes a direct child of the current headline - ;; in the buffer. + ;; Ensure that a top-level headline in the included file + ;; becomes a direct child of the current headline in the + ;; buffer. :headline-offset - ,(- (+ (org-element-get-property - :level (org-export-get-parent-headline keyword info)) - (plist-get info :headline-offset)) + ,(- (let ((parent (org-export-get-parent-headline keyword info))) + (if (not parent) 0 + (org-export-get-relative-level parent info))) (1- (org-export-get-min-level data info))))))))) (defun org-export-get-file-contents (file &optional lines) |