From bebb7597a79df0c1d93cafcc6cccfacddd40d6be Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 25 Mar 2014 10:05:27 +0100 Subject: [PATCH 1/4] ox-publish: Fix small bug * lisp/ox-publish.el (org-publish-cache-file-needs-publishing): Correctly extract filename. This bug was introduced in 6062f9ea72732067036d9d959f1627ece0a9056e. Thanks to steckerhalter for reporting it. --- lisp/ox-publish.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index ad8eb329d..bad8138a8 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -1169,7 +1169,9 @@ the file including them will be republished as well." (let* ((element (org-element-at-point)) (included-file (and (eq (org-element-type element) 'keyword) - (org-string-nw-p (org-element-property :value element))))) + (string-match "^\\(\".+?\"\\|\\S-+\\)" + (org-element-property :value element)) + (org-match-string-no-properties (match-string 1))))) (when included-file (add-to-list 'included-files-ctime (org-publish-cache-ctime-of-src From 1c1936fbb1f0c42e5c7e1d3c903626aa5993a357 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 25 Mar 2014 10:15:25 +0100 Subject: [PATCH 2/4] Allow radio links after an apostrophe and mid-word * lisp/org.el (org-make-target-link-regexp): Allow radio links after an apostrophe and mid-word. Small refactoring. * testing/lisp/test-ox.el (test-org-export/resolve-radio-link): Add test. See http://permalink.gmane.org/gmane.emacs.orgmode/84108. --- lisp/org.el | 18 +++++++----------- testing/lisp/test-ox.el | 9 +++++++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ef0bc3f24..a1b9b0bdf 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6179,17 +6179,13 @@ targets." The regular expression finds the targets also if there is a line break between words." (and targets - (concat - "\\_<\\(" - (mapconcat - (lambda (x) - (setq x (regexp-quote x)) - (while (string-match " +" x) - (setq x (replace-match "\\s-+" t t x))) - x) - targets - "\\|") - "\\)\\_>"))) + (concat "\\(" + (mapconcat + (lambda (x) + (replace-regexp-in-string " +" "\\s-+" (regexp-quote x) t t)) + targets + "\\|") + "\\)"))) (defun org-activate-tags (limit) (if (re-search-forward (org-re "^\\*+.*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \r\n]") limit t) diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index b0778ff8b..fe20496a1 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -2042,6 +2042,15 @@ Another text. (ref:text) (org-export-resolve-radio-link (org-element-map tree 'link 'identity info t) info)))) + ;; Radio link next to an apostrophe. + (should + (org-test-with-temp-text "<<>> radio's" + (org-update-radio-target-regexp) + (let* ((tree (org-element-parse-buffer)) + (info `(:parse-tree ,tree))) + (org-export-resolve-radio-link + (org-element-map tree 'link 'identity info t) + info)))) ;; Multiple radio targets. (should (equal '("radio1" "radio2") From 317d2f1898ffaca15b3095cd736bfd5beb8fd70e Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 25 Mar 2014 10:38:48 +0100 Subject: [PATCH 3/4] ox-publish: Fix code typo * lisp/ox-publish.el (org-publish-cache-file-needs-publishing): Fix code typo. --- lisp/ox-publish.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index bad8138a8..f9d19080e 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -1171,7 +1171,7 @@ the file including them will be republished as well." (and (eq (org-element-type element) 'keyword) (string-match "^\\(\".+?\"\\|\\S-+\\)" (org-element-property :value element)) - (org-match-string-no-properties (match-string 1))))) + (match-string 1)))) (when included-file (add-to-list 'included-files-ctime (org-publish-cache-ctime-of-src From b982b57cb1ad35aabde5698c31806db5d93240dc Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 25 Mar 2014 10:46:34 +0100 Subject: [PATCH 4/4] ox-publish: Fix code typo (part 2) * lisp/ox-publish.el (org-publish-cache-file-needs-publishing): Fix code typo. --- lisp/ox-publish.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index f9d19080e..f60678e8d 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -1171,7 +1171,7 @@ the file including them will be republished as well." (and (eq (org-element-type element) 'keyword) (string-match "^\\(\".+?\"\\|\\S-+\\)" (org-element-property :value element)) - (match-string 1)))) + (org-remove-double-quotes (match-string 1))))) (when included-file (add-to-list 'included-files-ctime (org-publish-cache-ctime-of-src