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>
This commit is contained in:
Nicolas Goaziou 2018-01-18 23:40:55 +01:00
parent daceceb424
commit bdc220ca17
1 changed files with 15 additions and 19 deletions

View File

@ -1260,25 +1260,21 @@ the file including them will be republished as well."
(with-current-buffer buf (with-current-buffer buf
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t) (while (re-search-forward "^[ \t]*#\\+INCLUDE:" nil t)
(let* ((element (org-element-at-point)) (let ((element (org-element-at-point)))
(included-file (when (eq 'keyword (org-element-type element))
(and (eq (org-element-type element) 'keyword) (let* ((value (org-element-property :value element))
(let ((value (org-element-property :value element))) (filename
(and value (and (string-match "\\`\\(\".+?\"\\|\\S-+\\)" value)
(string-match (let ((m (org-unbracket-string
"\\`\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)" "\"" "\"" (match-string 1 value))))
value) ;; Ignore search suffix.
(let ((m (match-string 1 value))) (if (string-match "::.*?\\'" m)
(org-unbracket-string (substring m 0 (match-beginning 0))
"\"" "\"" m)))))
;; Ignore search suffix. (when filename
(if (string-match "::.*?\"?\\'" m) (push (org-publish-cache-ctime-of-src
(substring m 0 (match-beginning 0)) (expand-file-name filename))
m)))))))) included-files-ctime)))))))
(when included-file
(push (org-publish-cache-ctime-of-src
(expand-file-name included-file))
included-files-ctime)))))
(unless visiting (kill-buffer buf))))) (unless visiting (kill-buffer buf)))))
(or (null pstamp) (or (null pstamp)
(let ((ctime (org-publish-cache-ctime-of-src filename))) (let ((ctime (org-publish-cache-ctime-of-src filename)))