From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!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: Tue, 19 May 2020 20:25:24 +0200 Message-ID: <20200519182524.GE926@wheatley> References: <1ea700cd1f4f6a80dd1315c8192361bd09d1eadd.1536767069.git.nert.pinx@gmail.com> <87ftc7h9gp.fsf@fsfe.org> <20200511150654.GF30179@wheatley> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="113965"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 32723@debbugs.gnu.org To: Kevin Brubeck Unhammer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 19 20:26:46 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jb6ww-000TWV-52 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 May 2020 20:26:46 +0200 Original-Received: from localhost ([::1]:59388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jb6wu-0006l6-RJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 May 2020 14:26:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb6wF-0005rp-59 for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 14:26:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jb6wE-0000gb-R0 for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 14:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jb6wE-000267-NZ for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 14:26: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: Tue, 19 May 2020 18:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32723 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed Original-Received: via spool by 32723-submit@debbugs.gnu.org id=B32723.15899127368016 (code B ref 32723); Tue, 19 May 2020 18:26:02 +0000 Original-Received: (at 32723) by debbugs.gnu.org; 19 May 2020 18:25:36 +0000 Original-Received: from localhost ([127.0.0.1]:50934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb6vo-00025D-IU for submit@debbugs.gnu.org; Tue, 19 May 2020 14:25:36 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:51393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb6vk-00024m-Pd for 32723@debbugs.gnu.org; Tue, 19 May 2020 14:25:33 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id f134so251491wmf.1 for <32723@debbugs.gnu.org>; Tue, 19 May 2020 11:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=VwLZJz8izaUQIihhCz85TpqpyGfDSp00l0GMy2TPlow=; b=c5t5C4a8cwju4ONpzQW9j3ghF66dgnSnwDWawoYfpaGQ1lYmWrUNVla0coU5SvcNSN 2mdaT1sxoc4F5dvtPfm2I72THT3BWiM4BNaVDtUjq7cAFmFgcTKwXArFK533lPdQpBWD AolOcwsf/WnlOH7vai39E+OreoKkpnhayB7a6ID21b8EraXT+nThGu1UJcwE2m7W8NHO NA1CfuBkMK4a1Yzro0GY50hAUpxCe/432AccqKCoeor1TKuV8oi06G1AmNSLFGAgdPGy 6/3T5VMduV/gRB1TXM+tNQxo0fLlyhlV/RXAtmoUUDo3VyI0O7X7qRMr07wRpY+6svby 4UPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=VwLZJz8izaUQIihhCz85TpqpyGfDSp00l0GMy2TPlow=; b=iZyDRUoN37CZYQ9nDUCMHC29JTPfSoQJc7jjFaTtiGhAvWZRGw1jprt6V7bMdZG0+j 41UAX1wjVdzQuSj2ceI0hjPlrOSNIwpCcT/H4IaeoilQX5aGXvbXR4tFhJrybY0BFDGV S/ApwuUYYqUOTcw5AqYl2dp9fdgCwnl2kuANeM44UE+QnTkR0njNWIUwGmwfiqk4cCfS SADfhUkJ1GperpvNzuxMooMknBzP15W+/PpdlCxjMTJvryvg9V5rzS49btHOoyFY1S97 6me5HtuKFMmBNXicpAdCzgrpV8k0tdur7nqN/jZcxAsQb1YbOrPw9T3UiO+5m1XARsOz ZWNg== X-Gm-Message-State: AOAM531qXfMdRhifKagAn2NFFnVG7lW3KruRKE45Y+1rC2OGBOyRZ5eE +4JiLbW6Q5TBAQVEntlAese2a3SU X-Google-Smtp-Source: ABdhPJwnzVDPYCbrZDnyPDa6EY/GZqWO14Y1ucPWOgFYiZmp6o7moJ/OzYTNJfp2KB0qwiLeOgulaA== X-Received: by 2002:a1c:2d14:: with SMTP id t20mr762483wmt.28.1589912726393; Tue, 19 May 2020 11:25:26 -0700 (PDT) Original-Received: from carol.localdomain (k8r.cz. [95.82.177.71]) by smtp.gmail.com with ESMTPSA id v5sm228102wrr.93.2020.05.19.11.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 11:25:25 -0700 (PDT) Original-Received: by carol.localdomain (Postfix, from userid 1000) id 8285AC20F8A; Tue, 19 May 2020 20:25:24 +0200 (CEST) Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett In-Reply-To: <20200511150654.GF30179@wheatley> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:180606 Archived-At: On Mon, May 11, 2020 at 05:06:54PM +0200, Martin Kletzander wrote: >On Sun, May 10, 2020 at 09:32:38PM +0200, Kevin Brubeck Unhammer wrote: >>Martin Kletzander čálii: >> >>> 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. >> >>That's not always going to match though. The car's of >>erc-autojoin-channels contain the values of erc-server-announced-name or >>erc-session-server, not the process-name of >>erc-server-process. E.g. when I join my weechat relay, >>erc-session-server is "example.com" and erc-server-announced-name is >>"weechat.relay.irc" while (process-name erc-server-process) is >>"erc-example.com-9001<1>". >> > >Oh, I completely forgot what I was doing there, I just know that with this patch >it is fixed for me, even though it might be dependent on various quirks that >just happen on my client (be it joining servers with very different latency, not >using autojoin twice or something completely different). > >>Also, the check is against the current erc-server-process (for the >>server being joined). Isn't the intention of the patch to check against >>the candidate buffer's server-process? >> So I just tried emacs-27.0.91 and with your approach it does not join any channel on any server. With my patch (which I just learned is in, I found out that it could not be applied locally) it joins all channels, but there is only one of those two that have the same name. However if I try joining the other one manually it joins, but does not create a buffer. It only gets created once someone posts to the channel. I actually started writing that it does not get joined while a message appeared out of nowhere, I thought it was a private query because there was no header, nothing. Only after that I realised it has a name of the channel, but on the second server, so I deleted that part of the e-mail! I think there is something wrong with some other part of erc-join (or erc), so for a while I'm sticking to 26.* with my patch on top of it, but sooner or later I'll have to figure that out (or someone else, maybe). Unfortunately I'm swamped with more important things lately. > >As I said, I do not remember what exactly was the reason for this particular way >of dealing with it. I definitely made some mistakes. > >>I would expect something like >> >> (when (or (not buffer) >> ;; If the same channel is joined on another >> ;; server the best-effort is to just join >> (not (with-current-buffer buffer >> (or (string-match-p (car l) erc-session-server) >> (string-match-p (car l) erc-session-announced-name)))) >> (not (with-current-buffer buffer >> (erc-server-process-alive)))) >> (erc-server-join-channel server chan)) >> > >If that works, then I'm fine with it. I can test it later on and let you know if >it works for me. > >Thanks, >Martin