summaryrefslogtreecommitdiff
path: root/lisp/erc/erc.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-08-02 09:43:41 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-08-02 09:43:41 +0200
commit6f94c2405f4c82b63da19de89549aff1fad7e594 (patch)
treec30a3f8b32356ada9155e0ecde4afd7b6c5a5f6c /lisp/erc/erc.el
parenteab636c7eb25c4e1cbfeb0fc48cc1274e1c55222 (diff)
downloademacs-6f94c2405f4c82b63da19de89549aff1fad7e594.tar.gz
emacs-6f94c2405f4c82b63da19de89549aff1fad7e594.tar.bz2
emacs-6f94c2405f4c82b63da19de89549aff1fad7e594.zip
Fix erc bug when there's two channels with the same name
* 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).
Diffstat (limited to 'lisp/erc/erc.el')
-rw-r--r--lisp/erc/erc.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index bfe8a2b42eb..8830dd4c45e 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -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)))))