ox-publish: Fix small bug
* lisp/ox-publish.el (org-publish-cache-file-needs-publishing): Find included file even if keyword is indented.
This commit is contained in:
parent
07158efa53
commit
6062f9ea72
|
@ -1161,22 +1161,26 @@ the file including them will be republished as well."
|
||||||
(org-inhibit-startup t)
|
(org-inhibit-startup t)
|
||||||
(visiting (find-buffer-visiting filename))
|
(visiting (find-buffer-visiting filename))
|
||||||
included-files-ctime buf)
|
included-files-ctime buf)
|
||||||
|
|
||||||
(when (equal (file-name-extension filename) "org")
|
(when (equal (file-name-extension filename) "org")
|
||||||
(setq buf (find-file (expand-file-name filename)))
|
(setq buf (find-file (expand-file-name filename)))
|
||||||
(with-current-buffer buf
|
(with-current-buffer buf
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(while (re-search-forward
|
(while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
|
||||||
"^#\\+INCLUDE:[ \t]+\"\\([^\t\n\r\"]*\\)\"[ \t]*.*$" nil t)
|
(let* ((element (org-element-at-point))
|
||||||
(let* ((included-file (expand-file-name (match-string 1))))
|
(included-file
|
||||||
(add-to-list 'included-files-ctime
|
(and (eq (org-element-type element) 'keyword)
|
||||||
(org-publish-cache-ctime-of-src included-file) t))))
|
(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)))
|
(unless visiting (kill-buffer buf)))
|
||||||
(if (null pstamp) t
|
(if (null pstamp) t
|
||||||
(let ((ctime (org-publish-cache-ctime-of-src filename)))
|
(let ((ctime (org-publish-cache-ctime-of-src filename)))
|
||||||
(or (< pstamp ctime)
|
(or (< pstamp ctime)
|
||||||
(when included-files-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))))))))))
|
included-files-ctime))))))))))
|
||||||
|
|
||||||
(defun org-publish-cache-set-file-property
|
(defun org-publish-cache-set-file-property
|
||||||
|
|
Loading…
Reference in New Issue