mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-12 06:39:54 +00:00
Hyperlink: Use url-encode-url for browse-url
* lisp/org.el (org-open-at-point): When available (Emacs 24.3.1) use `url-encode-url' instead of `org-link-escape-browser'.
This commit is contained in:
parent
36c8d8b4d2
commit
971a3a4e48
24
lisp/org.el
24
lisp/org.el
|
@ -10520,11 +10520,29 @@ application the system uses for this file type."
|
||||||
(apply cmd (nreverse args1))))
|
(apply cmd (nreverse args1))))
|
||||||
|
|
||||||
((member type '("http" "https" "ftp" "news"))
|
((member type '("http" "https" "ftp" "news"))
|
||||||
(browse-url (concat type ":" (org-link-escape-browser path))))
|
;; In the example of the http Org link
|
||||||
|
;; [[http://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode&query=%252Bsubject:"Release+8.2"]]
|
||||||
|
;; to open a browser with +subject:"Release 8.2" in the
|
||||||
|
;; query field the variable `path' contains
|
||||||
|
;; [...]=%2Bsubject:"Release+8.2", `url-encode-url'
|
||||||
|
;; converts correct to [...]=%2Bsubject:%22Release+8.2%22
|
||||||
|
;; and `org-link-escape-browser' converts wrong to
|
||||||
|
;; [...]=%252Bsubject:%22Release+8.2%22.
|
||||||
|
;;
|
||||||
|
;; `url-encode-url' is available since Emacs 24.3.1 and
|
||||||
|
;; `org-link-escape-browser' can be removed altogether
|
||||||
|
;; once Org drops support for Emacs 24.1 and 24.2.
|
||||||
|
(browse-url (funcall (if (fboundp 'url-encode-url)
|
||||||
|
#'url-encode-url
|
||||||
|
#'org-link-escape-browser)
|
||||||
|
(concat type ":" path))))
|
||||||
|
|
||||||
((string= type "doi")
|
((string= type "doi")
|
||||||
(browse-url (concat org-doi-server-url
|
;; See comments for type http above
|
||||||
(org-link-escape-browser path))))
|
(browse-url (funcall (if (fboundp 'url-encode-url)
|
||||||
|
#'url-encode-url
|
||||||
|
#'org-link-escape-browser)
|
||||||
|
(concat org-doi-server-url path))))
|
||||||
|
|
||||||
((member type '("message"))
|
((member type '("message"))
|
||||||
(browse-url (concat type ":" path)))
|
(browse-url (concat type ":" path)))
|
||||||
|
|
Loading…
Reference in a new issue