GNU bug report logs - #54718
28.0.92; rcirc channel-vs-log buffer confusion

Previous Next

Package: emacs;

Reported by: Ken Raeburn <raeburn <at> redhat.com>

Date: Mon, 4 Apr 2022 22:35:01 UTC

Severity: normal

Tags: moreinfo, patch

Found in version 28.0.92

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Ken Raeburn <raeburn <at> redhat.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 28.0.92; rcirc channel-vs-log buffer confusion
Date: Tue, 05 Apr 2022 10:03:49 +0000
[Message part 1 (text/plain, inline)]
Ken Raeburn <raeburn <at> redhat.com> writes:

> I’m 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 <at> irc.gnome.org) being viewed in a
> buffer. That buffer, sensibly enough, was named
> “#gnucash <at> irc.gnome.org”.   Once rcirc connected to irc.gnome.org, and
> joined my channels, it looked for a buffer named
> “#gnucash <at> irc.gnome.org”, assumed that that was its own buffer 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…
>    2022-04-04T18:01:18 *** NAMES …
>    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’t 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:

[Message part 2 (text/plain, 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.
[Message part 3 (text/plain, inline)]
-- 
	Philip Kaludercic

This bug report was last modified 2 years and 198 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.