š¾ Archived View for idiomdrottning.org āŗ rcirc-soju captured on 2023-01-29 at 03:48:04. Gemini links have been rewritten to link to archived content
ā”ļø Next capture (2023-03-20)
-=-=-=-=-=-=-
Hereās how to detach an rcirc channel when using soju:
(defun-rcirc-command detach (channel) "Detach channel to soju." (interactive "sPart channel: ") (let ((channel (if (> (length channel) 0) channel target))) (rcirc-send-privmsg process "BouncerServ" (format "channel update %s -detached true -reattach-on highlight" channel))))
Soju/rcirc already lets you reattached detached channels with /join, and this lets you type /detach in a channel to detach it. This makes it easy to attach and detach channels. This method works by talking to BouncerServ, if thereās instead some fancy Modern IRC way to do it thatās better, let me know!
Also, rcirc parts the channel when you kill the buffer or change the major mode. To instead detach, change rcirc-clean-up-buffer to this (after definining detach as per above):
(defun rcirc-clean-up-buffer (reason) (let ((buffer (current-buffer))) (rcirc-clear-activity buffer) (when (and (rcirc-buffer-process) (rcirc--connection-open-p (rcirc-buffer-process))) (with-rcirc-server-buffer (setq rcirc-buffer-alist (rassq-delete-all buffer rcirc-buffer-alist))) (rcirc-update-short-buffer-names) (when (rcirc-channel-p rcirc-target) (rcirc-cmd-detach rcirc-target))) (setq rcirc-target nil)))