From 8dfc6122ca9733caf2ab0012c63d51ffb02abafd Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 18 Sep 2000 02:46:45 +0000 Subject: [PATCH] * liece.el (liece-open-server-internal): Simplify. (liece-open-server): Strip bracketed server name here. (liece-start-server): Fix last change. --- lisp/ChangeLog | 6 ++++++ lisp/liece.el | 55 ++++++++++++++++++++++++------------------------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 68c75b7..c1fcb65 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2000-09-18 Daiki Ueno + + * liece.el (liece-open-server-internal): Simplify. + (liece-open-server): Strip bracketed server name here. + (liece-start-server): Fix last change. + 2000-09-17 Daiki Ueno * liece-vars.el (liece-highlight-mode): Set default to t. diff --git a/lisp/liece.el b/lisp/liece.el index e798957..7471440 100644 --- a/lisp/liece.el +++ b/lisp/liece.el @@ -346,13 +346,13 @@ is running on." (unless (listp liece-server) (let ((entry (assoc liece-server liece-server-alist))) (if entry - (setq liece-server (cdr entry))) - (setq liece-server - (let ((plist (liece-server-parse-string liece-server))) - (unless entry - (set-alist 'liece-server-alist liece-server plist) - (setq liece-save-variables-are-dirty t)) - plist)))) + (if (listp (cdr entry)) + (setq liece-server (cdr entry)) + (setq liece-server (liece-server-parse-string (cdr entry)))) + (let ((plist (liece-server-parse-string liece-server))) + (set-alist 'liece-server-alist liece-server plist) + (setq liece-save-variables-are-dirty t) + (setq liece-server plist))))) (when (or (and confirm liece-ask-for-nickname) (null liece-nickname)) (setq liece-nickname (read-string (_ "Enter your nickname: ") liece-nickname))) @@ -444,7 +444,9 @@ If optional argument SERVICE is non-nil, open by the service name." (if (and (memq type '(rlogin telnet)) relay) (setq liece-tcp-relay-host relay)) (setq liece-tmp-server-name host) - (liece-open-server-internal host service type) + (unless (string-match "^[^\\[]" host) + (setq host (substring host 1 (1- (length host))))) + (setq liece-server-process (liece-open-server-internal host service type)) (setq liece-after-registration nil) (liece-maybe-poll) (if (null (liece-wait-for-response "^:[^ ]+ [4P][5O][1N][ G]")) @@ -481,29 +483,20 @@ If optional argument SERVICE is non-nil, open by the service name." (defun liece-open-server-internal (host &optional service type) "Open connection to chat server on HOST by SERVICE (default is irc). Optional argument TYPE specifies connection types such as `program'." - ;; canonicalize host representation - (unless (string-match "^[^\\[]" host) - (setq host (substring host 1 (1- (length host))))) - (condition-case error - (save-excursion - (let ((liece-tcp-connection-type type)) - (as-binary-process - (setq liece-server-process - (liece-open-network-stream - "IRC" " *IRC*" host (or service "irc")))) - (setq liece-server-buffer (process-buffer liece-server-process)) - (set-buffer liece-server-buffer) - (set-buffer-multibyte nil) - (kill-all-local-variables) - (buffer-disable-undo) - (erase-buffer) - (setq liece-server-name host) - (run-hooks 'liece-server-hook) - ;; return the server process - liece-server-process)) - (error - (setq liece-status-message-string (cadr error) - liece-server-process nil)))) + (let ((liece-tcp-connection-type type) + process) + (as-binary-process + (setq process + (liece-open-network-stream + "IRC" " *IRC*" host (or service "irc")))) + (setq liece-server-buffer (process-buffer process)) + (save-excursion + (set-buffer liece-server-buffer) + (set-buffer-multibyte nil) + (kill-all-local-variables) + (buffer-disable-undo) + (erase-buffer)) + process)) (defun liece-initialize-timers () "Initialise internal timers." -- 1.7.10.4