Commit a63067fc authored by Deniz Dogan's avatar Deniz Dogan Committed by Lars Magne Ingebrigtsen

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
parent 68d32a51
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
......
......@@ -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."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment