* riece-options.el (riece-quit-timeout): New user option.
authorueno <ueno>
Sun, 17 Aug 2003 09:41:09 +0000 (09:41 +0000)
committerueno <ueno>
Sun, 17 Aug 2003 09:41:09 +0000 (09:41 +0000)
* riece-server.el (riece-quit-server-process): New function.
* riece-commands.el (riece-command-quit): Use it.
(riece-command-close-server): Use it.

* riece-commands.el (riece-command-previous-channel): Skip nil in
riece-current-channels.

lisp/ChangeLog
lisp/riece-commands.el
lisp/riece-options.el
lisp/riece-server.el

index 72baf78..e2f91f6 100644 (file)
@@ -1,3 +1,15 @@
+2003-08-17  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-options.el (riece-quit-timeout): New user option.
+       * riece-server.el (riece-quit-server-process): New function.
+       * riece-commands.el (riece-command-quit): Use it.
+       (riece-command-close-server): Use it.
+
+2003-08-17  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-commands.el (riece-command-previous-channel): Skip nil in
+       riece-current-channels.
+
 2003-08-09  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-rdcc.el (riece-command-dcc-send): Accept output only from
index 2c8cb1a..67d3e22 100644 (file)
@@ -89,7 +89,8 @@
          (start riece-current-channels)
          channel)
       (while (and start (not (eq start pointer)))
-       (setq channel (car start))
+       (if (car start)
+           (setq channel (car start)))
        (setq start (cdr start)))
       (when (null channel)
        (setq start (copy-sequence riece-current-channels))
@@ -564,10 +565,7 @@ If prefix argument ARG is non-nil, toggle frozen status."
                   (riece-extended-version))))
            (process-list riece-process-list))
        (while process-list
-         (riece-process-send-string (car process-list)
-                                    (if message
-                                      (format "QUIT :%s\r\n" message)
-                                    "QUIT\r\n"))
+         (riece-quit-server-process (car process-list) message)
          (setq process-list (cdr process-list))))))
 
 (defun riece-command-raw (command)
@@ -617,10 +615,7 @@ If prefix argument ARG is non-nil, toggle frozen status."
             (read-string "Message: ")
           (or riece-quit-message
               (riece-extended-version)))))
-  (riece-process-send-string (riece-server-process server-name)
-                            (if message
-                                (format "QUIT :%s\r\n" message)
-                              "QUIT\r\n")))
+  (riece-quit-server-process (riece-server-process server-name) message))
 
 (defun riece-command-universal-server-name-argument ()
   (interactive)
index 333fd5c..e76b3bb 100644 (file)
@@ -182,6 +182,11 @@ way is to put Riece variables on .emacs or file loaded from there."
   :type 'boolean
   :group 'riece-server)
 
+(defcustom riece-quit-timeout 60
+  "Quit timeout when there is no response from server."
+  :type 'integer
+  :group 'riece-server)
+
 (defcustom riece-channel-buffer-mode t
   "When non-nil, Riece will display a channel buffer."
   :type 'boolean
index d750824..3d6e366 100644 (file)
@@ -217,6 +217,17 @@ the `riece-server-keyword-map' variable."
            (throw 'found t))
        (setq process-list (cdr process-list))))))
 
+(defun riece-quit-server-process (process &optional message)
+  (run-at-time riece-quit-timeout nil
+              (lambda (process)
+                (if (memq process riece-process-list)
+                    (kill-process (process-buffer process))))
+              process)
+  (riece-process-send-string process
+                            (if message
+                                (format "QUIT :%s\r\n" message)
+                              "QUIT\r\n")))
+
 (provide 'riece-server)
 
 ;;; riece-server.el ends here