erc-discuss
[Top][All Lists]
Advanced

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

Re: [Erc-discuss] erc-kill-buffer-stay


From: Bad Blue Bull
Subject: Re: [Erc-discuss] erc-kill-buffer-stay
Date: Wed, 27 Feb 2019 01:31:52 +0300

I don't know, see erc.el:
 
(defcustom erc-kill-buffer-on-part nil
  "Kill the channel buffer on PART.
This variable should probably stay nil, as ERC can reuse buffers if
you rejoin them later."
  :group 'erc-quit-and-part
  :type 'boolean)
 
But I don't see this variable to be used in the source  (despite it's value is changed to t somewhere in my Emacs session).  But if I part a channel and evaluate length of buffer-list get's decreased.


26.02.2019, 22:15, "Emanuel Berg" <address@hidden>:

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 mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/erc-discuss


reply via email to

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