[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erc-discuss] erc-kill-buffer-stay
From: |
Emanuel Berg |
Subject: |
[Erc-discuss] erc-kill-buffer-stay |
Date: |
Tue, 26 Feb 2019 20:13:24 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Is something like this already present in ERC?
If so I didn't find it, and I think it is very
handy. Also feel free to suggest improvements
to the code, as alays.
(defun erc-kill-buffer-stay ()
"Close the current ERC buffer (i.e., leave the channel)
but stay in ERC."
(interactive)
(when (or (not (erc-server-buffer-live-p))
(= ?y (read-char "press `y' to leave the channel")) )
(let ((erc-buffers (erc-buffer-list)))
(if (= 1 (length erc-buffers)) (kill-buffer)
(cl-loop for b in erc-buffers
when (neq b (current-buffer))
do (kill-buffer)
(switch-to-buffer b)
(cl-return) )))))
More ERC stuff:
http://user.it.uu.se/~embe8573/emacs-init/erc-my.el
--
underground experts united
http://user.it.uu.se/~embe8573
- [Erc-discuss] erc-kill-buffer-stay,
Emanuel Berg <=