* liece.el (liece-open-server-internal): Simplify.
authorueno <ueno>
Mon, 18 Sep 2000 02:46:45 +0000 (02:46 +0000)
committerueno <ueno>
Mon, 18 Sep 2000 02:46:45 +0000 (02:46 +0000)
(liece-open-server): Strip bracketed server name here.
(liece-start-server): Fix last change.

lisp/ChangeLog
lisp/liece.el

index 68c75b7..c1fcb65 100644 (file)
@@ -1,3 +1,9 @@
+2000-09-18   Daiki Ueno  <ueno@unixuser.org>
+
+       * 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  <ueno@unixuser.org>
 
        * liece-vars.el (liece-highlight-mode): Set default to t.
index e798957..7471440 100644 (file)
@@ -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."