X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnimap.el;h=73a7335ed803fda8b8d2ebf0d46687188988b61d;hb=56d48f48e2d259c389a99b5bc23e3654fa83ffbb;hp=a8902b2cf14591c514e7c1de78fc33b52af8b2dd;hpb=daae30b5b3e1592f628dd74543820de9282cac3a;p=gnus diff --git a/lisp/nnimap.el b/lisp/nnimap.el index a8902b2cf..73a7335ed 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -51,7 +51,7 @@ it will default to `imap'.") (defvoo nnimap-stream 'ssl "How nnimap will talk to the IMAP server. -Values are `ssl' and `network'.") +Values are `ssl', `network' or `shell'.") (defvoo nnimap-shell-program (if (boundp 'imap-shell-program) (if (listp imap-shell-program) @@ -419,13 +419,11 @@ not done by default on servers that doesn't support that command.") (when info (nnimap-update-infos marks (list info))) (goto-char (point-max)) - (cond - (marks - (setq high (nth 3 (car marks)) - low (nth 4 (car marks)))) - ((re-search-backward "UIDNEXT \\([0-9]+\\)" nil t) - (setq high (1- (string-to-number (match-string 1))) - low 1))))) + (let ((uidnext (nth 5 (car marks)))) + (setq high (if uidnext + (1- uidnext) + (nth 3 (car marks))) + low (or (nth 4 (car marks)) uidnext))))) (erase-buffer) (insert (format @@ -502,7 +500,8 @@ not done by default on servers that doesn't support that command.") nil) (t (let ((deletable-articles - (if force + (if (or force + (eq nnmail-expiry-wait 'immediate)) articles (gnus-sorted-intersection articles @@ -780,15 +779,19 @@ not done by default on servers that doesn't support that command.") (let ((group (gnus-info-group info)) (completep (and start-article (= start-article 1)))) + (when uidnext + (setq high (1- uidnext))) ;; First set the active ranges based on high/low. (if (or completep (not (gnus-active group))) (gnus-set-active group - (if high + (if (and low high) (cons low high) ;; No articles in this group. - (cons (1- uidnext) uidnext))) - (setcdr (gnus-active group) high)) + (cons uidnext (1- uidnext)))) + (setcdr (gnus-active group) (or high (1- uidnext)))) + (unless high + (setq high (1- uidnext))) ;; Then update the list of read articles. (let* ((unread (gnus-compress-sequence @@ -821,6 +824,7 @@ not done by default on servers that doesn't support that command.") (new-marks (gnus-compress-sequence (cdr (or (assoc (caddr type) flags) ; %Flagged + (assoc (intern (cadr type) obarray) flags) (assoc (cadr type) flags)))))) ; "\Flagged" (setq marks (delq old-marks marks)) (pop old-marks) @@ -859,10 +863,10 @@ not done by default on servers that doesn't support that command.") (setq mark (assoc flag marks)) (if (not mark) (push (list flag (car article)) marks) - (setcdr mark (cons (car article) (cdr mark))))) - (push (list group existing marks high low uidnext start-article - permanent-flags) - data)))) + (setcdr mark (cons (car article) (cdr mark)))))) + (push (list group existing marks high low uidnext start-article + permanent-flags) + data))) data)) (defun nnimap-parse-flags (sequences) @@ -884,11 +888,13 @@ not done by default on servers that doesn't support that command.") (and (search-forward "PERMANENTFLAGS " (or end (point-min)) t) (read (current-buffer)))) + (goto-char start) (setq uidnext (and (search-forward "UIDNEXT " (or end (point-min)) t) (read (current-buffer)))) - (goto-char end)) + (goto-char end) + (forward-line -1)) ;; The UID FETCH FLAGS was successful. (search-forward (format "\n%d OK " flag-sequence) nil t)) (setq start (point))