Mercurial > emacs
comparison lisp/url/url-util.el @ 74135:e125bce98ce9
(url-display-percentage): Only show a message if `url-show-status' is non-nil.
author | Magnus Henoch <mange@freemail.hu> |
---|---|
date | Thu, 23 Nov 2006 08:40:50 +0000 |
parents | 23d71f51857b |
children | e3694f1cb928 c71725faff1a |
comparison
equal
deleted
inserted
replaced
74134:a81576ee49cc | 74135:e125bce98ce9 |
---|---|
242 (t | 242 (t |
243 (format "%2.2fM" (/ n (* 1024 1024.0)))))) | 243 (format "%2.2fM" (/ n (* 1024 1024.0)))))) |
244 | 244 |
245 ;;;###autoload | 245 ;;;###autoload |
246 (defun url-display-percentage (fmt perc &rest args) | 246 (defun url-display-percentage (fmt perc &rest args) |
247 (if (null fmt) | 247 (when url-show-status |
248 (if (fboundp 'clear-progress-display) | 248 (if (null fmt) |
249 (clear-progress-display)) | 249 (if (fboundp 'clear-progress-display) |
250 (if (and (fboundp 'progress-display) perc) | 250 (clear-progress-display)) |
251 (apply 'progress-display fmt perc args) | 251 (if (and (fboundp 'progress-display) perc) |
252 (apply 'message fmt args)))) | 252 (apply 'progress-display fmt perc args) |
253 (apply 'message fmt args))))) | |
253 | 254 |
254 ;;;###autoload | 255 ;;;###autoload |
255 (defun url-percentage (x y) | 256 (defun url-percentage (x y) |
256 (if (fboundp 'float) | 257 (if (fboundp 'float) |
257 (round (* 100 (/ x (float y)))) | 258 (round (* 100 (/ x (float y)))) |