From: teranisi Date: Thu, 29 Nov 2001 16:23:41 +0000 (+0000) Subject: * wl-acap.el (wl-acap-init): If initialization via ACAP is interrupted, X-Git-Tag: wl-2_8-root~109 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b87b2bfe54c973d961a150edc46157ca115cf764;p=elisp%2Fwanderlust.git * wl-acap.el (wl-acap-init): If initialization via ACAP is interrupted, resume msgdb directory. * acap.el (acap-logging-out): New buffer local variable. (acap-close): Set it. (acap-wait-for-response): If acap-logging-out is non-nil, don't cause an error. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index d26a83d..ff16909 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,10 @@ +2001-11-30 Yuuichi Teranishi + + * acap.el (acap-logging-out): New buffer local variable. + (acap-close): Set it. + (acap-wait-for-response): If acap-logging-out is non-nil, don't cause + an error. + 2001-11-28 Yuuichi Teranishi * acap.el (acap-response-bye-p): New function. diff --git a/elmo/acap.el b/elmo/acap.el index 780ea6c..4948740 100644 --- a/elmo/acap.el +++ b/elmo/acap.el @@ -122,6 +122,9 @@ Valid states are `closed', `initial', `auth'.") (defvar acap-response nil "ACAP Response.") +(defvar acap-logging-out nil + "Non-nil when ACAP is logging out.") + (make-variable-buffer-local 'acap-state) (make-variable-buffer-local 'acap-auth) (make-variable-buffer-local 'acap-capability) @@ -131,6 +134,7 @@ Valid states are `closed', `initial', `auth'.") (make-variable-buffer-local 'acap-server) (make-variable-buffer-local 'acap-port) (make-variable-buffer-local 'acap-response) +(make-variable-buffer-local 'acap-logging-out) (defvar acap-network-stream-alist '((default . open-network-stream-as-binary))) @@ -282,6 +286,7 @@ Valid states are `closed', `initial', `auth'.") (defun acap-close (process) (with-current-buffer (process-buffer process) + (setq acap-logging-out t) (unless (acap-response-ok-p (acap-send-command-wait process "LOGOUT")) (message "Server %s didn't let me log out" acap-server)) (when (memq (process-status process) '(open run)) @@ -543,8 +548,10 @@ ENTRIES is a store-entry list." (while (and (not (acap-response-cont-p acap-response)) (< acap-reached-tag tag)) (when (acap-response-bye-p acap-response) - (error (prog1 (acap-response-bye-message acap-response) - (setq acap-response nil)))) + (if acap-logging-out + (setq acap-response nil) + (error (prog1 (acap-response-bye-message acap-response) + (setq acap-response nil))))) (or (and (not (memq (process-status process) '(open run))) (sit-for 1)) (let ((len (/ (point-max) 1024)) diff --git a/wl/ChangeLog b/wl/ChangeLog index b570a55..a1f3830 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2001-11-30 Yuuichi Teranishi + + * wl-acap.el (wl-acap-init): If initialization via ACAP is interrupted, + resume msgdb directory. + 2001-11-28 Yuuichi Teranishi * wl.el (wl-exit): Call `wl-acap-exit'. diff --git a/wl/wl-acap.el b/wl/wl-acap.el index a514094..62ab754 100644 --- a/wl/wl-acap.el +++ b/wl/wl-acap.el @@ -104,6 +104,8 @@ If nil, default acap port is used." (defun wl-acap-init () "A candidate for `wl-folder-init-function'." + (setq wl-acap-original-msgdb-dir nil) + (condition-case nil ; catch error and quit. (let ((service (wl-acap-find-acap-service)) proc entries settings folder-top type) (unless (car service) (error "No ACAP service found")) @@ -171,7 +173,12 @@ If nil, default acap port is used." (setq elmo-msgdb-dir (expand-file-name (concat "acap/" (car service) "/" wl-acap-user) elmo-msgdb-dir)) - (acap-close proc))) + (acap-close proc)) + (error (when wl-acap-original-msgdb-dir + (setq elmo-msgdb-dir wl-acap-original-msgdb-dir))) + (quit (when wl-acap-original-msgdb-dir + (setq elmo-msgdb-dir wl-acap-original-msgdb-dir))))) + (defun wl-acap-create-folder-entity (string) (with-temp-buffer