* liece-commands.el (liece-command-quit): Use `liece-close-server'.
authorueno <ueno>
Mon, 16 Oct 2000 03:41:03 +0000 (03:41 +0000)
committerueno <ueno>
Mon, 16 Oct 2000 03:41:03 +0000 (03:41 +0000)
* liece.el (liece): Simplify.
(liece-close-server): Accept optional argument `quit-string'.

lisp/liece-commands.el
lisp/liece.el

index 29fbedd..e68610d 100644 (file)
@@ -761,9 +761,7 @@ If prefix argument ARG is non-nil, leave signoff message."
           (if arg (read-string (_ "Signoff message: "))
             (or liece-signoff-message
                 (product-name (product-find 'liece-version))))))
-      (if quit-string
-         (liece-send "QUIT :%s" quit-string)
-       (liece-send "QUIT")))))
+      (liece-close-server quit-string))))
 
 (defun liece-command-generic (message)
   "Enter a generic IRC MESSAGE, which is sent to the server.
index d9fa3ae..97c3b23 100644 (file)
@@ -356,7 +356,7 @@ is running on."
        liece-server nil))
 
 ;;;###liece-autoload
-(defun liece-close-server ()
+(defun liece-close-server (&optional quit-string)
   "Close chat server."
   (unwind-protect
       (progn
@@ -366,7 +366,9 @@ is running on."
                       (process-sentinel liece-server-process)))
          (set-process-sentinel liece-server-process nil))
        (if (liece-server-opened)
-           (liece-command-quit)))
+           (if quit-string
+               (liece-send "QUIT :%s" quit-string)
+             (liece-send "QUIT"))))
     (liece-close-server-internal)
     ;; Save settings to the `~/.liece/init.el' file.
     (if liece-save-variables-are-dirty
@@ -542,47 +544,34 @@ If already connected, just pop up the windows."
     (liece-intl-load-catalogue))
   (if (liece-server-opened)
       (liece-configure-windows)
-    (unwind-protect
-       (progn
-         (switch-to-buffer
-          (liece-get-buffer-create liece-command-buffer))
-         (unless (eq major-mode 'liece-command-mode)
-           (liece-command-mode))
-         (unless (liece-server-opened)
-           (liece-start-server confirm)))
-      (if (not (liece-server-opened))
-         (liece-command-quit)
-       ;; IRC server is successfully open.
-       (with-current-buffer liece-command-buffer
-         (setq mode-line-process (concat " " (liece-server-host))))
-       (let (buffer-read-only)
-         (unless liece-keep-buffers
-           (erase-buffer))
-         (sit-for 0))
-
-       (liece-initialize-buffers)
-       (liece-configure-windows)
-       (setq liece-current-channels nil)
-       (cond
-        (liece-current-channel
-         (liece-command-join liece-current-channel))
-        (liece-startup-channel
-         (liece-command-join liece-startup-channel))
-        (liece-startup-channel-list
-         (dolist (chnl liece-startup-channel-list)
-           (if (listp chnl)
-               (liece-command-join (car chnl) (cadr chnl))
-             (liece-command-join chnl)))))
-       (unless (string-equal liece-away-message "")
-         (liece-command-away liece-away-message))
-       (run-hooks 'liece-startup-hook)
-       (setq liece-obarray
-             (or liece-obarray (make-vector liece-obarray-size nil)))
-       (unless liece-timers-list-initialized-p
-         (liece-initialize-timers))
-       (liece-command-timestamp)
-       (message (substitute-command-keys
-                 "Type \\[describe-mode] for help"))))))
+    (switch-to-buffer (liece-get-buffer-create liece-command-buffer))
+    (unless (eq major-mode 'liece-command-mode)
+      (liece-command-mode))
+    (liece-start-server confirm)
+    (let (buffer-read-only)
+      (unless liece-keep-buffers
+       (erase-buffer))
+      (sit-for 0))
+    (liece-initialize-buffers)
+    (liece-configure-windows)
+    (setq liece-current-channels nil)
+    (let ((startup-channels
+          (if liece-startup-channel
+              (list liece-startup-channel)
+            liece-startup-channel-list)))
+      (dolist (chnl startup-channels)
+       (if (listp chnl)
+           (liece-command-join (car chnl) (cadr chnl))
+         (liece-command-join chnl))))
+    (unless (string-equal liece-away-message "")
+      (liece-command-away liece-away-message))
+    (run-hooks 'liece-startup-hook)
+    (setq liece-obarray
+         (or liece-obarray (make-vector liece-obarray-size nil)))
+    (unless liece-timers-list-initialized-p
+      (liece-initialize-timers))
+    (liece-command-timestamp)
+    (message (substitute-command-keys "Type \\[describe-mode] for help"))))
 
 ;;;###liece-autoload
 (defun liece-command-mode ()
@@ -626,7 +615,7 @@ For a list of the generic commands type \\[liece-command-generic] ? RET.
          (copy-syntax-table (syntax-table)))
     (set-syntax-table liece-command-mode-syntax-table)
     (mapcar
-     (function (lambda (c) (modify-syntax-entry c "w")))
+     (lambda (c) (modify-syntax-entry c "w"))
      "^[]{}'`"))
 
   (run-hooks 'liece-command-mode-hook))