From 5c1e75edd6afb401f5e67c232570ab2756d2fc1a Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 18 Jul 2000 22:58:42 +0000 Subject: [PATCH] Synch. --- lisp/ChangeLog | 7 +++++++ lisp/imap.el | 28 +++++++++++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 76f8628..f2babd9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2000-07-19 Kim-Minh Kaplan + + * imap.el (imap-calculate-literal-size-first): New variable. + (imap-local-variables): Add it. + (imap-kerberos4-open): Set it. + (imap-send-command): Use it. + 2000-07-17 14:18:16 ShengHuo ZHU * mailcap.el (mailcap-mimetypes-parsed-p): New variable. diff --git a/lisp/imap.el b/lisp/imap.el index a3e0fc6..0085c82 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -288,6 +288,7 @@ encoded mailboxes which doesn't translate into ISO-8859-1.") imap-failed-tags imap-tag imap-process + imap-calculate-literal-size-first imap-mailbox-data)) ;; Internal variables. @@ -298,6 +299,7 @@ encoded mailboxes which doesn't translate into ISO-8859-1.") (defvar imap-port nil) (defvar imap-username nil) (defvar imap-password nil) +(defvar imap-calculate-literal-size-first nil) (defvar imap-state 'closed "IMAP state. Valid states are `closed', `initial', `nonauth', `auth', `selected' @@ -436,7 +438,8 @@ If ARGS, PROMPT is used as an argument to `format'." response) (when process (with-current-buffer buffer - (setq imap-client-eol "\n") + (setq imap-client-eol "\n" + imap-calculate-literal-size-first t) (while (and (memq (process-status process) '(open run)) (goto-char (point-min)) ;; cyrus 1.6.x (13? < x <= 22) queries capabilities @@ -1473,9 +1476,21 @@ on failure." (cond ((stringp cmd) (setq cmdstr (concat cmdstr cmd))) ((bufferp cmd) - (setq cmdstr - (concat cmdstr (format "{%d}" (with-current-buffer cmd - (buffer-size))))) + (let ((eol imap-client-eol) + (calcfirst imap-calculate-literal-size-first) + size) + (with-current-buffer cmd + (if calcfirst + (setq size (buffer-size))) + (when (not (equal eol "\r\n")) + ;; XXX modifies buffer! + (goto-char (point-min)) + (while (search-forward "\r\n" nil t) + (replace-match eol))) + (if (not calcfirst) + (setq size (buffer-size)))) + (setq cmdstr + (concat cmdstr (format "{%d}" size)))) (unwind-protect (progn (imap-send-command-1 cmdstr) @@ -1486,11 +1501,6 @@ on failure." (stream imap-stream) (eol imap-client-eol)) (with-current-buffer cmd - (when (not (equal eol "\r\n")) - ;; XXX modifies buffer! - (goto-char (point-min)) - (while (search-forward "\r\n" nil t) - (replace-match eol))) (and imap-log (with-current-buffer (get-buffer-create imap-log) -- 1.7.10.4