From d50b89dda9478b5e7e20e9b23bf48bd07ee6210a Mon Sep 17 00:00:00 2001 From: Thomas Riccardi Date: Sun, 27 Dec 2015 23:14:13 +0100 Subject: [PATCH] Further erc asynch fixes * lisp/erc/erc-backend.el (erc-process-sentinel-2): Make erc-server-connect to return even if the connection is not ready. Then erc-open and erc-server-reconnect do the same. (bug#5650). Copyright-paperwork-exempt: yes --- lisp/erc/erc-backend.el | 8 +++----- lisp/erc/erc.el | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index a0b3537afee..fbac849a1d8 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -640,13 +640,11 @@ EVENT is the message received from the closed connection process." (condition-case err (progn (setq erc-server-reconnecting nil) - (erc-server-reconnect) - (setq erc-server-reconnect-count 0)) + (setq erc-server-reconnect-count (1+ erc-server-reconnect-count)) + (erc-server-reconnect)) (error (when (buffer-live-p buffer) (set-buffer buffer) - (if (integerp erc-server-reconnect-attempts) - (setq erc-server-reconnect-count - (1+ erc-server-reconnect-count)) + (unless (integerp erc-server-reconnect-attempts) (message "%s ... %s" "Reconnecting until we succeed" "kill the ERC server buffer to stop")) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 126cac68a7b..cd8e427f72b 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4488,6 +4488,7 @@ Set user modes and run `erc-after-connect' hook." (nick (car (erc-response.command-args parsed))) (buffer (process-buffer proc))) (setq erc-server-connected t) + (setq erc-server-reconnect-count 0) (erc-update-mode-line) (erc-set-initial-user-mode nick buffer) (erc-server-setup-periodical-ping buffer) -- 2.39.5