From cdefc045893a7fed57856ac385ab41c71f61c09f Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Sat, 14 Apr 2018 20:10:53 +0200 Subject: [PATCH] Subject: Fix problem with erc buffer renames after reconnect * lisp/erc/erc.el (erc-generate-new-buffer-name): Solve problem with renamed buffers on different servers after reconnect (bug#30639). Copyright-paperwork-exempt: yes --- lisp/erc/erc.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 550800c57f2..63228516be7 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1608,18 +1608,18 @@ symbol, it may have these values: (dolist (candidate (list buf-name (concat buf-name "/" server))) (if (and (not buffer-name) erc-reuse-buffers - (get-buffer candidate) - (or target + (or (not (get-buffer candidate)) + (or target + (with-current-buffer (get-buffer candidate) + (and (erc-server-buffer-p) + (not (erc-server-process-alive))))) (with-current-buffer (get-buffer candidate) - (and (erc-server-buffer-p) - (not (erc-server-process-alive))))) - (with-current-buffer (get-buffer candidate) - (and (string= erc-session-server server) - (erc-port-equal erc-session-port port)))) + (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 uniquification method: - (or buffer-name (generate-new-buffer-name buf-name)) )) + (or buffer-name (generate-new-buffer-name (concat buf-name "/" server))))) (defun erc-get-buffer-create (server port target) "Create a new buffer based on the arguments." -- 2.11.4.GIT