(cf. the last paragraph of `kill-buffer' docstring)
[riece] / lisp / riece-server.el
index 9a47c35..20aedf8 100644 (file)
@@ -112,10 +112,9 @@ the `riece-server-keyword-map' variable."
           (coding-system-for-write 'binary)
           (process
            (funcall function "IRC"
-                    (get-buffer-create
-                     (if server-name
-                         (format " *IRC*%s" server-name)
-                       " *IRC*"))
+                    (if server-name
+                        (format " *IRC*%s" server-name)
+                      " *IRC*")
                     host service)))
       (riece-reset-process-buffer process)
       (with-current-buffer (process-buffer process)
@@ -178,14 +177,14 @@ the `riece-server-keyword-map' variable."
       (set-process-filter process nil))
   (if (eq 'riece-sentinel (process-sentinel process))
       (set-process-sentinel process nil))
-  (when (memq (process-status process) '(open run))
-    (riece-process-send-string process
-                              (if quit-message
-                                  (format "QUIT :%s\r\n" quit-message)
-                                "QUIT\r\n"))
-    (unless riece-debug
-      (kill-buffer (process-buffer process))))
-  (delete-process process))
+  (if (memq (process-status process) '(open run))
+      (riece-process-send-string process
+                                (if quit-message
+                                    (format "QUIT :%s\r\n" quit-message)
+                                  "QUIT\r\n")))
+  (if riece-debug
+      (delete-process process)
+    (kill-buffer (process-buffer process))))
 
 (eval-when-compile
   (autoload 'riece-exit "riece"))