]> git.eshelyaron.com Git - emacs.git/commitdiff
Further fix for erc-generate-new-buffer-name
authorKevin Brubeck Unhammer <unhammer@fsfe.org>
Wed, 5 Aug 2020 09:13:51 +0000 (11:13 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 5 Aug 2020 09:13:51 +0000 (11:13 +0200)
* lisp/erc/erc.el (erc-generate-new-buffer-name): Fix buffer name
generation when there's two networks on the same
server:port (bug#40121).

lisp/erc/erc.el

index 927546abc303a72e756031c7c1a07e2661145cbb..62aa76d25c8cd3ccd9c7abb7b8d4396916afa595 100644 (file)
@@ -1630,9 +1630,10 @@ symbol, it may have these values:
                           (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)))))
+                   (and target
+                        (with-current-buffer (get-buffer candidate)
+                          (and (string= erc-session-server server)
+                               (erc-port-equal erc-session-port port))))))
           (setq buffer-name candidate)))
     ;; if buffer-name is unset, neither candidate worked out for us,
     ;; fallback to the old <N> uniquification method: