all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Ken Raeburn <raeburn@redhat.com>
Cc: 54718@debbugs.gnu.org
Subject: bug#54718: 28.0.92; rcirc channel-vs-log buffer confusion
Date: Tue, 05 Apr 2022 10:03:49 +0000	[thread overview]
Message-ID: <874k379796.fsf@posteo.net> (raw)
In-Reply-To: <877d84qxz6.fsf@redhat.com> (Ken Raeburn's message of "Mon, 04 Apr 2022 18:34:37 -0400")

[-- Attachment #1: Type: text/plain, Size: 1962 bytes --]

Ken Raeburn <raeburn@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@irc.gnome.org) being viewed in a
> buffer. That buffer, sensibly enough, was named
> “#gnucash@irc.gnome.org”.   Once rcirc connected to irc.gnome.org, and
> joined my channels, it looked for a buffer named
> “#gnucash@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:


[-- Attachment #2: Type: text/plain, Size: 787 bytes --]

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.

[-- Attachment #3: Type: text/plain, Size: 24 bytes --]


-- 
	Philip Kaludercic

  reply	other threads:[~2022-04-05 10:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04 22:34 bug#54718: 28.0.92; rcirc channel-vs-log buffer confusion Ken Raeburn
2022-04-05 10:03 ` Philip Kaludercic [this message]
2022-09-06 11:21   ` Lars Ingebrigtsen
2022-10-04 11:46     ` Lars Ingebrigtsen
2022-10-05 17:31       ` Philip Kaludercic
2022-10-06 11:32         ` Philip Kaludercic
2022-10-14 18:13           ` Philip Kaludercic
2022-11-04 22:53           ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k379796.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=54718@debbugs.gnu.org \
    --cc=raeburn@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.