From 5f539581a461ebdfec107bc2648a399bac888c49 Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Fri, 19 Feb 2021 17:32:59 -0500 Subject: * lisp/url/url-http.el (url-http): Fix docstring typo. --- lisp/url/url-http.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/url/url-http.el') diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 8cebd4e79f6..e3c178630ae 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -1292,7 +1292,7 @@ passing it an updated value of CBARGS as arguments. The first element in CBARGS should be a plist describing what has happened so far during the request, as described in the docstring of `url-retrieve' (if in doubt, specify nil). The current buffer -then CALLBACK is executed is the retrieval buffer. +when CALLBACK is executed is the retrieval buffer. Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a previous `url-http' call, which is being re-attempted. -- cgit v1.2.3 From b7d3c1e57743df464cd7c3ee43493fbbd2ae8705 Mon Sep 17 00:00:00 2001 From: dickmao Date: Mon, 9 Aug 2021 15:46:00 +0200 Subject: Forestall "Selected deleted buffer" in url-http-generic-filter * lisp/url/url-http.el (url-http-generic-filter): Check that corresponding buffer is still live before using it (bug#49928). --- lisp/url/url-http.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'lisp/url/url-http.el') diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index e3c178630ae..ba13a17a8fc 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -1494,17 +1494,18 @@ The return value of this function is the retrieval buffer." ;; Sometimes we get a zero-length data chunk after the process has ;; been changed to 'free', which means it has no buffer associated ;; with it. Do nothing if there is no buffer, or 0 length data. - (and (process-buffer proc) - (/= (length data) 0) - (with-current-buffer (process-buffer proc) - (url-http-debug "Calling after change function `%s' for `%S'" url-http-after-change-function proc) - (funcall url-http-after-change-function - (point-max) - (progn - (goto-char (point-max)) - (insert data) - (point-max)) - (length data))))) + (let ((b (process-buffer proc))) + (when (and (buffer-live-p b) (not (zerop (length data)))) + (with-current-buffer b + (url-http-debug "Calling after change function `%s' for `%S'" + url-http-after-change-function proc) + (funcall url-http-after-change-function + (point-max) + (progn + (goto-char (point-max)) + (insert data) + (point-max)) + (length data)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; file-name-handler stuff from here on out -- cgit v1.2.3