diff options
author | David Maus <dmaus@ictsoc.de> | 2011-12-18 19:23:57 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-12-20 23:53:39 +0100 |
commit | bcfe9cd5d03dee6cb4c9ac0f0b1c1b6a58b9be14 (patch) | |
tree | e96c5456c37024e277aa9cc37f209c3b6271150c | |
parent | 6783f131094fe426911643572f12adc0677006e2 (diff) | |
download | org-mode-bcfe9cd5d03dee6cb4c9ac0f0b1c1b6a58b9be14.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.el | 13 |
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))) |