* liece-handle.el (liece-handle-kill-message): Call
authorueno <ueno>
Fri, 22 Sep 2000 08:59:33 +0000 (08:59 +0000)
committerueno <ueno>
Fri, 22 Sep 2000 08:59:33 +0000 (08:59 +0000)
`liece-close-server' instead of `liece-clear-system'.

* liece-commands.el: Don't autoload `liece-window-configuration-pop'.
(liece-command-quit): Just send quit.

* liece.el (liece-close-server): Run `liece-exit-hook'; abolish
argument `quit-string'.

* liece-filter.el (liece-sentinel): Call `liece-close-server'.

lisp/ChangeLog
lisp/liece-commands.el
lisp/liece-filter.el
lisp/liece-handle.el
lisp/liece.el

index c609757..fda1081 100644 (file)
@@ -1,3 +1,16 @@
+2000-09-22   Daiki Ueno  <ueno@unixuser.org>
+
+       * liece-handle.el (liece-handle-kill-message): Call
+       `liece-close-server' instead of `liece-clear-system'.
+
+       * liece-commands.el: Don't autoload `liece-window-configuration-pop'.
+       (liece-command-quit): Just send quit.
+
+       * liece.el (liece-close-server): Run `liece-exit-hook'; abolish
+       argument `quit-string'.
+
+       * liece-filter.el (liece-sentinel): Call `liece-close-server'.
+
 2000-09-20   Daiki Ueno  <ueno@unixuser.org>
 
        * liece-compat.el: Require `wid-edit'.
index 53ab9ec..15053a3 100644 (file)
@@ -39,7 +39,6 @@
 (require 'liece-minibuf)
 
 (autoload 'liece-dcc-chat-send "liece-dcc")
-(autoload 'liece-window-configuration-pop "liece-window")
 
 (autoload 'liece-command-ctcp-version "liece-ctcp" nil t)
 (autoload 'liece-command-ctcp-userinfo "liece-ctcp" nil t)
@@ -760,13 +759,9 @@ 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))))))
-      (liece-close-server quit-string))
-    (liece-clear-system)
-    (if liece-save-variables-are-dirty
-       (liece-command-save-vars))
-    (if (interactive-p)
-       (liece-window-configuration-pop))
-    (run-hooks 'liece-exit-hook)))
+      (if quit-string
+         (liece-send "QUIT :%s" quit-string)
+       (liece-send "QUIT")))))
 
 (defun liece-command-generic (message)
   "Enter a generic IRC MESSAGE, which is sent to the server.
index fa5ef6f..0d6430f 100644 (file)
        (liece-sentinel-error proc status)
       (liece-message (_ "Connection closed. (%s)")
                      (substring status 0 (1- (length status)))))
-    (liece-clear-system))
+    (liece-close-server))
    (liece-reconnect-with-password
     (liece))
    (t
index 18bbfb0..c47fbf8 100644 (file)
     (liece-insert-info (append liece-D-buffer liece-O-buffer)
                        (format "You were killed by %s. (Path: %s. RIP)\n"
                                prefix path)))
-  (liece-clear-system))
+  (liece-close-server))
 
 (defun* liece-handle-join-message (prefix rest)
   (let (flag (xnick prefix) (nick prefix) (chnl rest))
index a8ca428..d9fa3ae 100644 (file)
     "Mapping from keywords to default values.
 All keywords that can be used must be listed here."))
 
-(defadvice save-buffers-kill-emacs
-  (before liece-save-buffers-kill-emacs activate)
-  "Prompt user to quit IRC explicitly."
-  (run-hooks 'liece-before-kill-emacs-hook) )
-
-(add-hook 'liece-before-kill-emacs-hook 'liece-command-quit)
+(add-hook 'kill-emacs-hook 'liece-command-quit)
 
 (defvar liece-tmp-server-name nil "Temporaly server name.")
 (defvar liece-buffer-last-check-time nil)
@@ -361,7 +356,7 @@ is running on."
        liece-server nil))
 
 ;;;###liece-autoload
-(defun liece-close-server (&optional quit-string)
+(defun liece-close-server ()
   "Close chat server."
   (unwind-protect
       (progn
@@ -370,12 +365,17 @@ is running on."
                   (eq 'liece-sentinel
                       (process-sentinel liece-server-process)))
          (set-process-sentinel liece-server-process nil))
-       ;; We cannot send QUIT command unless the process is running.
-       (when (liece-server-opened)
-         (if quit-string
-             (liece-send "QUIT :%s" quit-string)
-           (liece-send "QUIT"))))
-    (liece-close-server-internal)))
+       (if (liece-server-opened)
+           (liece-command-quit)))
+    (liece-close-server-internal)
+    ;; Save settings to the `~/.liece/init.el' file.
+    (if liece-save-variables-are-dirty
+       (liece-command-save-vars))
+    ;; Reset everything.
+    (liece-clear-system)
+    (liece-window-configuration-pop)
+    ;; Allow the user to do things after cleaning up.
+    (run-hooks 'liece-exit-hook)))
 
 (defmacro liece-server-keyword-bind (plist &rest body)
   "Return a `let' form that binds all variables in PLIST.