From ca36404dde6a11fc2fa74374eb1ab084c4314863 Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 23 Aug 2004 08:03:24 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 9 +++++++++ lisp/riece-irc.el | 14 ++++++++++---- lisp/riece-server.el | 4 +++- lisp/riece.el | 27 +++++++++++++++------------ 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 515d8d4..1e501ab 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2004-08-23 Daiki Ueno + + * 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 * riece-handle.el (riece-handle-quit-message): Pass diff --git a/lisp/riece-irc.el b/lisp/riece-irc.el index f44e199..4126e7d 100644 --- a/lisp/riece-irc.el +++ b/lisp/riece-irc.el @@ -36,10 +36,16 @@ (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)) diff --git a/lisp/riece-server.el b/lisp/riece-server.el index 1500d46..63851f7 100644 --- a/lisp/riece-server.el +++ b/lisp/riece-server.el @@ -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) diff --git a/lisp/riece.el b/lisp/riece.el index e1f0ac2..519e996 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -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 -- 1.7.10.4