projects
/
elisp
/
wanderlust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* elmo-imap4.el: Remove Nemacs hack, replace `elmo-read' with `read'.
[elisp/wanderlust.git]
/
elmo
/
acap.el
diff --git
a/elmo/acap.el
b/elmo/acap.el
index
b2f4173
..
4948740
100644
(file)
--- 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-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)
(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-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)))
(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)
(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))
(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))
@@
-445,6
+450,12
@@
ENTRIES is a store-entry list."
(defun acap-response-ok-p (response)
(assq 'done-ok response))
(defun acap-response-ok-p (response)
(assq 'done-ok response))
+(defun acap-response-bye-p (response)
+ (assq 'bye response))
+
+(defun acap-response-bye-message (response)
+ (nth 1 (cdr (assq 'bye response))))
+
(defun acap-response-cont-p (response)
(assq 'cont response))
(defun acap-response-cont-p (response)
(assq 'cont response))
@@
-536,6
+547,11
@@
ENTRIES is a store-entry list."
(with-current-buffer (process-buffer process)
(while (and (not (acap-response-cont-p acap-response))
(< acap-reached-tag tag))
(with-current-buffer (process-buffer process)
(while (and (not (acap-response-cont-p acap-response))
(< acap-reached-tag tag))
+ (when (acap-response-bye-p acap-response)
+ (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))
(or (and (not (memq (process-status process) '(open run)))
(sit-for 1))
(let ((len (/ (point-max) 1024))
@@
-799,10
+815,8
@@
ENTRIES is a store-entry list."
(acap-parse-return-data-list)))))
(ALERT ;(cons 'alert (acap-parse-resp-body))
(message (nth 1 (acap-parse-resp-body))))
(acap-parse-return-data-list)))))
(ALERT ;(cons 'alert (acap-parse-resp-body))
(message (nth 1 (acap-parse-resp-body))))
- (BYE ;(cons 'bye (acap-parse-resp-body)))
- ;;(message (nth 1 (acap-parse-resp-body)))
- ;;(ding)
- )
+ ((BYE Bye bye)
+ (cons 'bye (acap-parse-resp-body)))
(CHANGE (cons 'change
(list (acap-parse-quoted)
(progn
(CHANGE (cons 'change
(list (acap-parse-quoted)
(progn