Sometimes a pdf file takes a long time to download and as a consequence a user can call it again. That results in redundancy as a PDF file is then downloaded again needlessly. There needs to be flag with a timeout which checks if the last call is finished and a way for the user to abort the download also.
-
We can do with a progress meter of download but I'm not sure if that's supported by url-retrieve.
-
So upon a quick search, there's a make-progress-reporter and progress-reporter update function which can be used
(defun show-progress-demo ()
(interactive)
(let ((download-reporter
(make-progress-reporter "Downloading python documentation..."
0 100)))
(url-retrieve "http://www.google.com"
(lambda (data bar)
;; skip http header
(re-search-forward "\r?\n\r?\n")
(write-region (point) (point-max) "/tmp/google")
(progress-reporter-done bar))
`(,download-reporter))
(dotimes (k 100)
(sit-for 0.01)
(progress-reporter-update download-reporter k))))
Sometimes a pdf file takes a long time to download and as a consequence a user can call it again. That results in redundancy as a PDF file is then downloaded again needlessly. There needs to be flag with a timeout which checks if the last call is finished and a way for the user to abort the download also.
We can do with a progress meter of download but I'm not sure if that's supported by
url-retrieve.So upon a quick search, there's a
make-progress-reporterandprogress-reporter updatefunction which can be used