summaryrefslogtreecommitdiff
path: root/lisp/url
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-08-03 10:00:34 +0200
committerStefan Kangas <stefan@marxist.se>2022-08-03 10:39:47 +0200
commit836ef4293fa6df71336f6e88a3e404480eb2f96c (patch)
tree7e6adc50b58221194e01d781fbc4cf0d01fb7927 /lisp/url
parent6edb499a5eb7c5f22ceb3b8ea0e878d749c2a778 (diff)
downloademacs-836ef4293fa6df71336f6e88a3e404480eb2f96c.tar.gz
Make url-util space trimming functions obsolete
* lisp/url/url-util.el (url-eat-trailing-space) (url-strip-leading-spaces): Make obsolete in favor of 'string-trim'. Update caller.
Diffstat (limited to 'lisp/url')
-rw-r--r--lisp/url/url-http.el4
-rw-r--r--lisp/url/url-util.el15
2 files changed, 5 insertions, 14 deletions
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 3d7d8779795..125f8436f68 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -471,9 +471,7 @@ Return the number of characters removed."
t ;; Instruct caller to signal an error. Bug#50511
;; Find strongest supported auth.
(dolist (this-auth auths)
- (setq this-auth (url-eat-trailing-space
- (url-strip-leading-spaces
- this-auth)))
+ (setq this-auth (string-trim this-auth))
(let* ((this-type
(downcase (if (string-match "[ \t]" this-auth)
(substring this-auth 0 (match-beginning 0))
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index fc84d451760..993a3732abf 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -182,21 +182,14 @@ Will not do anything if `url-show-status' is nil."
;;;###autoload
(defun url-eat-trailing-space (x)
"Remove spaces/tabs at the end of a string."
- (let ((y (1- (length x)))
- (skip-chars (list ? ?\t ?\n)))
- (while (and (>= y 0) (memq (aref x y) skip-chars))
- (setq y (1- y)))
- (substring x 0 (1+ y))))
+ (declare (obsolete string-trim "29.1"))
+ (string-trim x ""))
;;;###autoload
(defun url-strip-leading-spaces (x)
"Remove spaces at the front of a string."
- (let ((y (1- (length x)))
- (z 0)
- (skip-chars (list ? ?\t ?\n)))
- (while (and (<= z y) (memq (aref x z) skip-chars))
- (setq z (1+ z)))
- (substring x z nil)))
+ (declare (obsolete string-trim "29.1"))
+ (string-trim x nil ""))
(define-obsolete-function-alias 'url-pretty-length