summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2014-10-03 22:00:32 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2014-10-28 14:23:52 +0100
commit1c34ec85b0f9fc9034b4d72f2e8d9bd030427772 (patch)
tree1d2152be964e3c09f62de8488ad29c5727ea3ec6
parent1ff01cc07a37523dd899e57db39ab90b325709ce (diff)
downloadorg-mode-1c34ec85b0f9fc9034b4d72f2e8d9bd030427772.tar.gz
ox: Update INCLUDE keywords wrt property drawers
* lisp/ox.el (org-export--inclusion-absolute-lines): Fix comment. (org-export--prepare-file-contents): Do not look for property drawers after a drawer, since this is impossible. * testing/examples/include.org: Fix test data.
-rw-r--r--lisp/ox.el21
-rw-r--r--testing/examples/include.org6
2 files changed, 5 insertions, 22 deletions
diff --git a/lisp/ox.el b/lisp/ox.el
index f018497..19b99b7 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3195,10 +3195,7 @@ Return a string of lines to be included in the format expected by
(org-element-property (if contents-begin :contents-end :end) element))
(when (and only-contents
(memq (org-element-type element) '(headline inlinetask)))
- ;; Skip planning line and property-drawer. If a normal drawer
- ;; precedes a property-drawer both will be included.
- ;; Remaining property-drawers are removed as needed in
- ;; `org-export--prepare-file-contents'.
+ ;; Skip planning line and property-drawer.
(goto-char (point-min))
(when (org-looking-at-p org-planning-line-re) (forward-line))
(when (looking-at org-property-drawer-re) (goto-char (match-end 0)))
@@ -3277,20 +3274,6 @@ with footnotes is included in a document."
(skip-chars-backward " \r\t\n")
(forward-line)
(delete-region (point) (point-max))
- ;; Remove property-drawers after drawers.
- (when (or ind minlevel)
- (unless (eq major-mode 'org-mode)
- (let ((org-inhibit-startup t)) (org-mode)))
- (goto-char (point-min))
- (when (looking-at org-drawer-regexp)
- (goto-char (match-end 0))
- (search-forward-regexp org-drawer-regexp)
- (forward-line 1)
- (beginning-of-line))
- (when (looking-at org-property-drawer-re)
- (delete-region (match-beginning 0) (match-end 0))
- (beginning-of-line))
- (delete-region (point) (save-excursion (and (org-skip-whitespace) (point)))))
;; If IND is set, preserve indentation of include keyword until
;; the first headline encountered.
(when ind
@@ -3322,7 +3305,7 @@ with footnotes is included in a document."
;; sections.
(org-map-entries
(lambda () (if (< offset 0) (delete-char (abs offset))
- (insert (make-string offset ?*)))))))))))
+ (insert (make-string offset ?*)))))))))))
;; Append ID to all footnote references and definitions, so they
;; become file specific and cannot collide with footnotes in other
;; included files.
diff --git a/testing/examples/include.org b/testing/examples/include.org
index c04c942..f4dcc20 100644
--- a/testing/examples/include.org
+++ b/testing/examples/include.org
@@ -26,10 +26,10 @@ body
| 1 |
* drawer-headline
-:LOGBOOK:
-drawer
-:END:
:PROPERTIES:
:CUSTOM_ID: dh
:END:
+:LOGBOOK:
+drawer
+:END:
content