From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Martin Kletzander Newsgroups: gmane.emacs.bugs Subject: bug#32723: [PATCH] Fix erc-autojoin for same channel names on multiple servers Date: Wed, 12 Sep 2018 17:44:29 +0200 Message-ID: <1ea700cd1f4f6a80dd1315c8192361bd09d1eadd.1536767069.git.nert.pinx@gmail.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1536767051 30155 195.159.176.226 (12 Sep 2018 15:44:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2018 15:44:11 +0000 (UTC) To: 32723@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 12 17:44:07 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g07JG-0007ic-C5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Sep 2018 17:44:06 +0200 Original-Received: from localhost ([::1]:36837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g07LM-0002FE-Iy for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Sep 2018 11:46:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g07LG-0002Ev-7e for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 11:46:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g07LB-0003vY-8R for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 11:46:10 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g07L8-0003uW-Om for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 11:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g07L8-0001dE-M2 for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 11:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Martin Kletzander Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Sep 2018 15:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32723 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15367671616260 (code B ref -1); Wed, 12 Sep 2018 15:46:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Sep 2018 15:46:01 +0000 Original-Received: from localhost ([127.0.0.1]:38390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g07L7-0001ct-6X for submit@debbugs.gnu.org; Wed, 12 Sep 2018 11:46:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g07K5-0001Za-5T for submit@debbugs.gnu.org; Wed, 12 Sep 2018 11:44:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g07Jz-0003Qm-8q for submit@debbugs.gnu.org; Wed, 12 Sep 2018 11:44:51 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g07Jz-0003Qi-5V for submit@debbugs.gnu.org; Wed, 12 Sep 2018 11:44:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g07Jy-0001kd-B5 for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 11:44:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g07Jt-0003Oz-CL for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 11:44:50 -0400 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:37388) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g07Jt-0003OT-56 for bug-gnu-emacs@gnu.org; Wed, 12 Sep 2018 11:44:45 -0400 Original-Received: by mail-wr1-x432.google.com with SMTP id u12-v6so2564168wrr.4 for ; Wed, 12 Sep 2018 08:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=ZEIVk/XP+EcSWMm9CaDk4WBDBNiDwhCYYmOhzEqsYEU=; b=dUmu8NVC3AKHSaz7XkaOkyL8XnbnlsH9oOYgVLvm1vro2Zhf07hcOfw2x2lP2k+7Lg gPxnYYhNZr41qNGzigPqYMQSQvPAUmTXrKNSr1VO0RN2IbUj0yILeXLhUT3FFbq4I5Og Dc7u/uXUX3bBVqTeH1ArOedQ0vgpSeSvt5fcWRipcTSerGtnKkAIxV8EwJQW50QSmciI lCwMdR0pVhUd7uFZK8IChXm6zKZZoAEcvwBuFNcOsrTp2cQTZ/bbPyNnBHGpf5ozf1gM H7MV8ss6bZ3OrXNsbDFHy1Tm3lfArghXUJkAGNp0n/g8d1BNVjxLadNRA7U7tLiTGAJX s1TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=ZEIVk/XP+EcSWMm9CaDk4WBDBNiDwhCYYmOhzEqsYEU=; b=YKFoWAFzM/qQeNivfihY5hDQ3p8yFueRwL990UOSoMtoVO7jm3FbEHA8OhN2bxJvbz ejHGfWZreYQRKaMgt/3fy+FaC1j4xAWNvqmsW+zRQ7Fyo8AeS5yJ2Jn70bFj/4Uyp+s1 RqVr6hFAmP6far24QlofCjWwRoV8MfrZXYXNF5HCRk2pPbeemhpd/hjpgPmy8pEuoUd1 07/TJgGcfSfVMPqbE9kDPa7jzatX0o3EksUcp0dbmJJg+86/vintXhY75h/BSHoqlRPQ Zb6qcg7WQupsYwrOGMRiqi3UuXJybik2tqPkUyv5TSfSFF/AMcXhvscd/6uP+y1raaoZ Zplw== X-Gm-Message-State: APzg51Cmj96T+yIyd3g2dqOFl46Hybe6KQcAWaCdfQjLMydtsHk+PM/A Gjr1jTwzsQmr5o7Vl3FAsB+yVBFq X-Google-Smtp-Source: ANB0VdbDTO3Vofwwra5Htd5f+OIoIkNY9ms6Z6JNpAY9qFdexT5SaRo8AV704z9MgEacwKfvce2e4A== X-Received: by 2002:adf:e648:: with SMTP id b8-v6mr2128831wrn.254.1536767083495; Wed, 12 Sep 2018 08:44:43 -0700 (PDT) Original-Received: from wheatley (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id u7-v6sm1883710wmd.46.2018.09.12.08.44.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 08:44:42 -0700 (PDT) Original-Received: from wheatley.brq.redhat.com (wheatley.usersys.redhat.com [127.0.0.1]) by wheatley (Postfix) with ESMTP id A6EA47E002C for ; Wed, 12 Sep 2018 17:44:41 +0200 (CEST) X-Mailer: git-send-email 2.18.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Wed, 12 Sep 2018 11:45:59 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150254 Archived-At: When auto-joining channel with the same name on multiple channels the auto-join will go over the list of channels and for each one it checks if there is a buffer and alive server process. However it does not check if the server process matches the server being currently processed for auto-joining. This happens since commit "Don't join erc channels doubly" Fix it by checking if the currently processed server matches the erc process name of the already joined channel. * lisp/erc/erc-join.el (erc-autojoin-channels): Join channels with the same name on different servers. Copyright-paperwork-exempt: yes --- lisp/erc/erc-join.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index a6bf6518ea86..567a4cc27e19 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -161,6 +161,9 @@ This function is run from `erc-nickserv-identified-hook'." ;; Only auto-join the channels that we aren't already in ;; using a different nick. (when (or (not buffer) + ;; If the same channel is joined on another + ;; server the best-effort is to just join + (not (string-match (car l) (process-name erc-server-process))) (not (with-current-buffer buffer (erc-server-process-alive)))) (erc-server-join-channel server chan)))))))) -- 2.18.0