# HG changeset patch # User Lars Magne Ingebrigtsen # Date 1285941925 -7200 # Node ID 88f8a448614e1d196e693d837f027debb9b46325 # Parent 55c8c3ca3d485792ba7e2c98fde2ab945e740bf9 (url-http-async-sentinel): Check that the buffer is still alive before switching to it. diff -r 55c8c3ca3d48 -r 88f8a448614e lisp/url/ChangeLog --- a/lisp/url/ChangeLog Fri Oct 01 06:56:33 2010 -0700 +++ b/lisp/url/ChangeLog Fri Oct 01 16:05:25 2010 +0200 @@ -1,3 +1,8 @@ +2010-10-01 Lars Magne Ingebrigtsen + + * url-http.el (url-http-async-sentinel): Check that the buffer is + still alive before switching to it. + 2010-09-25 Julien Danjou * url-cache.el (url-cache-create-filename): Ensure no-port and diff -r 55c8c3ca3d48 -r 88f8a448614e lisp/url/url-http.el --- a/lisp/url/url-http.el Fri Oct 01 06:56:33 2010 -0700 +++ b/lisp/url/url-http.el Fri Oct 01 16:05:25 2010 +0200 @@ -1244,20 +1244,21 @@ (declare (special url-callback-arguments)) ;; We are performing an asynchronous connection, and a status change ;; has occurred. - (with-current-buffer (process-buffer proc) - (cond - (url-http-connection-opened - (url-http-end-of-document-sentinel proc why)) - ((string= (substring why 0 4) "open") - (setq url-http-connection-opened t) - (process-send-string proc (url-http-create-request))) - (t - (setf (car url-callback-arguments) - (nconc (list :error (list 'error 'connection-failed why - :host (url-host (or url-http-proxy url-current-object)) - :service (url-port (or url-http-proxy url-current-object)))) - (car url-callback-arguments))) - (url-http-activate-callback))))) + (when (buffer-name (process-buffer proc)) + (with-current-buffer (process-buffer proc) + (cond + (url-http-connection-opened + (url-http-end-of-document-sentinel proc why)) + ((string= (substring why 0 4) "open") + (setq url-http-connection-opened t) + (process-send-string proc (url-http-create-request))) + (t + (setf (car url-callback-arguments) + (nconc (list :error (list 'error 'connection-failed why + :host (url-host (or url-http-proxy url-current-object)) + :service (url-port (or url-http-proxy url-current-object)))) + (car url-callback-arguments))) + (url-http-activate-callback)))))) ;; Since Emacs 19/20 does not allow you to change the ;; `after-change-functions' hook in the midst of running them, we fake