* riece-filter.el (riece-sentinel): Simplified.
authorueno <ueno>
Sat, 31 May 2003 23:01:44 +0000 (23:01 +0000)
committerueno <ueno>
Sat, 31 May 2003 23:01:44 +0000 (23:01 +0000)
* riece-display.el (riece-user-list-update-buffer): Check the
existence of riece-user-list-buffer.
(riece-channel-list-update-buffer): Check the existence of
riece-channel-list-buffer.
(riece-set-window-points): Ditto.

* riece-commands.el (riece-command-open-server): Simplified.
(riece-command-toggle-channel-buffer-mode): Set
riece-save-variables-are-dirty to t.
(riece-command-toggle-user-list-buffer-mode): Ditto.
(riece-command-toggle-channel-list-buffer-mode): Ditto.

* riece-server.el (riece-start-server): Abolish.
(riece-open-server): Set riece-server-process-alist and
riece-server-process here.

lisp/ChangeLog
lisp/riece-commands.el
lisp/riece-display.el
lisp/riece-filter.el
lisp/riece-server.el
lisp/riece.el

index b3c11a9..79bea4a 100644 (file)
@@ -1,5 +1,25 @@
 2003-05-31  Daiki Ueno  <ueno@unixuser.org>
 
+       * riece-filter.el (riece-sentinel): Simplified.
+
+       * riece-display.el (riece-user-list-update-buffer): Check the
+       existence of riece-user-list-buffer.
+       (riece-channel-list-update-buffer): Check the existence of
+       riece-channel-list-buffer.
+       (riece-set-window-points): Ditto.
+
+       * riece-commands.el (riece-command-open-server): Simplified.
+       (riece-command-toggle-channel-buffer-mode): Set
+       riece-save-variables-are-dirty to t.
+       (riece-command-toggle-user-list-buffer-mode): Ditto.
+       (riece-command-toggle-channel-list-buffer-mode): Ditto.
+
+       * riece-server.el (riece-start-server): Abolish.
+       (riece-open-server): Set riece-server-process-alist and
+       riece-server-process here.
+
+2003-05-31  Daiki Ueno  <ueno@unixuser.org>
+
        * riece-filter.el (riece-sentinel): Close process even if
        riece-reconnect-with-password == t.
        (riece-handle-message): Catch errors occured in hooks.
index 3661cfb..f5adb10 100644 (file)
 (defun riece-command-toggle-channel-buffer-mode ()
   (interactive)
   (setq riece-channel-buffer-mode
-       (not riece-channel-buffer-mode))
+       (not riece-channel-buffer-mode)
+       riece-save-variables-are-dirty t)
   (riece-command-configure-windows))
 
 (defun riece-command-toggle-user-list-buffer-mode ()
   (interactive)
   (setq riece-user-list-buffer-mode
-       (not riece-user-list-buffer-mode))
+       (not riece-user-list-buffer-mode)
+       riece-save-variables-are-dirty t)
   (riece-command-configure-windows))
 
 (defun riece-command-toggle-channel-list-buffer-mode ()
   (interactive)
   (setq riece-channel-list-buffer-mode
-       (not riece-channel-list-buffer-mode))
+       (not riece-channel-list-buffer-mode)
+       riece-save-variables-are-dirty t)
   (riece-command-configure-windows))
 
 (defun riece-command-finger (user &optional recurse)
@@ -553,14 +556,9 @@ If prefix argument ARG is non-nil, toggle frozen status."
 (defun riece-command-open-server (server-name)
   (interactive
    (list (completing-read "Server: " riece-server-alist)))
-  (let ((process (riece-start-server
-                 (riece-server-name-to-server server-name)
-                 server-name)))
-    (with-current-buffer (process-buffer process)
-      (setq riece-server-name server-name))
-    (setq riece-server-process-alist
-         (cons (cons server-name process)
-               riece-server-process-alist))))
+  (riece-open-server
+   (riece-server-name-to-server server-name)
+   server-name))
 
 (defun riece-command-close-server (server-name &optional message)
   (interactive
index 69fbb3d..f497f5b 100644 (file)
        (unless (riece-frozen riece-user-list-buffer)
          (set-window-start (get-buffer-window riece-user-list-buffer)
                            (point-min)))))
-  (if (get-buffer-window riece-channel-list-buffer)
+  (if (and riece-channel-list-buffer
+          (get-buffer-window riece-channel-list-buffer))
       (with-current-buffer riece-channel-list-buffer
        (unless (riece-frozen riece-channel-list-buffer)
          (set-window-start (get-buffer-window riece-channel-list-buffer)
                            (point-min))))))
 
 (defun riece-user-list-update-buffer ()
-  (if (get-buffer riece-user-list-buffer)
+  (if (and riece-user-list-buffer
+          (get-buffer riece-user-list-buffer))
       (save-excursion
        (set-buffer riece-user-list-buffer)
        (when (and riece-current-channel
              (setq users (cdr users))))))))
 
 (defun riece-channel-list-update-buffer ()
-  (if (get-buffer riece-channel-list-buffer)
+  (if (and riece-channel-list-buffer
+          (get-buffer riece-channel-list-buffer))
       (save-excursion
        (set-buffer riece-channel-list-buffer)
        (let ((inhibit-read-only t)
index 432a018..06a5137 100644 (file)
       (unwind-protect
          (if (eq process riece-server-process)
              (riece)                   ;Need to initialize system.
-           (let* ((entry (rassq process riece-server-process-alist))
-                  (server-name
-                   (with-current-buffer (process-buffer process)
-                     riece-server-name)))
-             (setcdr entry (riece-start-server
-                            (riece-server-name-to-server server-name)
-                            server-name))
-             (riece-close-server-process process)))
+           (let ((server-name
+                  (car (rassq process riece-server-process-alist))))
+             (riece-close-server server-name)
+             (riece-open-server
+              (riece-server-name-to-server server-name)
+              server-name)))
        (setq riece-reconnect-with-password nil))
     (let ((server-name (with-current-buffer (process-buffer process)
                         riece-server-name)))
index b80d333..e0d3742 100644 (file)
@@ -63,15 +63,6 @@ the `riece-server-keyword-map' variable."
 (put 'riece-server-keyword-bind 'lisp-indent-function 1)
 (put 'riece-server-keyword-bind 'edebug-form-spec '(form body))
 
-(defun riece-start-server (server &optional server-name)
-  (if server-name
-      (message "Connecting to IRC server on %s..." server-name)
-    (message "Connecting to IRC server..."))
-  (prog1 (riece-open-server server server-name)
-    (if server-name
-       (message "Connecting to IRC server on %s...done" server-name)
-      (message "Connecting to IRC server...done"))))
-
 (defun riece-clear-system ()
   (while riece-buffer-list
     (if (and (get-buffer (car riece-buffer-list))
@@ -111,7 +102,10 @@ the `riece-server-keyword-map' variable."
            riece-save-variables-are-dirty t))
     (cdr entry)))
 
-(defun riece-open-server (server server-name)
+(defun riece-open-server (server &optional server-name)
+  (if server-name
+      (message "Connecting to IRC server on %s..." server-name)
+    (message "Connecting to IRC server..."))
   (riece-server-keyword-bind server
     (let* (selective-display
           (coding-system-for-read 'binary)
@@ -144,7 +138,14 @@ the `riece-server-keyword-map' variable."
        (setq riece-last-nickname riece-real-nickname
              riece-nick-accepted 'sent
              riece-coding-system coding-system))
-      process)))
+      (if server-name
+         (setq riece-server-process-alist
+               (cons (cons server-name process)
+                     riece-server-process-alist))
+       (setq riece-server-process process))))
+  (if server-name
+      (message "Connecting to IRC server on %s...done" server-name)
+    (message "Connecting to IRC server...done")))
 
 (defun riece-reset-process-buffer (process)
   (save-excursion
index 4885f9d..7c91272 100644 (file)
@@ -258,8 +258,7 @@ If already connected, just pop up the windows."
           (if (or confirm (null riece-server))
               (completing-read "Server: " riece-server-alist)
             riece-server)))
-      (setq riece-server-process (riece-start-server
-                                 (riece-server-name-to-server server-name))))
+      (riece-open-server (riece-server-name-to-server server-name)))
     (riece-create-buffers)
     (riece-configure-windows)
     (let ((channel-list riece-startup-channel-list))