From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#54718: 28.0.92; rcirc channel-vs-log buffer confusion Date: Tue, 05 Apr 2022 10:03:49 +0000 Message-ID: <874k379796.fsf@posteo.net> References: <877d84qxz6.fsf@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1529"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54718@debbugs.gnu.org To: Ken Raeburn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 05 12:05:27 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 1nbg3y-00005t-Ka for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Apr 2022 12:05:26 +0200 Original-Received: from localhost ([::1]:34846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbg3w-0007OA-C1 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Apr 2022 06:05:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbg3b-0007O2-3p for bug-gnu-emacs@gnu.org; Tue, 05 Apr 2022 06:05:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nbg3a-0006FA-QW for bug-gnu-emacs@gnu.org; Tue, 05 Apr 2022 06:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nbg3a-0004nr-En for bug-gnu-emacs@gnu.org; Tue, 05 Apr 2022 06:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Apr 2022 10:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54718 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164915304718379 (code B ref -1); Tue, 05 Apr 2022 10:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Apr 2022 10:04:07 +0000 Original-Received: from localhost ([127.0.0.1]:53769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbg2g-0004mN-PL for submit@debbugs.gnu.org; Tue, 05 Apr 2022 06:04:07 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:50594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbg2e-0004mF-Qi for submit@debbugs.gnu.org; Tue, 05 Apr 2022 06:04:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbg2e-0007LK-I0 for bug-gnu-emacs@gnu.org; Tue, 05 Apr 2022 06:04:04 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:36845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbg2c-000690-8m for bug-gnu-emacs@gnu.org; Tue, 05 Apr 2022 06:04:04 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id EC55F240033 for ; Tue, 5 Apr 2022 12:03:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1649153040; bh=e4DtH618IB3pDZedLBUkRHDF1kxnLMitl5SWZ0WC67Q=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=Th89LeCFA/1VIXzNGR9CZDiBgsIuGjRVVHJZrgJUszZE4CtkcpZlc77rpENzFb6sF Q+iAV+m2cl4OOL0ZeN1YvIEybLOW+60KcWMVUILQATn5LH7ORAkeiErtDz5LUybV4W aZ3Ii8QkOIa7zMw1qZdOTsFIeF+3IR3I//M2jYnYSNZWE4gaoVjmOAc2gt/1xZC1B1 /5hMQHLljTcobnBKQHQvHMJJPRr8U8XRqHyWe/ieYgizVer0mx9MzcKpktUa4eNry3 c7Uh98rZw+cyuBX6tX/CdQBM1kFpHvzHV5WC3uUEKg5ThJIRc9ywa5D3BDa/mnnhqz d/2K5TxLaJ48A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KXjsQ6JJCz9rxh; Tue, 5 Apr 2022 12:03:54 +0200 (CEST) In-Reply-To: <877d84qxz6.fsf@redhat.com> (Ken Raeburn's message of "Mon, 04 Apr 2022 18:34:37 -0400") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:229434 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ken Raeburn writes: > I=E2=80=99m using rcirc, and have logging turned on. When I started up > rcirc, I already had one of the log files > (~/.emacs.d/rcirc-log/#gnucash@irc.gnome.org) being viewed in a > buffer. That buffer, sensibly enough, was named > =E2=80=9C#gnucash@irc.gnome.org=E2=80=9D. Once rcirc connected to irc.g= nome.org, and > joined my channels, it looked for a buffer named > =E2=80=9C#gnucash@irc.gnome.org=E2=80=9D, assumed that that was its own b= uffer for > showing channel messages, switched it to rcirc mode, and started > adding to it. So now, the buffer starts off: 2022-04-04T18:01:18 > *** raeburn JOIN > 2022-04-04T18:01:18 *** ChanServ MODE +v raeburn > 2022-04-04T18:01:18 *** TOPIC Free GPL Personal and Small Business > Accounting=E2=80=A6 > 2022-04-04T18:01:18 *** NAMES =E2=80=A6 > 2021-11-01T13:49:16 *** sbluhm JOIN 2021-11-01T13:50:25 *** > Mechtilde QUIT Ping timeout: 180 seconds > 2021-11-01T14:10:13 *** jervin QUIT Quit: jervin > [...] > I can probably work around this by tweaking desktop-files-not-to-save so > I don=E2=80=99t accidentally hit this when restarting Emacs, but (1) I do= want > to be able to look at a log file and preserve my position in it from > session to session, and (2) manually pulling up a log file before > starting rcirc would still trigger the same lossage. It might help to add rcirc-mode to desktop-modes-not-to-save, but you are right the fundamental issue still is that rcirc can get confused by specific buffer names. One solution might just be to wrap the body of rcirc-generate-new-buffer-name in a generate-new-buffer call, so as to avoid these issue. IIRC there should be no issue if the buffer name for a rcirc chat buffer has a modified name, as the buffer objects all managed via rcirc-buffer-alist and rcirc-get-buffer. Could you try applying this patch to see if this improves the situation, or if some other issues arise: --=-=-= Content-Type: text/plain Content-Disposition: inline diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 859dc175e5..1f82924d98 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -1556,10 +1556,11 @@ rcirc-clean-up-buffer (defun rcirc-generate-new-buffer-name (process target) "Return a buffer name based on PROCESS and TARGET. This is used for the initial name given to IRC buffers." - (substring-no-properties - (if target - (concat target "@" (process-name process)) - (concat "*" (process-name process) "*")))) + (generate-new-buffer + (substring-no-properties + (if target + (concat target "@" (process-name process)) + (concat "*" (process-name process) "*"))))) (defun rcirc-get-buffer (process target &optional server) "Return the buffer associated with the PROCESS and TARGET. --=-=-= Content-Type: text/plain -- Philip Kaludercic --=-=-=--