summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-07-01 11:58:23 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-07-01 12:00:23 +0200
commitadcaf91648c1af347be28af5372df607808fe49d (patch)
tree2e178ac295209917d1df1ada54c55492605b4114
parent86e592cb66f9ab7628ccaf21cb93223c1d0cf67e (diff)
downloadorg-mode-adcaf91648c1af347be28af5372df607808fe49d.tar.gz
Mark `org-link-escape-browser' as obsolete
* lisp/org-compat.el (org-link-escape-browser): Make function an alias for `url-encode-url'. * lisp/org.el (org-link-escape-chars-browser): Remove variable. (org-link-escape-browser): Remove function. (org-open-at-point): * lisp/ox-html.el (org-html-link): Use `url-encode-url'. * testing/lisp/test-org.el(test-org/org-link-escape-chars-browser): Remove test.
-rw-r--r--lisp/org-compat.el1
-rw-r--r--lisp/org.el37
-rw-r--r--lisp/ox-html.el3
-rw-r--r--testing/lisp/test-org.el13
4 files changed, 4 insertions, 50 deletions
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 2758b31..92fdb1c 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -93,6 +93,7 @@
(define-obsolete-function-alias 'org-char-to-string 'char-to-string "Org 9.0")
(define-obsolete-function-alias 'org-delete-directory 'delete-directory "Org 9.0")
(define-obsolete-function-alias 'org-format-seconds 'format-seconds "Org 9.0")
+(define-obsolete-function-alias 'org-link-escape-browser 'url-encode-url "Org 9.0")
(define-obsolete-function-alias 'org-no-warnings 'with-no-warnings "Org 9.0")
(define-obsolete-function-alias 'org-number-sequence 'number-sequence "Org 9.0")
(define-obsolete-function-alias 'org-pop-to-buffer-same-window 'pop-to-buffer-same-window "Org 9.0")
diff --git a/lisp/org.el b/lisp/org.el
index 9db5470..2202d41 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10079,15 +10079,6 @@ according to FMT (default from `org-email-link-description-format')."
"List of characters that should be escaped in a link when stored to Org.
This is the list that is used for internal purposes.")
-(defconst org-link-escape-chars-browser
- ;;%20 %22
- '(?\s ?\")
- "List of characters to be escaped before handing over to the browser.
-If you consider using this constant then you probably want to use
-the function `org-link-escape-browser' instead. See there why
-this constant is a candidate to be removed once Org drops support
-for Emacs 24.1 and 24.2.")
-
(defun org-link-escape (text &optional table merge)
"Return percent escaped representation of TEXT.
TEXT is a string with the text to escape.
@@ -10110,29 +10101,6 @@ If optional argument MERGE is set, merge TABLE into
(char-to-string c)))
text "")))
-(defun org-link-escape-browser (text)
- "Escape some characters before handing over to the browser.
-This function is a candidate to be removed together with the
-constant `org-link-escape-chars-browser' once Org drops support
-for Emacs 24.1 and 24.2. All calls to this function will have to
-be replaced with `url-encode-url' which is available since Emacs
-24.3.1."
- ;; Example with the Org link
- ;; [[http://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode&query=%252Bsubject:"Release+8.2"]]
- ;; to open the browser with +subject:"Release 8.2" filled into the
- ;; query field: In this case the variable TEXT contains the
- ;; unescaped [...]=%2Bsubject:"Release+8.2". Then `url-encode-url'
- ;; converts correctly to [...]=%2Bsubject:%22Release+8.2%22 or
- ;; `org-link-escape' with `org-link-escape-chars-browser' converts
- ;; wrongly to [...]=%252Bsubject:%22Release+8.2%22.
- (if (fboundp 'url-encode-url)
- (url-encode-url text)
- (if (org-string-match-p
- (concat "[[:nonascii:]" org-link-escape-chars-browser "]")
- text)
- (org-link-escape text org-link-escape-chars-browser)
- text)))
-
(defun org-link-unescape (str)
"Unhex hexified Unicode parts in string STR.
E.g. `%C3%B6' becomes the german o-Umlaut. This is the
@@ -10776,10 +10744,9 @@ link in a property drawer line."
((boundp f-or-v) (describe-variable f-or-v))
(t (error "Not a known function or variable")))))
((member type '("http" "https" "ftp" "mailto" "news"))
- (browse-url (org-link-escape-browser (concat type ":" path))))
+ (browse-url (url-encode-url (concat type ":" path))))
((equal type "doi")
- (browse-url
- (org-link-escape-browser (concat org-doi-server-url path))))
+ (browse-url (url-encode-url (concat org-doi-server-url path))))
((equal type "message") (browse-url (concat type ":" path)))
((equal type "shell")
(let ((buf (generate-new-buffer "*Org Shell Output*"))
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index a3fdd63..3ec2f79 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2916,8 +2916,7 @@ INFO is a plist holding contextual information. See
(path
(cond
((member type '("http" "https" "ftp" "mailto" "news"))
- (org-link-escape-browser
- (org-link-unescape (concat type ":" raw-path))))
+ (url-encode-url (org-link-unescape (concat type ":" raw-path))))
((string= type "file")
;; Treat links to ".org" files as ".html", if needed.
(setq raw-path
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 4b4cb86..b57d0ac 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -2137,19 +2137,6 @@ http://article.gmane.org/gmane.emacs.orgmode/21459/"
(org-link-unescape
(org-link-escape "http://some.host.com/form?&id=blah%2Bblah25")))))
-(ert-deftest test-org/org-link-escape-chars-browser ()
- "Test of the constant `org-link-escape-chars-browser'.
-See there why this test is a candidate to be removed once Org
-drops support for Emacs 24.1 and 24.2."
- (should
- (string=
- (concat "http://lists.gnu.org/archive/cgi-bin/namazu.cgi?query="
- "%22Release%208.2%22&idxname=emacs-orgmode")
- (org-link-escape-browser ; Do not replace with `url-encode-url',
- ; see docstring above.
- (concat "http://lists.gnu.org/archive/cgi-bin/namazu.cgi?query="
- "\"Release 8.2\"&idxname=emacs-orgmode")))))
-
;;;; Open at point
(ert-deftest test-org/open-at-point-in-keyword ()