* riece-irc.el (riece-irc-open-server): Display error message if
authorueno <ueno>
Mon, 23 Aug 2004 08:03:24 +0000 (08:03 +0000)
committerueno <ueno>
Mon, 23 Aug 2004 08:03:24 +0000 (08:03 +0000)
connection-function fails.
* riece-server.el (riece-open-server): Ignore errors from
riece-*-open-server function.
* riece.el (riece): If no server process is available, exit
immediately.

lisp/ChangeLog
lisp/riece-irc.el
lisp/riece-server.el
lisp/riece.el

index 515d8d4..1e501ab 100644 (file)
@@ -1,3 +1,12 @@
+2004-08-23  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-irc.el (riece-irc-open-server): Display error message if
+       connection-function fails.
+       * riece-server.el (riece-open-server): Ignore errors from
+       riece-*-open-server function.
+       * riece.el (riece): If no server process is available, exit
+       immediately.
+
 2004-08-19  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-handle.el (riece-handle-quit-message): Pass
index f44e199..4126e7d 100644 (file)
       (if (equal server-name "")
          (message "Connecting to IRC server...")
        (message "Connecting to %s..." server-name))
-      (setq process
-           (funcall function (riece-server-process-name server-name)
-                    (concat " *IRC*" server-name)
-                    host service))
+      (condition-case error
+         (setq process
+               (funcall function (riece-server-process-name server-name)
+                        (concat " *IRC*" server-name)
+                        host service))
+       (error
+        (if (equal server-name "")
+            (message "Connecting to IRC server...failed: %S" error)
+          (message "Connecting to %s...failed: %S" server-name error))
+        (signal (car error) (cdr error))))
       (if (equal server-name "")
          (message "Connecting to IRC server...done")
        (message "Connecting to %s...done" server-name))
index 1500d46..63851f7 100644 (file)
@@ -140,7 +140,9 @@ the `riece-server-keyword-map' variable."
                                        "-open-server")))
     (unless function
       (error "\"%S\" is not supported" protocol))
-    (setq process (funcall function server server-name))
+    (condition-case nil
+       (setq process (funcall function server server-name))
+      (error))
     (when process
       (with-current-buffer (process-buffer process)
        (make-local-variable 'riece-protocol)
index e1f0ac2..519e996 100644 (file)
@@ -303,18 +303,21 @@ If optional argument CONFIRM is non-nil, ask which IRC server to connect."
     (riece-display-connect-signals)
     (riece-redisplay-buffers)
     (riece-open-server riece-server "")
-    (let ((server-list riece-startup-server-list))
-      (while server-list
-       (riece-command-open-server (car server-list))
-       (setq server-list (cdr server-list))))
-    (let ((pointer riece-addons))
-      (while pointer
-       (unless (get (car pointer) 'riece-addon-default-disabled)
-         (riece-enable-addon (car pointer) riece-debug))
-       (setq pointer (cdr pointer))))
-    (run-hooks 'riece-startup-hook)
-    (message "%s" (substitute-command-keys
-                  "Type \\[describe-mode] for help"))))
+    ;; If no server process is available, exit.
+    (if (null riece-server-process-alist)
+       (riece-exit)
+      (let ((server-list riece-startup-server-list))
+       (while server-list
+         (riece-command-open-server (car server-list))
+         (setq server-list (cdr server-list))))
+      (let ((pointer riece-addons))
+       (while pointer
+         (unless (get (car pointer) 'riece-addon-default-disabled)
+           (riece-enable-addon (car pointer) riece-debug))
+         (setq pointer (cdr pointer))))
+      (run-hooks 'riece-startup-hook)
+      (message "%s" (substitute-command-keys
+                    "Type \\[describe-mode] for help")))))
 
 (defun riece-shrink-buffer (buffer)
   (save-excursion