From: ueno Date: Sat, 31 May 2003 23:01:44 +0000 (+0000) Subject: * riece-filter.el (riece-sentinel): Simplified. X-Git-Tag: riece-0_0_3~20 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db1370bb829f1e2a34d64885d571645733f22026;p=elisp%2Friece.git * 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b3c11a9..79bea4a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,25 @@ 2003-05-31 Daiki Ueno + * 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 + * riece-filter.el (riece-sentinel): Close process even if riece-reconnect-with-password == t. (riece-handle-message): Catch errors occured in hooks. diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 3661cfb..f5adb10 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -114,19 +114,22 @@ (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 diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 69fbb3d..f497f5b 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -101,14 +101,16 @@ (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 @@ -128,7 +130,8 @@ (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) diff --git a/lisp/riece-filter.el b/lisp/riece-filter.el index 432a018..06a5137 100644 --- a/lisp/riece-filter.el +++ b/lisp/riece-filter.el @@ -131,14 +131,12 @@ (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))) diff --git a/lisp/riece-server.el b/lisp/riece-server.el index b80d333..e0d3742 100644 --- a/lisp/riece-server.el +++ b/lisp/riece-server.el @@ -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 diff --git a/lisp/riece.el b/lisp/riece.el index 4885f9d..7c91272 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -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))