summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2014-03-12 19:54:24 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2014-03-12 21:30:13 +0100
commit6062f9ea72732067036d9d959f1627ece0a9056e (patch)
treeefab720dd421dce2edc1c3c2e511119e4c94a261
parent07158efa53d9e5113cc433b583f41ccd06eb70d7 (diff)
downloadorg-mode-6062f9ea72732067036d9d959f1627ece0a9056e.tar.gz
ox-publish: Fix small bug
* lisp/ox-publish.el (org-publish-cache-file-needs-publishing): Find included file even if keyword is indented.
-rw-r--r--lisp/ox-publish.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 9669bf0..ad8eb32 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -1161,22 +1161,26 @@ the file including them will be republished as well."
(org-inhibit-startup t)
(visiting (find-buffer-visiting filename))
included-files-ctime buf)
-
(when (equal (file-name-extension filename) "org")
(setq buf (find-file (expand-file-name filename)))
(with-current-buffer buf
(goto-char (point-min))
- (while (re-search-forward
- "^#\\+INCLUDE:[ \t]+\"\\([^\t\n\r\"]*\\)\"[ \t]*.*$" nil t)
- (let* ((included-file (expand-file-name (match-string 1))))
- (add-to-list 'included-files-ctime
- (org-publish-cache-ctime-of-src included-file) t))))
+ (while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
+ (let* ((element (org-element-at-point))
+ (included-file
+ (and (eq (org-element-type element) 'keyword)
+ (org-string-nw-p (org-element-property :value element)))))
+ (when included-file
+ (add-to-list 'included-files-ctime
+ (org-publish-cache-ctime-of-src
+ (expand-file-name included-file))
+ t)))))
(unless visiting (kill-buffer buf)))
(if (null pstamp) t
(let ((ctime (org-publish-cache-ctime-of-src filename)))
(or (< pstamp ctime)
(when included-files-ctime
- (not (null (delq nil (mapcar (lambda(ct) (< ctime ct))
+ (not (null (delq nil (mapcar (lambda (ct) (< ctime ct))
included-files-ctime))))))))))
(defun org-publish-cache-set-file-property