* riece.el: Add autoload setting for derived-mode-class.
[riece] / lisp / riece-server.el
index 921a6cd..4164488 100644 (file)
@@ -152,7 +152,10 @@ the `riece-server-keyword-map' variable."
        (message "Logging in to %s..." server-name))
       (if riece-reconnect-with-password        ;password incorrect or not set.
          (unwind-protect
-             (setq password (riece-read-passwd "Password: "))
+             ;; XEmacs signals an error when the keyboard cannot be grabbed.
+             (condition-case nil
+                 (setq password (riece-read-passwd "Password: "))
+               (error))
            (setq riece-reconnect-with-password nil)))
       (if password
          (riece-process-send-string process
@@ -222,14 +225,15 @@ the `riece-server-keyword-map' variable."
 (eval-when-compile
   (autoload 'riece-exit "riece"))
 (defun riece-quit-server-process (process &optional message)
-  (run-at-time riece-quit-timeout nil
-              (lambda (process)
-                (when (rassq process riece-server-process-alist)
-                  (riece-close-server-process process)
-                  ;; If no server process is available, exit.
-                  (unless riece-server-process-alist
-                    (riece-exit))))
-              process)
+  (if riece-quit-timeout
+      (riece-run-at-time riece-quit-timeout nil
+                        (lambda (process)
+                          (when (rassq process riece-server-process-alist)
+                            (riece-close-server-process process)
+                            ;; If no server process is available, exit.
+                            (unless riece-server-process-alist
+                              (riece-exit))))
+                        process))
   (riece-process-send-string process
                             (if message
                                 (format "QUIT :%s\r\n" message)