]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix erc bug when there's two channels with the same name
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 2 Aug 2020 07:43:41 +0000 (09:43 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 2 Aug 2020 07:43:41 +0000 (09:43 +0200)
* lisp/erc/erc.el (erc-generate-new-buffer-name): Fix logic when
there's two channels with the same name from two different servers
(bug#40121).

lisp/erc/erc.el

index bfe8a2b42ebc0ac3f852cb57a3c7b3d07d599c79..8830dd4c45e46833cabf25f19e6a028168c6db5d 100644 (file)
@@ -1622,10 +1622,12 @@ symbol, it may have these values:
       (if (and (not buffer-name)
                erc-reuse-buffers
                (or (not (get-buffer candidate))
-                   (or target
-                       (with-current-buffer (get-buffer candidate)
-                         (and (erc-server-buffer-p)
-                              (not (erc-server-process-alive)))))
+                   ;; Looking for a server buffer, so there's no target.
+                   (and (not target)
+                        (with-current-buffer (get-buffer candidate)
+                          (and (erc-server-buffer-p)
+                               (not (erc-server-process-alive)))))
+                   ;; Channel buffer; check that it's from the right server.
                    (with-current-buffer (get-buffer candidate)
                      (and (string= erc-session-server server)
                           (erc-port-equal erc-session-port port)))))