From: Emanuel Berg <moasenwood@zoho.eu>
To: help-gnu-emacs@gnu.org
Cc: erc-discuss@gnu.org
Subject: erc-kill-buffer-stay
Date: Tue, 26 Feb 2019 20:13:24 +0100 [thread overview]
Message-ID: <86ef7uuzvv.fsf@zoho.eu> (raw)
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
next reply other threads:[~2019-02-26 19:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 19:13 Emanuel Berg [this message]
2019-02-26 19:38 ` erc-kill-buffer-stay Bob Proulx
2019-02-27 8:58 ` erc-kill-buffer-stay Emanuel Berg
2019-03-01 16:33 ` erc-kill-buffer-stay Emanuel Berg
2019-02-26 20:43 ` erc-kill-buffer-stay Bad Blue Bull
2019-02-26 20:50 ` erc-kill-buffer-stay Emanuel Berg
2019-02-26 22:31 ` erc-kill-buffer-stay Bad Blue Bull
2019-02-27 8:59 ` erc-kill-buffer-stay Emanuel Berg
2019-03-13 20:33 ` erc-kill-buffer-stay Emanuel Berg
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ef7uuzvv.fsf@zoho.eu \
--to=moasenwood@zoho.eu \
--cc=erc-discuss@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).