1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-11 09:20:51 +00:00

Kill channel buffers when killing rcirc server buffers

* net/rcirc.el (rcirc-kill-channel-buffers): New variable.
(rcirc-kill-buffer-hook): Use it to kill channel buffers.

Fixes: debbugs:5128
This commit is contained in:
Deniz Dogan 2012-04-11 16:22:36 +02:00 committed by Lars Magne Ingebrigtsen
parent 68d32a5128
commit a63067fcfe
2 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-04-11 Deniz Dogan <deniz.a.m.dogan@gmail.com>
* net/rcirc.el (rcirc-kill-channel-buffers): New variable.
(rcirc-kill-buffer-hook): Use it to kill channel buffers (bug#5128).
2012-04-11 William Stevenson <yhvh2000@gmail.com>
* textmodes/artist.el (artist-mode): Convert artist-mode to use

View File

@ -361,6 +361,14 @@ of a line. The string is passed as the first argument to
:type 'string
:group 'rcirc)
(defcustom rcirc-kill-channel-buffers nil
"When non-nil, kill channel buffers when the server buffer is killed.
Only the channel buffers associated with the server in question
will be killed."
:version "24.2"
:type 'boolean
:group 'rcirc)
(defvar rcirc-nick nil)
(defvar rcirc-prompt-start-marker nil)
@ -1088,12 +1096,20 @@ Logfiles are kept in `rcirc-log-directory'."
:group 'rcirc)
(defun rcirc-kill-buffer-hook ()
"Part the channel when killing an rcirc buffer."
"Part the channel when killing an rcirc buffer.
If `rcirc-kill-channel-buffers' is non-nil and the killed buffer
is a server buffer, kills all of the channel buffers associated
with it."
(when (eq major-mode 'rcirc-mode)
(when (and rcirc-log-flag
rcirc-log-directory)
(rcirc-log-write))
(rcirc-clean-up-buffer "Killed buffer")))
(rcirc-clean-up-buffer "Killed buffer")
(when (and rcirc-buffer-alist ;; it's a server buffer
rcirc-kill-channel-buffers)
(dolist (channel rcirc-buffer-alist)
(kill-buffer (cdr channel))))))
(defun rcirc-change-major-mode-hook ()
"Part the channel when changing the major-mode."