summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-01-18 23:40:55 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-01-18 23:40:55 +0100
commitbdc220ca17d0710e8f0a82a16aeae3a416d61f3d (patch)
treed4a4267466b892cc554d8d7721574ac2cee8750d
parentdaceceb424025d8d500df9716f1af925f1aceaba (diff)
downloadorg-mode-bdc220ca17d0710e8f0a82a16aeae3a416d61f3d.tar.gz
ox-publish: Fix including files with a search option
* lisp/ox-publish.el (org-publish-cache-file-needs-publishing): Remove double quotes prior to pruning search options. Reported-by: Joseph Carter Osborn <jcosborn@ucsc.edu> <http://lists.gnu.org/r/emacs-orgmode/2018-01/msg00317.html>
-rw-r--r--lisp/ox-publish.el34
1 files changed, 15 insertions, 19 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 5deb7c5..99e6528 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -1260,25 +1260,21 @@ the file including them will be republished as well."
(with-current-buffer buf
(goto-char (point-min))
(while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
- (let* ((element (org-element-at-point))
- (included-file
- (and (eq (org-element-type element) 'keyword)
- (let ((value (org-element-property :value element)))
- (and value
- (string-match
- "\\`\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)"
- value)
- (let ((m (match-string 1 value)))
- (org-unbracket-string
- "\"" "\""
- ;; Ignore search suffix.
- (if (string-match "::.*?\"?\\'" m)
- (substring m 0 (match-beginning 0))
- m))))))))
- (when included-file
- (push (org-publish-cache-ctime-of-src
- (expand-file-name included-file))
- included-files-ctime)))))
+ (let ((element (org-element-at-point)))
+ (when (eq 'keyword (org-element-type element))
+ (let* ((value (org-element-property :value element))
+ (filename
+ (and (string-match "\\`\\(\".+?\"\\|\\S-+\\)" value)
+ (let ((m (org-unbracket-string
+ "\"" "\"" (match-string 1 value))))
+ ;; Ignore search suffix.
+ (if (string-match "::.*?\\'" m)
+ (substring m 0 (match-beginning 0))
+ m)))))
+ (when filename
+ (push (org-publish-cache-ctime-of-src
+ (expand-file-name filename))
+ included-files-ctime)))))))
(unless visiting (kill-buffer buf)))))
(or (null pstamp)
(let ((ctime (org-publish-cache-ctime-of-src filename)))