Subject: [PATCH] Dangling channels' buffer
From: Daimrod <[email-masked]>
To: [email-masked]
Date: Fri, 13 Jun 2014 19:41:55 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

In the attached patch, I propose a fix for the recent change of the
function `rcirc-buffer-process'. This function used to return the rcirc
server process when it existed, or nil. However, since a78d87e7ed it
raises an error.

This is a problem if the user kills the server buffer before it kills
the channels' buffer because it is not possible to kill them after that.
(The function `rcirc-clean-up-buffer' is called via `kill-buffer-hook'
and it calls `rcirc-buffer-process'.)

WDYT?

Regards,

From 2ce0be284dc8830c3153d60cb0b01e082ab1c5b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= <[email-masked]>
Date: Fri, 13 Jun 2014 18:31:31 +0900
Subject: [PATCH] * lisp/net/rcirc.el (rcirc-clean-up-buffer): Explicitly check
 for the   `rcirc-server-buffer'

Since a78d87e7ed, `rcirc-buffer-process' raises an error instead of
returning nil when the `rcirc-server-buffer' doesn't exist.

Because of this, it was impossible to delete channels' buffer once the
`rcirc-server-buffer' has been deleted.
---
 lisp/net/rcirc.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 41cc002..57a90de 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1158,7 +1158,7 @@ with it."
 (defun rcirc-clean-up-buffer (reason)
   (let ((buffer (current-buffer)))
     (rcirc-clear-activity buffer)
-    (when (and (rcirc-buffer-process)
+    (when (and (buffer-live-p rcirc-server-buffer)
 	       (rcirc--connection-open-p (rcirc-buffer-process)))
       (with-rcirc-server-buffer
        (setq rcirc-buffer-alist
-- 
1.8.0.2722.gc0242e5

--
Daimrod/Greg