summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Maus <dmaus@ictsoc.de>2011-12-18 19:23:57 +0100
committerBastien Guerry <bzg@altern.org>2012-01-03 09:14:08 +0100
commit3305602f746b7a9e1cd8932eda5f9d0a85e75094 (patch)
tree805962592574b0c5fd5311f394ceafb7f4eed81d
parent6f916bc61b803851a5b5948becaf990243da6f76 (diff)
downloadorg-mode-3305602f746b7a9e1cd8932eda5f9d0a85e75094.tar.gz
Escape link path only if path contains space or non-ascii character
* org.el (org-open-at-point): Escape link path for http:, https:, ftp:, news:, and doi: links only if the path contains space or non-ascii character. This should take care of mistakenly double-escaped links as reported by Jeff Horn in <http://article.gmane.org/gmane.emacs.orgmode/48731>. We are just guessing here and push the responsibility for proper escaping to the target application.
-rw-r--r--lisp/org.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 9980d03..7e24367 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9569,13 +9569,16 @@ application the system uses for this file type."
(apply cmd (nreverse args1))))
((member type '("http" "https" "ftp" "news"))
- (browse-url (concat type ":" (org-link-escape
- path org-link-escape-chars-browser))))
+ (browse-url (concat type ":" (if (org-string-match-p "[[:nonascii:] ]" path)
+ (org-link-escape
+ path org-link-escape-chars-browser)
+ path))))
((string= type "doi")
- (browse-url (concat "http://dx.doi.org/"
- (org-link-escape
- path org-link-escape-chars-browser))))
+ (browse-url (concat "http://dx.doi.org/" (if (org-string-match-p "[[:nonascii:] ]" path)
+ (org-link-escape
+ path org-link-escape-chars-browser)
+ path))))
((member type '("message"))
(browse-url (concat type ":" path)))