+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
: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)
: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."