From 6b59a5e8080a9fc614d355fef78d5d4c42b6a95d Mon Sep 17 00:00:00 2001 From: hmurata Date: Sun, 5 Nov 2006 00:40:00 +0000 Subject: [PATCH] (elmo-imap4-session-capable-p): New macro. (elmo-imap4-send-command): Use it. (elmo-network-initialize-session): Ditto. (elmo-network-setup-session): Ditto. (elmo-folder-msgdb-create-plugged): Ditto. --- elmo/ChangeLog | 8 ++++++++ elmo/elmo-imap4.el | 16 +++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 750ee74..c257933 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,11 @@ +2006-11-05 Hiroya Murata + + * elmo-imap4.el (elmo-imap4-session-capable-p): New macro. + (elmo-imap4-send-command): Use it. + (elmo-network-initialize-session): Ditto. + (elmo-network-setup-session): Ditto. + (elmo-folder-msgdb-create-plugged): Ditto. + 2006-11-04 Hiroya Murata * elmo-util.el (elmo-progress-done): Fix a miss refer to diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index f44ba76..5f1d5e2 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -198,6 +198,9 @@ Debug information is inserted in the buffer \"*IMAP4 DEBUG*\"") (capability current-mailbox read-only flags)) (luna-define-internal-accessors 'elmo-imap4-session)) +(defmacro elmo-imap4-session-capable-p (session capability) + `(memq ,capability (elmo-imap4-session-capability-internal ,session))) + ;;; MIME-ELMO-IMAP Location (eval-and-compile (luna-define-class mime-elmo-imap-location @@ -324,9 +327,7 @@ Returns a TAG string which is assigned to the COMMAND." cmdstr (elmo-imap4-format-quoted (nth 1 token))))) ((eq kind 'literal) - (if (memq 'literal+ - (elmo-imap4-session-capability-internal - session)) + (if (elmo-imap4-session-capable-p session 'literal+) ;; rfc2088 (progn (setq cmdstr (concat cmdstr @@ -1004,8 +1005,7 @@ If CHOP-LENGTH is not specified, message set is not chopped." (when (eq (elmo-network-stream-type-symbol (elmo-network-session-stream-type-internal session)) 'starttls) - (or (memq 'starttls - (elmo-imap4-session-capability-internal session)) + (or (elmo-imap4-session-capable-p session 'starttls) (signal 'elmo-open-error '(elmo-imap4-starttls-error))) (elmo-imap4-send-command-wait session "starttls") @@ -1123,7 +1123,7 @@ If CHOP-LENGTH is not specified, message set is not chopped." (luna-define-method elmo-network-setup-session ((session elmo-imap4-session)) (with-current-buffer (elmo-network-session-buffer session) - (when (memq 'namespace (elmo-imap4-session-capability-internal session)) + (when (elmo-imap4-session-capable-p session 'namespace) (setq elmo-imap4-server-namespace (elmo-imap4-response-value (elmo-imap4-send-command-wait session "namespace") @@ -2358,9 +2358,7 @@ If optional argument REMOVE is non-nil, remove FLAG." (total 0) print-length print-depth rfc2060 set-list) - (setq rfc2060 (memq 'imap4rev1 - (elmo-imap4-session-capability-internal - session))) + (setq rfc2060 (elmo-imap4-session-capable-p session 'imap4rev1)) (elmo-with-progress-display (elmo-folder-msgdb-create (length numbers)) "Creating msgdb" (elmo-imap4-session-select-mailbox -- 1.7.10.4