summaryrefslogtreecommitdiff
path: root/lisp/erc/erc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc/erc.el')
-rw-r--r--lisp/erc/erc.el40
1 files changed, 24 insertions, 16 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 7de2828b86d..427dd178383 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1672,21 +1672,22 @@ needs to be active for this function to work."
(require 'iswitchb))
(let ((enabled iswitchb-mode))
(or enabled (iswitchb-mode 1))
- (let ((iswitchb-make-buflist-hook
- (lambda ()
- (setq iswitchb-temp-buflist
- (mapcar 'buffer-name
- (erc-buffer-list
- nil
- (when arg erc-server-process)))))))
- (switch-to-buffer
- (iswitchb-read-buffer
- "Switch-to: "
- (if (boundp 'erc-modified-channels-alist)
- (buffer-name (caar (last erc-modified-channels-alist)))
- nil)
- t)))
- (or enabled (iswitchb-mode -1))))
+ (unwind-protect
+ (let ((iswitchb-make-buflist-hook
+ (lambda ()
+ (setq iswitchb-temp-buflist
+ (mapcar 'buffer-name
+ (erc-buffer-list
+ nil
+ (when arg erc-server-process)))))))
+ (switch-to-buffer
+ (iswitchb-read-buffer
+ "Switch-to: "
+ (if (boundp 'erc-modified-channels-alist)
+ (buffer-name (caar (last erc-modified-channels-alist)))
+ nil)
+ t)))
+ (or enabled (iswitchb-mode -1)))))
(defun erc-channel-list (proc)
"Return a list of channel buffers.
@@ -1888,10 +1889,11 @@ Returns the buffer for the given server or channel."
(connected-p (unless connect erc-server-connected))
(buffer (erc-get-buffer-create server port channel))
(old-buffer (current-buffer))
- (old-point (point))
+ old-point
continued-session)
(erc-update-modules)
(set-buffer buffer)
+ (setq old-point (point))
(erc-mode)
(setq erc-server-announced-name server-announced-name)
(setq erc-server-connected connected-p)
@@ -3165,6 +3167,12 @@ the message given by REASON."
(defalias 'erc-cmd-GQ 'erc-cmd-GQUIT)
(put 'erc-cmd-GQUIT 'do-not-parse-args t)
+(defun erc-cmd-RECONNECT ()
+ "Try to reconnect to the current IRC server."
+ (setq erc-server-reconnect-count 0)
+ (erc-server-reconnect)
+ t)
+
(defun erc-cmd-SERVER (server)
"Connect to SERVER, leaving existing connection intact."
(erc-log (format "cmd: SERVER: %s" server))