summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-12-31 00:29:52 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-12-31 00:29:52 +0100
commit51194312e4b79ce5dc069fb8cf934c9810bfe2b0 (patch)
tree4658c4a81fd039be481ab2c79aa391b98b25b839
parent800ce62ad240b1e18e57af0c546f3826c5e5b6e6 (diff)
parent0c14fa649950b905be42c46e751e42633442b9cb (diff)
downloadorg-mode-51194312e4b79ce5dc069fb8cf934c9810bfe2b0.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/ox-publish.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index b49b9d3..5399517 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -1240,14 +1240,18 @@ the file including them will be republished as well."
(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-+\\)" value)
- ;; Ignore search suffix.
- (car (split-string
- (org-remove-double-quotes
- (match-string 1 value)))))))))
+ (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-remove-double-quotes
+ ;; 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))