From b67b1eea256e05cc65039f207d0f16a16e2dac4e Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 10 Jun 2021 11:40:19 +0200 Subject: [PATCH] Fix prompt doubling when reconnecting * rcirc.el (rcirc-connect): Check if rcirc-mode is already active (rcirc-get-buffer-create): Check if rcirc-mode is already active --- lisp/net/rcirc.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index ad5a4d64178..edd5b87e7d1 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -621,7 +621,8 @@ that are joined after authentication." (set-process-coding-system process 'raw-text 'raw-text) (switch-to-buffer (rcirc-generate-new-buffer-name process nil)) (set-process-buffer process (current-buffer)) - (rcirc-mode process nil) + (unless (eq major-mode 'rcirc-mode) + (rcirc-mode process nil)) (set-process-sentinel process 'rcirc-sentinel) (set-process-filter process 'rcirc-filter) @@ -662,6 +663,7 @@ that are joined after authentication." (run-at-time 0 (/ rcirc-timeout-seconds 2) 'rcirc-keepalive))) (message "Connecting to %s...done" (or server-alias server)) + (setq mode-line-process nil) ;; return process object process))) @@ -1412,9 +1414,11 @@ Create the buffer if it doesn't exist." (let ((new-buffer (get-buffer-create (rcirc-generate-new-buffer-name process target)))) (with-current-buffer new-buffer - (rcirc-mode process target) + (unless (eq major-mode 'rcirc-mode) + (rcirc-mode process target))) + (setq mode-line-process nil) (rcirc-put-nick-channel process (rcirc-nick process) target - rcirc-current-line)) + rcirc-current-line) new-buffer))))) (defun rcirc-send-input () -- 2.39.2