summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2014-04-17 08:41:14 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2014-04-17 11:30:15 +0200
commit1ca819e398dea3a7bbdada7bd6402b3d8c8a2d86 (patch)
tree3256d7767bbdbcaec5c46b996353f55bf80b89b5
parent73c141e43ed1ab746d7f841478550fe4df85f432 (diff)
downloadorg-mode-1ca819e398dea3a7bbdada7bd6402b3d8c8a2d86.tar.gz
Revert "Make Org links compatible with URI syntax"
This reverts commit 3589f64e42dfbc894e789c2a9fba530eac36c665.
-rw-r--r--lisp/org.el43
-rw-r--r--testing/lisp/test-org-element.el6
2 files changed, 28 insertions, 21 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 3c7afd2..b59c8e8 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5594,29 +5594,34 @@ stacked delimiters is N. Escaping delimiters is not possible."
"Update the link regular expressions.
This should be called after the variable `org-link-types' has changed."
(setq org-link-types-re
- (concat "\\`" (regexp-opt org-link-types t) ":\\(?://\\)")
+ (concat
+ "\\`\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):")
org-link-re-with-space
- (concat "<?" (regexp-opt org-link-types t) ":\\(?://\\)"
- "\\([^" org-non-link-chars " ]"
- "[^" org-non-link-chars "]*"
- "[^" org-non-link-chars " ]\\)>?")
+ (concat
+ "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
+ "\\([^" org-non-link-chars " ]"
+ "[^" org-non-link-chars "]*"
+ "[^" org-non-link-chars " ]\\)>?")
org-link-re-with-space2
- (concat "<?" (regexp-opt org-link-types t) ":\\(?://\\)?"
- "\\([^" org-non-link-chars " ]"
- "[^\t\n\r]*"
- "[^" org-non-link-chars " ]\\)>?")
+ (concat
+ "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
+ "\\([^" org-non-link-chars " ]"
+ "[^\t\n\r]*"
+ "[^" org-non-link-chars " ]\\)>?")
org-link-re-with-space3
- (concat "<?" (regexp-opt org-link-types t) ":\\(?://\\)?"
- "\\([^" org-non-link-chars " ]"
- "[^\t\n\r]*\\)")
+ (concat
+ "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
+ "\\([^" org-non-link-chars " ]"
+ "[^\t\n\r]*\\)")
org-angle-link-re
- (concat "<" (regexp-opt org-link-types t) ":\\(?://\\)?"
- "\\([^" org-non-link-chars " ]"
- "[^" org-non-link-chars "]*"
- "\\)>")
+ (concat
+ "<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
+ "\\([^" org-non-link-chars " ]"
+ "[^" org-non-link-chars "]*"
+ "\\)>")
org-plain-link-re
(concat
- "\\<" (regexp-opt org-link-types t) ":\\(?://\\)?"
+ "\\<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
(org-re "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)"))
;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
org-bracket-link-regexp
@@ -5624,7 +5629,7 @@ This should be called after the variable `org-link-types' has changed."
org-bracket-link-analytic-regexp
(concat
"\\[\\["
- "\\(" (regexp-opt org-link-types t) ":\\(?://\\)?\\)?"
+ "\\(\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):\\)?"
"\\([^]]+\\)"
"\\]"
"\\(\\[" "\\([^]]+\\)" "\\]\\)?"
@@ -5632,7 +5637,7 @@ This should be called after the variable `org-link-types' has changed."
org-bracket-link-analytic-regexp++
(concat
"\\[\\["
- "\\(" (regexp-opt (cons "coderef" org-link-types) t) ":\\(?://\\)?\\)?"
+ "\\(\\(" (mapconcat 'regexp-quote (cons "coderef" org-link-types) "\\|") "\\):\\)?"
"\\([^]]+\\)"
"\\]"
"\\(\\[" "\\([^]]+\\)" "\\]\\)?"
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index fb5e9d4..e131f92 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -1332,10 +1332,12 @@ e^{i\\pi}+1=0
;; ... with expansion.
(should
(equal
- "orgmode.org/worg"
+ "//orgmode.org/worg"
(org-test-with-temp-text "[[Org:worg]]"
(let ((org-link-abbrev-alist '(("Org" . "http://orgmode.org/"))))
- (org-element-property :path (org-element-context))))))
+ (org-element-property
+ :path
+ (org-element-map (org-element-parse-buffer) 'link 'identity nil t))))))
;; ... with translation.
(should
(equal