emacs-diffs
[Top][All Lists]
Advanced

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

feature/rcirc-update 4023853 4/5: Update rcirc-buffer-alist after receiv


From: Philip Kaludercic
Subject: feature/rcirc-update 4023853 4/5: Update rcirc-buffer-alist after receiving NICK
Date: Tue, 27 Jul 2021 11:42:46 -0400 (EDT)

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

    Update rcirc-buffer-alist after receiving NICK
    
    * rcirc.el (rcirc-handler-NICK): Remove old nick and add new nick
---
 lisp/net/rcirc.el | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 60751c1..2c8bf43 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -3143,13 +3143,16 @@ PROCESS is the process object for the current 
connection."
     ;; print message to nick's channels
     (dolist (target channels)
       (rcirc-print process sender "NICK" target new-nick))
-    ;; update private chat buffer, if it exists
-    (let ((chat-buffer (rcirc-get-buffer process old-nick)))
-      (when chat-buffer
-       (with-current-buffer chat-buffer
-         (rcirc-print process sender "NICK" old-nick new-nick)
-         (setq rcirc-target new-nick)
-         (rename-buffer (rcirc-generate-new-buffer-name process new-nick)))))
+    ;; update chat buffer, if it exists
+    (when-let ((chat-buffer (rcirc-get-buffer process old-nick)))
+      (with-current-buffer chat-buffer
+       (rcirc-print process sender "NICK" old-nick new-nick)
+       (setq rcirc-target new-nick)
+       (rename-buffer (rcirc-generate-new-buffer-name process new-nick)))
+      (setf rcirc-buffer-alist
+            (cons (cons new-nick chat-buffer)
+                  (delq (assoc-string old-nick rcirc-buffer-alist t)
+                        rcirc-buffer-alist))))
     ;; remove old nick and add new one
     (with-rcirc-process-buffer process
       (let ((v (gethash old-nick rcirc-nick-table)))



reply via email to

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