emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/rcirc-update b67b1ee 15/18: Fix prompt doubling when reconnectin


From: Philip Kaludercic
Subject: feature/rcirc-update b67b1ee 15/18: Fix prompt doubling when reconnecting
Date: Thu, 10 Jun 2021 11:43:40 -0400 (EDT)

branch: feature/rcirc-update
commit b67b1eea256e05cc65039f207d0f16a16e2dac4e
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    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 ad5a4d6..edd5b87 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 ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]