diff options
author | aman <aman_yang@163.com> | 2015-12-31 00:26:55 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-12-31 00:27:51 +0100 |
commit | 0c14fa649950b905be42c46e751e42633442b9cb (patch) | |
tree | 82b852e369240fc1c0c7e143cc345270575a560a | |
parent | 6d0af5974479be9b2932d6fe1676381ec11b5da3 (diff) | |
download | org-mode-0c14fa649950b905be42c46e751e42633442b9cb.tar.gz |
org-publish: Fix get `included-file' logic
* lisp/ox-publish.el (org-publish-cache-file-needs-publishing):
According to the syntax of #+INCLUDE statement in *info* page,
there's no space between search option and file path.
TINYCHANGE
-rw-r--r-- | lisp/ox-publish.el | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index 6dbe55f..2ec4137 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -1250,14 +1250,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 (add-to-list 'included-files-ctime (org-publish-cache-ctime-of-src |