Mercurial > emacs
comparison lisp/net/imap.el @ 104734:714ab1b8092b
(imap-send-command): Simplify.
(imap-wait-for-tag): point-max - buffer-size.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 30 Aug 2009 14:23:21 +0000 |
parents | d775b84fdd71 |
children | 2e22af528b76 |
comparison
equal
deleted
inserted
replaced
104733:9902de48eab4 | 104734:714ab1b8092b |
---|---|
2002 (setq imap-continuation nil))) | 2002 (setq imap-continuation nil))) |
2003 ((functionp cmd) | 2003 ((functionp cmd) |
2004 (imap-send-command-1 cmdstr) | 2004 (imap-send-command-1 cmdstr) |
2005 (setq cmdstr nil) | 2005 (setq cmdstr nil) |
2006 (unwind-protect | 2006 (unwind-protect |
2007 (if (not (eq (imap-wait-for-tag tag) 'INCOMPLETE)) | 2007 (setq command |
2008 (setq command nil) ;; abort command if no cont-req | 2008 (if (not (eq (imap-wait-for-tag tag) 'INCOMPLETE)) |
2009 (setq command (cons (funcall cmd imap-continuation) | 2009 nil ;; abort command if no cont-req |
2010 command))) | 2010 (cons (funcall cmd imap-continuation) |
2011 command))) | |
2011 (setq imap-continuation nil))) | 2012 (setq imap-continuation nil))) |
2012 (t | 2013 (t |
2013 (error "Unknown command type")))) | 2014 (error "Unknown command type")))) |
2014 (if cmdstr | 2015 (if cmdstr |
2015 (imap-send-command-1 cmdstr)) | 2016 (imap-send-command-1 cmdstr)) |
2019 (with-current-buffer (or buffer (current-buffer)) | 2020 (with-current-buffer (or buffer (current-buffer)) |
2020 (let (imap-have-messaged) | 2021 (let (imap-have-messaged) |
2021 (while (and (null imap-continuation) | 2022 (while (and (null imap-continuation) |
2022 (memq (process-status imap-process) '(open run)) | 2023 (memq (process-status imap-process) '(open run)) |
2023 (< imap-reached-tag tag)) | 2024 (< imap-reached-tag tag)) |
2024 (let ((len (/ (point-max) 1024)) | 2025 (let ((len (/ (buffer-size) 1024)) |
2025 message-log-max) | 2026 message-log-max) |
2026 (unless (< len 10) | 2027 (unless (< len 10) |
2027 (setq imap-have-messaged t) | 2028 (setq imap-have-messaged t) |
2028 (message "imap read: %dk" len)) | 2029 (message "imap read: %dk" len)) |
2029 (accept-process-output imap-process | 2030 (accept-process-output imap-process |