emacs-erc
[Top][All Lists]
Advanced

[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: Mon, 31 Jan 2022 04:26:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Emanuel Berg via General discussion about ERC wrote:

> J.P. wrote:
>
>>> (defun erc-kill-buffer-cycle ()
>>>   (let ((erc-buffers (erc-buffer-list)))
>>>     (if (= 1 (length erc-buffers))
>>>         (kill-buffer)
>>>       (let ((current-buffer (current-buffer)))
>>>         (cl-loop
>>>          for b in erc-buffers
>>>          when (not (eq b current-buffer))
>>>          do (erc-cmd-PART "")
>>>             (kill-buffer)
>>>             (switch-to-buffer b)
>>>             (cl-return) )))))
>>
>> It looks as though you originally meant to make each
>> b current in the loop body. [...]
>
> The purpose, and this also happens, is to kill the current
> ERC buffer and switch to another ERC buffer.

I think the problem was I did both

  (erc-cmd-PART "")

and

  (kill-buffer)

Now it looks like this

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

and I don't get that message.

BTW `erc-cmd-PART' could have LINE optional with the empty
string behavior being the default.

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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