From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pankaj Jangid Newsgroups: gmane.emacs.bugs,gmane.emacs.erc.general Subject: bug#51753: ERC switches to channel buffer on reconnect Date: Mon, 23 May 2022 08:20:32 +0530 Message-ID: <875ylxm07b.fsf@codeisgreat.org> References: <878rqwjqua.fsf@codeisgreat.org> <87a6b92ers.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18500"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 51753@debbugs.gnu.org, emacs-erc@gnu.org To: "J.P." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 23 04:51:11 2022 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 1nsyA3-0004cF-63 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 May 2022 04:51:11 +0200 Original-Received: from localhost ([::1]:43818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsyA1-0000sx-KH for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 May 2022 22:51:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsy9t-0000rz-Qo for bug-gnu-emacs@gnu.org; Sun, 22 May 2022 22:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nsy9t-0002qi-IJ for bug-gnu-emacs@gnu.org; Sun, 22 May 2022 22:51:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nsy9t-0006bv-Gu for bug-gnu-emacs@gnu.org; Sun, 22 May 2022 22:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pankaj Jangid Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 May 2022 02:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51753 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51753-submit@debbugs.gnu.org id=B51753.165327424425387 (code B ref 51753); Mon, 23 May 2022 02:51:01 +0000 Original-Received: (at 51753) by debbugs.gnu.org; 23 May 2022 02:50:44 +0000 Original-Received: from localhost ([127.0.0.1]:46779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsy9c-0006bP-Fy for submit@debbugs.gnu.org; Sun, 22 May 2022 22:50:44 -0400 Original-Received: from mail-pj1-f42.google.com ([209.85.216.42]:42734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsy9Z-0006bA-9F for 51753@debbugs.gnu.org; Sun, 22 May 2022 22:50:43 -0400 Original-Received: by mail-pj1-f42.google.com with SMTP id a23-20020a17090acb9700b001df4e9f4870so12418831pju.1 for <51753@debbugs.gnu.org>; Sun, 22 May 2022 19:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeisgreat-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:references:mail-followup-to:date:in-reply-to :message-id:user-agent:mime-version; bh=fT8LXlYVwx4yDK2HuLQWMZu4SxpFr+Be5IOsez1DiFs=; b=spV/32+/YdPPAJ/K7UsWeIJYm922clxWc30/c7HqfZQiDa7vg6Zbr3CT8POiF7/6+U uyQmDq6QPTTn535NkAW51DgBTc6uNjfSSQe11MHHvDXg5j0zdo3e0+0KNVltVps5JzpU DAEHWgaWN1tDnkRqgoMYhbN9gHYHpogGkN//RR/tRn+dzf4eMZg3ifSNUPEAsU+bwLaA uVyF4T3whfM4wMeccN9yaKD8XhaQNq4M1nXSrlGr778idaAnATT1mKanH9UNPMjZAWKJ woaiykmoGH+AKI7GBbIXiqV+nTkzeF6n5S/J+WnOpE9GXxRvzeDwcmTPJ06npsPbGyhD VPkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:mail-followup-to :date:in-reply-to:message-id:user-agent:mime-version; bh=fT8LXlYVwx4yDK2HuLQWMZu4SxpFr+Be5IOsez1DiFs=; b=wflc0JHbkKYekF1sMKYLLfHFOTkEovxH1vDc9mm4God5VBvf8Vm/1CQ2SWje8JprbT lm2VDEfsX+cRgSNllV9CttHQ2yAyMjGwW2pMOjklhbFXBnxGWLOBa3fbSTUdfc0b9LHv BS3vBOttxpxXTWaXpOYyhVCE+eVQjs/v1OFbjsFlicdOV4KPsflV3wSPARYfM/p69Gwc 9ba22vJ7F4iwJX+Sc1Red+hWU7mQ+5gjh0g8s66FxgFLCTsR+z93OaIlEIJPcgUdBpjd tEUFiFssvEuGYwUuv8jtVZyyIKeHWCjcLqoxQ/vaq8wBXMRKSBSdtjPBDxFEDqJm4wV1 PSbQ== X-Gm-Message-State: AOAM532B3PraIdEbbNtcnr1upXNOWMSZwC7icwsKEXtPkMjCGyJLzJ/7 wG550G+1FGIwQdhylpwfclqqWA== X-Google-Smtp-Source: ABdhPJzDmaYput0+2I/O1kU2zs3mEXvQqpCWyb5EXW087B44bECugknyBhMF2ujhWwRBgLYQnHpzGw== X-Received: by 2002:a17:902:c412:b0:161:af8b:f478 with SMTP id k18-20020a170902c41200b00161af8bf478mr21092064plk.67.1653274235293; Sun, 22 May 2022 19:50:35 -0700 (PDT) Original-Received: from anant ([49.36.236.57]) by smtp.gmail.com with ESMTPSA id i5-20020a170902eb4500b0015e8d4eb248sm858872pli.146.2022.05.22.19.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 19:50:34 -0700 (PDT) Mail-Followup-To: "J.P." , 51753@debbugs.gnu.org, emacs-erc@gnu.org In-Reply-To: <87a6b92ers.fsf@neverwas.me> (J. P.'s message of "Sun, 22 May 2022 18:56:07 -0700") 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:232925 gmane.emacs.erc.general:1844 Archived-At: "J.P." writes: > Are you saying ERC ought to remember the frame in which an entry-point > command, like `erc-tls', was originally invoked? Or might it be enough > to make a best effort attempt at finding such a "dedicated" frame? I have tried the #2 as specified below. I kind of agree that #1 will result in the desired behaviour. > If it's door #2, what if we used the first frame found containing a > buffer belonging to the same connection (and if no such frame exists, > just leave it up to the display-buffer gods)? This way, we could rely > more fully on window.el facilities and avoid having to wrangle yet more > state. Or, if really necessary, we could maybe fall back on a strategy > that uses `window-prev-buffers' (or whatever) to find the most recently > used frame for that connection (overkill, IMO). Either way, any solution > would need to address not just autojoined channels but also > server-initiated JOINs, PMs, etc. > > The attached patch claims to do something like I've described. If you're > able to try it, please set these options beforehand: > > (setq erc-join-buffer 'frame > erc-auto-query 'frame > erc-query-display 'frame > erc-reuse-frames 'displayed) > > If you're unable to try it, please let me know, and I can maybe add it > temporarily to one of ERC's installable bug packages. I tried this and here is what is happening. I launched emacs then I launched another frame and M-x erc-tls and come back to the 1st frame for other work. "erc-tls" running fine in the other frame but when it starts to join autojoin channels after connecting, it creates one more frame for each channel instead of reusing the 2nd frame.