[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/with-url 724b285 6/8: Always kill the buffer, even
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] scratch/with-url 724b285 6/8: Always kill the buffer, even when ignoring errors |
Date: |
Sun, 22 Jan 2017 00:29:33 +0000 (UTC) |
branch: scratch/with-url
commit 724b2858ab6b629da943ca83a9a577261fb6d9b2
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Always kill the buffer, even when ignoring errors
---
lisp/url/with-url.el | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/lisp/url/with-url.el b/lisp/url/with-url.el
index 36de4cc..a656618 100644
--- a/lisp/url/with-url.el
+++ b/lisp/url/with-url.el
@@ -174,8 +174,9 @@ and `base64'."
(let ((buffer (process-buffer (url-request-process ,requestv))))
(with-current-buffer buffer
(unwind-protect
- (when (or (not (url-request-ignore-errors ,requestv))
- (url-okp))
+ (if (and (url-request-ignore-errors ,requestv)
+ (url-error))
+ (kill-buffer buffer)
(goto-char (point-min))
,@body)
(kill-buffer buffer)))))
@@ -283,10 +284,11 @@ If given, return the value in BUFFER instead."
(push (list 'response
500 (format "Error occurred while fetching file: %s" err))
with-url--status)))
- (when (or (not (url-request-ignore-errors req))
- (url-okp))
- (goto-char (point-min))
- (when (url-request-callback req)
+ (goto-char (point-min))
+ (when (url-request-callback req)
+ (if (and (url-request-ignore-errors req)
+ (url-error))
+ (kill-buffer buffer)
(unwind-protect
(funcall (url-request-callback req))
(kill-buffer buffer)))))))
@@ -549,9 +551,12 @@ If given, return the value in BUFFER instead."
(delete-char -1)))
(goto-char (point-min))
(when (url-request-callback req)
- (unwind-protect
- (funcall (url-request-callback req))
- (kill-buffer buffer))))))
+ (if (and (url-request-ignore-errors req)
+ (url-error))
+ (kill-buffer buffer)
+ (unwind-protect
+ (funcall (url-request-callback req))
+ (kill-buffer buffer)))))))
(defun with-url--decode-chunked ()
(let (length)
- [Emacs-diffs] scratch/with-url updated (f74e07b -> 9d2e1e3), Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url dbc317f 2/8: Fix syntax error in with-url rework, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 5bd8812 4/8: Make :wait case actually work., Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 495cb41 1/8: Handle the case where the peer drops connection with no Content-Length, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 3ee6d63 3/8: Rework for with-url, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 724b285 6/8: Always kill the buffer, even when ignoring errors,
Lars Ingebrigtsen <=
- [Emacs-diffs] scratch/with-url be65731 7/8: Allow specifying that redirects should not be followed, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 8ff9bd5 5/8: Remove unused parameter, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 9d2e1e3 8/8: Increase timeouts not that progress is more ensured, Lars Ingebrigtsen, 2017/01/21