summaryrefslogtreecommitdiff
path: root/lisp/url/url-util.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-08-07 13:14:20 +0200
committerStefan Kangas <stefan@marxist.se>2022-08-07 13:14:20 +0200
commit321f33a2b111c3c0ea1246ffa705d2cc9e8e9242 (patch)
treed53834881640cfc34fbeea8553b5d940e12c3fb1 /lisp/url/url-util.el
parent91f4ea2fa455ad2458e727217d83a177f333c637 (diff)
downloademacs-321f33a2b111c3c0ea1246ffa705d2cc9e8e9242.tar.gz
emacs-321f33a2b111c3c0ea1246ffa705d2cc9e8e9242.tar.bz2
emacs-321f33a2b111c3c0ea1246ffa705d2cc9e8e9242.zip
Improve how url-http displays status messages
* lisp/url/url-util.el (url-display-message): New function. (url-display-percentage): Make obsolete in favor of url-display-message. * lisp/url/url-http.el (url-http-content-length-after-change-function): Prefer 'url-display-message' to 'url-display-percentage'. (url-http-content-length-after-change-function) (url-http-chunked-encoding-after-change-function): Remove ineffectual calls to 'url-display-percentage'.
Diffstat (limited to 'lisp/url/url-util.el')
-rw-r--r--lisp/url/url-util.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index 48ea947faba..147a643c9fd 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -189,13 +189,19 @@ Will not do anything if `url-show-status' is nil."
'file-size-human-readable "24.4")
;;;###autoload
-(defun url-display-percentage (fmt _perc &rest args)
+(defun url-display-message (fmt &rest args)
+ "Like `message', but do nothing if `url-show-status' is nil."
(when (and url-show-status
(not (and url-current-object (url-silent url-current-object)))
fmt)
(apply #'message fmt args)))
;;;###autoload
+(defun url-display-percentage (fmt _perc &rest args)
+ (declare (obsolete url-display-message "29.1"))
+ (url-display-message fmt args))
+
+;;;###autoload
(defun url-percentage (x y)
(round (* 100 (/ x (float y)))))