(riece-command-quit): Clean up if no server process is available.
authorueno <ueno>
Sun, 26 Oct 2003 01:52:31 +0000 (01:52 +0000)
committerueno <ueno>
Sun, 26 Oct 2003 01:52:31 +0000 (01:52 +0000)
lisp/ChangeLog
lisp/riece-commands.el

index f164562..828554f 100644 (file)
@@ -6,6 +6,7 @@
        riece-command-nick-scroll-up.
        (riece-command-scroll-down): Check if riece-current-channel is bound.
        (riece-command-scroll-up): Ditto.
+       (riece-command-quit): Clean up if no server process is available.
 
 2003-10-25  Daiki Ueno  <ueno@unixuser.org>
 
index 9a52c04..4994a8f 100644 (file)
@@ -577,19 +577,24 @@ If prefix argument ARG is non-nil, toggle frozen status."
   (riece-update-status-indicators)
   (force-mode-line-update t))
 
+(eval-when-compile
+  (autoload 'riece-exit "riece"))
 (defun riece-command-quit (&optional arg)
   "Quit IRC."
   (interactive "P")
   (if (y-or-n-p "Really quit IRC? ")
-      (let ((message
-            (if arg
-                (read-string "Message: ")
-              (or riece-quit-message
-                  (riece-extended-version))))
-           (alist riece-server-process-alist))
-       (while alist
-         (riece-quit-server-process (cdr (car alist)) message)
-         (setq alist (cdr alist))))))
+      (if riece-server-process-alist
+         (let ((message
+                (if arg
+                    (read-string "Message: ")
+                  (or riece-quit-message
+                      (riece-extended-version))))
+               (alist riece-server-process-alist))
+           (while alist
+             (riece-quit-server-process (cdr (car alist)) message)
+             (setq alist (cdr alist))))
+       ;; If no server process is available, exit immediately.
+       (riece-exit))))
 
 (defun riece-command-raw (command)
   "Enter raw IRC command, which is sent to the server."