From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#51753: ERC switches to channel buffer on reconnect Date: Fri, 19 Nov 2021 12:45:14 +0100 Message-ID: References: <877ddfgz8q.fsf__46160.5365084083$1636600524$gmane$org@neverwas.me> <87bl2re5eg.fsf@gnus.org> <87lf1ve0m4.fsf@neverwas.me> <877ddf9sht.fsf@gnus.org> <87czmwjutj.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15327"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51753@debbugs.gnu.org, emacs-erc@gnu.org, Amin Bandali To: "J.P." , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 19 12:46:14 2021 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 1mo2LO-0003hQ-10 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Nov 2021 12:46:14 +0100 Original-Received: from localhost ([::1]:50870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo2LM-0000xe-9H for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Nov 2021 06:46:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo2LC-0000xJ-S9 for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 06:46:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54932) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mo2LC-0002GQ-Jn for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 06:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mo2LC-0006QY-3O for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 06:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Nov 2021 11:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51753 X-GNU-PR-Package: emacs Original-Received: via spool by 51753-submit@debbugs.gnu.org id=B51753.163732232224641 (code B ref 51753); Fri, 19 Nov 2021 11:46:02 +0000 Original-Received: (at 51753) by debbugs.gnu.org; 19 Nov 2021 11:45:22 +0000 Original-Received: from localhost ([127.0.0.1]:38243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mo2KX-0006PN-U6 for submit@debbugs.gnu.org; Fri, 19 Nov 2021 06:45:22 -0500 Original-Received: from mail-pf1-f174.google.com ([209.85.210.174]:45654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mo2KW-0006P5-R9 for 51753@debbugs.gnu.org; Fri, 19 Nov 2021 06:45:21 -0500 Original-Received: by mail-pf1-f174.google.com with SMTP id x131so9160762pfc.12 for <51753@debbugs.gnu.org>; Fri, 19 Nov 2021 03:45:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=DYTKuxr16cXwP/GETHJq7dcVY7dR5byMAlWGcr+jOcM=; b=WbjmQmyuRKQekZD/41etW2xj+44Gd2bT2QTCrTNDUTU62ww8fNy2rocF2AHiGnAQdI B7Ao83HSKe3ic98o2CSK+OXABND0nACVgW1biPJq5+jt0m9B14IxYcY3VWewbJXyAmVr Xp2ie9TVxTGOuIXTSOEJidjhS8csQtpe/aCGPpWfSIgm20O+J70KNfKfrkS48+6Vs6kH wZW7QtWTrz2/e+6XOcS+bsKs2V1nYbuxfWlEygSntrNTHEgoL0vAHHGobj0Pj67JB/aK k7VEisCvPOLYS1LaNtABp9nMSwKglomP2WObmsK/lWWnFYUdF1mGhguECQ+0iIGl5KD/ Ywig== X-Gm-Message-State: AOAM532/tKtz/ZLuschA4yTAkLS2o9VGQgJtOh1DLZIeCTbdOR6fujgv WSNhv1wP/NsSw+V7Z/a4jC6wapozW/ik5FgXE4c= X-Google-Smtp-Source: ABdhPJypAe2DQM8cIP3TOffo6+jHDXZwglsfJznwR5ZMQSVmZNkeWxp749ENinqE01xvy7ypeBUu91c5R9WOxogY4Bo= X-Received: by 2002:a63:370c:: with SMTP id e12mr16570969pga.359.1637322314979; Fri, 19 Nov 2021 03:45:14 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 19 Nov 2021 12:45:14 +0100 In-Reply-To: <87czmwjutj.fsf@neverwas.me> 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:220408 Archived-At: tags 51753 + patch thanks "J.P." writes: > I wasn't sure if that meant I was supposed to work on this. If not, > please disregard. You did exactly the right thing here. Thank you for working on this! > Otherwise, the tests are in #48598 [1]. As for the name of the option > itself, I basically punted by going with `erc-reconnect-buffer' to try > and stay close to `erc-join-buffer'. If that doesn't matter, perhaps > `erc-reconnect-display' would be a better fit since we already have an > `erc-query-display' (even though that one's not as closely related). > Anyone with an opinion, please advise. Thanks. On balance, I don't have a strong opinion either way. (I do like `erc-reconnect-display' slightly better, because many variables that end with `-buffer' have to do with the _name_ of some buffer. But it is true that it is also nice to have a name similar to `erc-join-buffer'.) I just have some minor nits below: > +(defvar-local erc--server-last-reconnect-count 0 > + "Snapshot of reconnect count when connection established.") "when the connection was established", perhaps? > +(defcustom erc-reconnect-buffer nil > + "How (and whether) to display a channel buffer upon reconnecting. > + > +This only affects automatic reconnections and is ignored when issuing a > +/reconnect command or reinvoking `erc-tls' with the same args (assuming > +success, of course). See `erc-join-buffer' for a description of > +possible values." > + :group 'erc-buffers > + :type '(choice (const :tag "Use value of `erc-join-buffer'" nil) > + (const :tag "Split window and select" window) > + (const :tag "Split window, don't select" window-noselect) > + (const :tag "New frame" frame) > + (const :tag "Bury in new buffer" bury) > + (const :tag "Use current buffer" buffer) > + (const :tag "Use current buffer" t))) What is the difference between `buffer' and t? Should they really have the same :tag? If they are just two names for the same thing, I suggest we drop one of them. Other than that, LGTM (but I didn't test it).