summaryrefslogtreecommitdiff
path: root/lisp/url/url-util.el
diff options
context:
space:
mode:
authorHong Xu <hong@topbug.net>2019-10-14 06:46:47 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-14 06:46:47 +0200
commit9aa13cd4beccfe41e8f4930cb029bd60e7788e93 (patch)
tree93968ba332ad4623b8251d081175641f7146c1dc /lisp/url/url-util.el
parent8aeba640460adbad283d4a18f91cce8e0364c40d (diff)
downloademacs-9aa13cd4beccfe41e8f4930cb029bd60e7788e93.tar.gz
Make url-hexify-string accept a list of allowed chars (bug#26469)
* lisp/url/url-util.el (url-hexify-string): Accept a list of allowed chars. * doc/misc/url.texi (URI Encoding): Update url-hexify-string doc and index improvements (bug#24694).
Diffstat (limited to 'lisp/url/url-util.el')
-rw-r--r--lisp/url/url-util.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index a390723e73d..223a6ba9829 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -395,9 +395,12 @@ string: \"%\" followed by two upper-case hex digits.
The allowed characters are specified by ALLOWED-CHARS. If this
argument is nil, the list `url-unreserved-chars' determines the
-allowed characters. Otherwise, ALLOWED-CHARS should be a vector
-whose Nth element is non-nil if character N is allowed."
- (unless allowed-chars
+allowed characters. Otherwise, ALLOWED-CHARS should be either a
+list of allowed chars, or a vector whose Nth element is non-nil
+if character N is allowed."
+ (if allowed-chars
+ (unless (vectorp allowed-chars)
+ (setq allowed-chars (url--allowed-chars allowed-chars)))
(setq allowed-chars (url--allowed-chars url-unreserved-chars)))
(mapconcat (lambda (byte)
(if (aref allowed-chars byte)