help-gnu-emacs
[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:

   A

   (defcustom erc-kill-buffer-on-part nil
   A  "Kill the channel buffer on PART.
   This variable should probably stay nil, as ERC can reuse buffers if
   you rejoin them later."
   A  :group 'erc-quit-and-part
   A  :type 'boolean)

   A

   But I don't see this variable to be used in the source A (despite it's
   value is changed to t somewhere in my Emacs session). A But if I part a
   channel and evaluate length of buffer-list get's decreased.

   26.02.2019, 22:15, "Emanuel Berg" <moasenwood@zoho.eu>:

     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 ()
     A A "Close the current ERC buffer (i.e., leave the channel)
     but stay in ERC."
     A A (interactive)
     A A (when (or (not (erc-server-buffer-live-p))
     A A A A A A A A A A A A (= ?y (read-char "press `y' to leave the
     channel")) )
     A A A A (let ((erc-buffers (erc-buffer-list)))
     A A A A A A (if (= 1 (length erc-buffers)) (kill-buffer)
     A A A A A A A A (cl-loop for b in erc-buffers
     A A A A A A A A A A A A A A A A A when (neq b (current-buffer))
     A A A A A A A A A A A A A A A A A do (kill-buffer)
     A A A A A A A A A A A A A A A A A (switch-to-buffer b)
     A A A A A A A A A A A A A A A A A (cl-return) )))))
     More ERC stuff:
     A A A A [1]http://user.it.uu.se/~embe8573/emacs-init/erc-my.el
     --
     underground experts united
     [2]http://user.it.uu.se/~embe8573

     _______________________________________________
     Erc-discuss mailing list
     [3]Erc-discuss@gnu.org
     [4]https://lists.gnu.org/mailman/listinfo/erc-discuss

References

   1. http://user.it.uu.se/~embe8573/emacs-init/erc-my.el
   2. http://user.it.uu.se/~embe8573
   3. mailto:Erc-discuss@gnu.org
   4. https://lists.gnu.org/mailman/listinfo/erc-discuss


reply via email to

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