[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "*** #debian: You're not on that channel"

From: Emanuel Berg
Subject: Re: "*** #debian: You're not on that channel"
Date: Wed, 26 Jan 2022 22:30:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

J.P. wrote:

>> Messages like this
>>   *** #debian: You're not on that channel
>> appear when I leave channels. I don't know why?
> Looks like that's ERR_NOTONCHANNEL (442) [1]. Are you
> connected to multiple networks when this happens?


> And how are you leaving these channels, by issuing manual
> /PARTs in the channel buffers themselves?

I do it like this ... :)

;;; -*- lexical-binding: t -*-
;;; this file:
;;;   http://user.it.uu.se/~embe8573/emacs-init/erc/erc-kill.el
;;;   https://dataswamp.org/~incal/emacs-init/erc/erc-kill.el

(require 'cl-lib)
(require 'erc)

(defun erc-kill ()
  (dolist (_ (erc-buffer-list))
    (erc-cmd-PART "")
    (kill-buffer) ))

(defun erc-kill-buffer-cycle ()
  (let ((erc-buffers (erc-buffer-list)))
    (if (= 1 (length erc-buffers))
      (let ((current-buffer (current-buffer)))
         for b in erc-buffers
         when (not (eq b current-buffer))
         do (erc-cmd-PART "")
            (switch-to-buffer b)
            (cl-return) )))))

(defun erc-kill-buffer-stay ()
  "Close the current ERC buffer,
i.e. leave the channel or one-on-one conversation,
but stay in ERC."
  (when (or (not (erc-server-process-alive))
            (= ?y (read-char "y to leave")))
    (erc-kill-buffer-cycle) ))

(provide 'erc-kill)

underground experts united

reply via email to

[Prev in Thread] Current Thread [Next in Thread]