aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatsumi Yamaoka2013-07-02 10:38:58 +0000
committerKatsumi Yamaoka2013-07-02 10:38:58 +0000
commiteaa610c3b428121b0d9abb7580016a0747aaaf72 (patch)
tree017a02b4742908cf8baa5fe56119a87f34ae61fe
parent646b949918ac89c9d49a9e75bc82330f1b06f7ae (diff)
downloademacs-eaa610c3b428121b0d9abb7580016a0747aaaf72.tar.gz
emacs-eaa610c3b428121b0d9abb7580016a0747aaaf72.zip
Merge changes made in Gnus trunk
2012-03-22 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus.texi (Client-Side IMAP Splitting): Note that `nnimap-inbox' now can be a list. 2013-06-05 David Engster <deng@randomsample.de> * gnus-sum.el (gnus-update-marks): Do not remove empty 'unexist' ranges, since `nnimap-retrieve-group-data-early' also uses it as a flag to see whether the group was synced before. 2012-09-05 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-request-move-article): Decode the group name when doing internal moves to avoid charset issues. 2012-09-05 Julien Danjou <julien@danjou.info> * nnimap.el (nnimap-request-list): Revert change that made listing synchronous. (nnimap-get-responses): Restore. 2012-08-31 Dave Abrahams <dave@boostpro.com> * nnimap.el (nnimap-change-group): Document result value. * nnimap.el (nnimap-find-article-by-message-id): Account for the fact that nnimap-change-group can return t. 2012-08-06 Julien Danjou <julien@danjou.info> * nnimap.el (nnimap-request-head): Resture to-buffer parameter, used by `nnimap-request-move-article'. * nnimap.el (nnimap-request-head): Remove to-buffer argument. * gnus-int.el (gnus-request-head): Remove to-buffer argument, only supported by nnimap actually. Reverts previous change. * gnus-int.el (gnus-request-head): Add an optional to-buffer parameter to mimic `gnus-request-article' and enjoy backends the nn*-request-head to-buffer argument that is already supported. 2012-07-24 Julien Danjou <julien@danjou.info> * nnimap.el (nnimap-get-responses): Remove, unused. 2012-06-25 Julien Danjou <julien@danjou.info> * nnimap.el (nnimap-request-articles-find-limit): Rename from `nnimap-request-move-articles-find-limit' since we do not use it only for move operations. (nnimap-request-accept-article): Use `nnimap-request-articles-find-limit' to limit search by message-id. 2012-06-19 Julien Danjou <julien@danjou.info> * nnir.el (nnir-run-imap): Fix, use `nnimap-change-group'. * nnimap.el (nnimap-log-buffer): Check that `window-point-insertion-type' is boundp, since it's not available in XEmacs. 2012-06-19 Michael Welsh Duggan <md5i@md5i.com> * nnimap.el (nnimap-log-buffer): Add this, setting `window-point-insertion-type' in the buffer to t. (nnimap-log-command): Use nnimap-log-buffer. 2012-06-19 Julien Danjou <julien@danjou.info> * nnimap.el (nnimap-find-article-by-message-id): Add an optional limit argument to be able to limit the search. (nnimap-request-move-article): Use `nnimap-request-move-articles-find-limit'. (nnimap-request-move-articles-find-limit): Add this to limit the search by Message-Id after a message move. (nnimap): Add defgroup. 2012-06-15 Julien Danjou <julien@danjou.info> * nnimap.el (nnimap-find-article-by-message-id): Use `nnimap-possibly-change-group' rather than its own EXAMINE call. (nnimap-possibly-change-group): Add read-only argument. (nnimap-request-list): Use nnimap-possibly-change-group rather than issuing EXAMINE manually. (nnimap-find-article-by-message-id): Use `nnimap-possibly-change-group' with read-only argument. (nnimap-change-group): Rename from `nnimap-possibly-change-group'. We cannot possibly change because we need to be sure that it's either read-write or read-only. 2012-06-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus-sum.el (gnus-summary-insert-old-articles): Don't include unexistent messages. 2012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus-start.el (gnus-clean-old-newsrc): Remove totally bogus `unexists' entries. (gnus-clean-old-newsrc): Fix last checkin. * nnimap.el (nnimap-update-info): None of the articles below the active low-water mark exist. 2012-03-27 Katsumi Yamaoka <yamaoka@jpl.org> * nnimap.el (gnus-refer-thread-use-nnir): Silence the byte compiler. 2012-03-22 Sergio Martinez <samf0xb58@gmail.com> (tiny change) * nnimap.el (nnimap-request-scan): Allow `nnimap-inbox' to be a list of inboxes. 2012-03-10 Lars Magne Ingebrigtsen <larsi@gnus.org> * gnus-group.el (gnus-group-expire-articles-1): Don't try to expire messages that don't exist. * gnus-sum.el (gnus-summary-expire-articles): Ditto. 2012-02-20 Lars Ingebrigtsen <larsi@gnus.org> * gnus-start.el (gnus-clean-old-newsrc): Allow a FORCE parameter. 2012-02-15 Lars Ingebrigtsen <larsi@gnus.org> * gnus-start.el (gnus-clean-old-newsrc): Delete `unexist' from pre-Ma Gnus 0.3. 2012-02-15 Lars Ingebrigtsen <larsi@gnus.org> * gnus-sum.el (gnus-summary-local-variables): Make `gnus-newsgroup-unexist' into a local variable. 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org> * gnus-sum.el (gnus-adjust-marked-articles): Add to `gnus-newsgroup-unexist'. * gnus.el (gnus-article-mark-lists): Add `unexist' to the list of marks. (gnus-article-special-mark-lists): Put the `unexist' in the special marks list instead. * gnus-sum.el (gnus-articles-to-read): Don't include unexisting articles in the list of articles to be selected. * nnimap.el (nnimap-retrieve-group-data-early): Query for unexisting articles. (nnimap-update-info): Keep track of unexisting articles. (nnimap-update-qresync-info): Ditto. 2012-02-01 Lars Ingebrigtsen <larsi@gnus.org> * gnus-start.el (gnus-clean-old-newsrc): New function. (gnus-read-newsrc-file): Use it.
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/gnus.texi3
-rw-r--r--lisp/gnus/ChangeLog154
-rw-r--r--lisp/gnus/gnus-group.el10
-rw-r--r--lisp/gnus/gnus-start.el22
-rw-r--r--lisp/gnus/gnus-sum.el42
-rw-r--r--lisp/gnus/gnus.el5
-rw-r--r--lisp/gnus/nnimap.el221
-rw-r--r--lisp/gnus/nnir.el4
9 files changed, 371 insertions, 95 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 016b0e8340f..d0f229a9c9e 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12013-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus.texi (Client-Side IMAP Splitting):
4 Note that `nnimap-inbox' now can be a list.
5
12013-06-24 Glenn Morris <rgm@gnu.org> 62013-06-24 Glenn Morris <rgm@gnu.org>
2 7
3 * eshell.texi: Fix cross-references to other manuals. 8 * eshell.texi: Fix cross-references to other manuals.
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index b4d786c4d45..6df72f87fc7 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -14240,7 +14240,8 @@ variables are relevant:
14240 14240
14241@table @code 14241@table @code
14242@item nnimap-inbox 14242@item nnimap-inbox
14243This is the @acronym{IMAP} mail box that will be scanned for new mail. 14243This is the @acronym{IMAP} mail box that will be scanned for new
14244mail. This can also be a list of mail box names.
14244 14245
14245@item nnimap-split-methods 14246@item nnimap-split-methods
14246Uses the same syntax as @code{nnmail-split-methods} (@pxref{Splitting 14247Uses the same syntax as @code{nnmail-split-methods} (@pxref{Splitting
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 9639f21c2fb..49b45380575 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,157 @@
12013-07-02 David Engster <deng@randomsample.de>
2
3 * gnus-sum.el (gnus-update-marks): Do not remove empty 'unexist'
4 ranges, since `nnimap-retrieve-group-data-early' also uses it as a flag
5 to see whether the group was synced before.
6
72013-07-02 Martin Stjernholm <mast@lysator.liu.se>
8
9 * nnimap.el (nnimap-request-move-article): Decode the group name when
10 doing internal moves to avoid charset issues.
11
122013-07-02 Julien Danjou <julien@danjou.info>
13
14 * nnimap.el (nnimap-request-list):
15 Revert change that made listing synchronous.
16 (nnimap-get-responses): Restore.
17
182013-07-02 Dave Abrahams <dave@boostpro.com>
19
20 * nnimap.el (nnimap-change-group): Document result value.
21
22 * nnimap.el (nnimap-find-article-by-message-id):
23 Account for the fact that nnimap-change-group can return t.
24
252013-07-02 Julien Danjou <julien@danjou.info>
26
27 * nnimap.el (nnimap-request-head):
28 Resture to-buffer parameter, used by `nnimap-request-move-article'.
29
30 * nnimap.el (nnimap-request-head): Remove to-buffer argument.
31
32 * gnus-int.el (gnus-request-head): Remove to-buffer argument, only
33 supported by nnimap actually. Reverts previous change.
34
35 * gnus-int.el (gnus-request-head): Add an optional to-buffer parameter
36 to mimic `gnus-request-article' and enjoy backends the nn*-request-head
37 to-buffer argument that is already supported.
38
392013-07-02 Julien Danjou <julien@danjou.info>
40
41 * nnimap.el (nnimap-get-responses): Remove, unused.
42
432013-07-02 Julien Danjou <julien@danjou.info>
44
45 * nnimap.el (nnimap-request-articles-find-limit): Rename from
46 `nnimap-request-move-articles-find-limit' since we do not use it
47 only for move operations.
48 (nnimap-request-accept-article):
49 Use `nnimap-request-articles-find-limit' to limit search by message-id.
50
512013-07-02 Julien Danjou <julien@danjou.info>
52
53 * nnir.el (nnir-run-imap): Fix, use `nnimap-change-group'.
54
55 * nnimap.el (nnimap-log-buffer):
56 Check that `window-point-insertion-type' is boundp, since it's not
57 available in XEmacs.
58
592013-07-02 Michael Welsh Duggan <md5i@md5i.com>
60
61 * nnimap.el (nnimap-log-buffer):
62 Add this, setting `window-point-insertion-type' in the buffer to t.
63 (nnimap-log-command): Use nnimap-log-buffer.
64
652013-07-02 Julien Danjou <julien@danjou.info>
66
67 * nnimap.el (nnimap-find-article-by-message-id):
68 Add an optional limit argument to be able to limit the search.
69 (nnimap-request-move-article):
70 Use `nnimap-request-move-articles-find-limit'.
71 (nnimap-request-move-articles-find-limit):
72 Add this to limit the search by Message-Id after a message move.
73 (nnimap): Add defgroup.
74
752013-07-02 Julien Danjou <julien@danjou.info>
76
77 * nnimap.el (nnimap-find-article-by-message-id):
78 Use `nnimap-possibly-change-group' rather than its own EXAMINE call.
79 (nnimap-possibly-change-group): Add read-only argument.
80 (nnimap-request-list): Use nnimap-possibly-change-group rather than
81 issuing EXAMINE manually.
82 (nnimap-find-article-by-message-id):
83 Use `nnimap-possibly-change-group' with read-only argument.
84 (nnimap-change-group): Rename from `nnimap-possibly-change-group'.
85 We cannot possibly change because we need to be sure that it's either
86 read-write or read-only.
87
882013-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
89
90 * gnus-sum.el (gnus-summary-insert-old-articles):
91 Don't include unexistent messages.
92
932013-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
94
95 * gnus-start.el (gnus-clean-old-newsrc):
96 Remove totally bogus `unexists' entries.
97 (gnus-clean-old-newsrc): Fix last checkin.
98
99 * nnimap.el (nnimap-update-info):
100 None of the articles below the active low-water mark exist.
101
1022013-07-02 Katsumi Yamaoka <yamaoka@jpl.org>
103
104 * nnimap.el (gnus-refer-thread-use-nnir): Silence the byte compiler.
105
1062013-07-02 Sergio Martinez <samf0xb58@gmail.com> (tiny change)
107
108 * nnimap.el (nnimap-request-scan):
109 Allow `nnimap-inbox' to be a list of inboxes.
110
1112013-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
112
113 * gnus-group.el (gnus-group-expire-articles-1):
114 Don't try to expire messages that don't exist.
115
116 * gnus-sum.el (gnus-summary-expire-articles): Ditto.
117
1182013-07-02 Lars Ingebrigtsen <larsi@gnus.org>
119
120 * gnus-start.el (gnus-clean-old-newsrc): Allow a FORCE parameter.
121
1222013-07-02 Lars Ingebrigtsen <larsi@gnus.org>
123
124 * gnus-start.el (gnus-clean-old-newsrc):
125 Delete `unexist' from pre-Ma Gnus 0.3.
126
1272013-07-02 Lars Ingebrigtsen <larsi@gnus.org>
128
129 * gnus-sum.el (gnus-summary-local-variables):
130 Make `gnus-newsgroup-unexist' into a local variable.
131
1322013-07-02 Lars Ingebrigtsen <larsi@gnus.org>
133
134 * gnus-sum.el (gnus-adjust-marked-articles):
135 Add to `gnus-newsgroup-unexist'.
136
137 * gnus.el (gnus-article-mark-lists):
138 Add `unexist' to the list of marks.
139 (gnus-article-special-mark-lists):
140 Put the `unexist' in the special marks list instead.
141
142 * gnus-sum.el (gnus-articles-to-read): Don't include unexisting
143 articles in the list of articles to be selected.
144
145 * nnimap.el (nnimap-retrieve-group-data-early):
146 Query for unexisting articles.
147 (nnimap-update-info): Keep track of unexisting articles.
148 (nnimap-update-qresync-info): Ditto.
149
1502013-07-02 Lars Ingebrigtsen <larsi@gnus.org>
151
152 * gnus-start.el (gnus-clean-old-newsrc): New function.
153 (gnus-read-newsrc-file): Use it.
154
12013-07-02 Daiki Ueno <ueno@gnu.org> 1552013-07-02 Daiki Ueno <ueno@gnu.org>
2 156
3 * mml2015.el (mml2015-epg-key-image): Use 'gnus-create-image' instead 157 * mml2015.el (mml2015-epg-key-image): Use 'gnus-create-image' instead
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 207877364fe..8050f5d59d7 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -3654,6 +3654,10 @@ Uses the process/prefix convention."
3654 (expirable (if (gnus-group-total-expirable-p group) 3654 (expirable (if (gnus-group-total-expirable-p group)
3655 (cons nil (gnus-list-of-read-articles group)) 3655 (cons nil (gnus-list-of-read-articles group))
3656 (assq 'expire (gnus-info-marks info)))) 3656 (assq 'expire (gnus-info-marks info))))
3657 (articles-to-expire
3658 (gnus-list-range-difference
3659 (gnus-uncompress-sequence (cdr expirable))
3660 (cdr (assq 'unexist (gnus-info-marks info)))))
3657 (expiry-wait (gnus-group-find-parameter group 'expiry-wait)) 3661 (expiry-wait (gnus-group-find-parameter group 'expiry-wait))
3658 (nnmail-expiry-target 3662 (nnmail-expiry-target
3659 (or (gnus-group-find-parameter group 'expiry-target) 3663 (or (gnus-group-find-parameter group 'expiry-target)
@@ -3668,11 +3672,9 @@ Uses the process/prefix convention."
3668 ;; parameter. 3672 ;; parameter.
3669 (let ((nnmail-expiry-wait-function nil) 3673 (let ((nnmail-expiry-wait-function nil)
3670 (nnmail-expiry-wait expiry-wait)) 3674 (nnmail-expiry-wait expiry-wait))
3671 (gnus-request-expire-articles 3675 (gnus-request-expire-articles articles-to-expire group))
3672 (gnus-uncompress-sequence (cdr expirable)) group))
3673 ;; Just expire using the normal expiry values. 3676 ;; Just expire using the normal expiry values.
3674 (gnus-request-expire-articles 3677 (gnus-request-expire-articles articles-to-expire group))))
3675 (gnus-uncompress-sequence (cdr expirable)) group))))
3676 (gnus-close-group group)) 3678 (gnus-close-group group))
3677 (gnus-message 6 "Expiring articles in %s...done" 3679 (gnus-message 6 "Expiring articles in %s...done"
3678 (gnus-group-decoded-name group)) 3680 (gnus-group-decoded-name group))
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 48bb99bfbce..084af884930 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -2301,7 +2301,27 @@ If FORCE is non-nil, the .newsrc file is read."
2301 (gnus-message 5 "Reading %s...done" newsrc-file))) 2301 (gnus-message 5 "Reading %s...done" newsrc-file)))
2302 2302
2303 ;; Convert old to new. 2303 ;; Convert old to new.
2304 (gnus-convert-old-newsrc)))) 2304 (gnus-convert-old-newsrc)
2305 (gnus-clean-old-newsrc))))
2306
2307(defun gnus-clean-old-newsrc (&optional force)
2308 (when gnus-newsrc-file-version
2309 ;; Remove totally bogus `unexists' entries. The name is
2310 ;; `unexist'.
2311 (dolist (info (cdr gnus-newsrc-alist))
2312 (let ((exist (assoc 'unexists (gnus-info-marks info))))
2313 (when exist
2314 (gnus-info-set-marks
2315 info (delete exist (gnus-info-marks info))))))
2316 (when (or force
2317 (< (gnus-continuum-version gnus-newsrc-file-version)
2318 (gnus-continuum-version "Ma Gnus v0.03")))
2319 ;; Remove old `exist' marks from old nnimap groups.
2320 (dolist (info (cdr gnus-newsrc-alist))
2321 (let ((exist (assoc 'unexist (gnus-info-marks info))))
2322 (when exist
2323 (gnus-info-set-marks
2324 info (delete exist (gnus-info-marks info)))))))))
2305 2325
2306(defun gnus-convert-old-newsrc () 2326(defun gnus-convert-old-newsrc ()
2307 "Convert old newsrc formats into the current format, if needed." 2327 "Convert old newsrc formats into the current format, if needed."
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index c8f593ea403..e136d4f8173 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1524,6 +1524,9 @@ This list will always be a subset of gnus-newsgroup-undownloaded.")
1524(defvar gnus-newsgroup-seen nil 1524(defvar gnus-newsgroup-seen nil
1525 "Range of seen articles in the current newsgroup.") 1525 "Range of seen articles in the current newsgroup.")
1526 1526
1527(defvar gnus-newsgroup-unexist nil
1528 "Range of unexistent articles in the current newsgroup.")
1529
1527(defvar gnus-newsgroup-articles nil 1530(defvar gnus-newsgroup-articles nil
1528 "List of articles in the current newsgroup.") 1531 "List of articles in the current newsgroup.")
1529 1532
@@ -1571,6 +1574,7 @@ This list will always be a subset of gnus-newsgroup-undownloaded.")
1571 gnus-newsgroup-killed 1574 gnus-newsgroup-killed
1572 gnus-newsgroup-unseen 1575 gnus-newsgroup-unseen
1573 gnus-newsgroup-seen 1576 gnus-newsgroup-seen
1577 gnus-newsgroup-unexist
1574 gnus-newsgroup-cached 1578 gnus-newsgroup-cached
1575 gnus-newsgroup-downloadable 1579 gnus-newsgroup-downloadable
1576 gnus-newsgroup-undownloaded 1580 gnus-newsgroup-undownloaded
@@ -5789,6 +5793,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5789 "Find out what articles the user wants to read." 5793 "Find out what articles the user wants to read."
5790 (let* ((only-read-p t) 5794 (let* ((only-read-p t)
5791 (articles 5795 (articles
5796 (gnus-list-range-difference
5792 ;; Select all articles if `read-all' is non-nil, or if there 5797 ;; Select all articles if `read-all' is non-nil, or if there
5793 ;; are no unread articles. 5798 ;; are no unread articles.
5794 (if (or read-all 5799 (if (or read-all
@@ -5815,7 +5820,8 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5815 (setq only-read-p nil) 5820 (setq only-read-p nil)
5816 (gnus-sorted-nunion 5821 (gnus-sorted-nunion
5817 (gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked) 5822 (gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked)
5818 gnus-newsgroup-unreads))) 5823 gnus-newsgroup-unreads))
5824 (cdr (assq 'unexist (gnus-info-marks (gnus-get-info group))))))
5819 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles)) 5825 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles))
5820 (scored (length scored-list)) 5826 (scored (length scored-list))
5821 (number (length articles)) 5827 (number (length articles))
@@ -5985,7 +5991,9 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5985 (and (numberp (car articles)) 5991 (and (numberp (car articles))
5986 (> min (car articles))))) 5992 (> min (car articles)))))
5987 (pop articles)) 5993 (pop articles))
5988 (set var articles)))))))) 5994 (set var articles))
5995 ((eq mark 'unexist)
5996 (set var (cdr marks)))))))))
5989 5997
5990(defun gnus-update-missing-marks (missing) 5998(defun gnus-update-missing-marks (missing)
5991 "Go through the list of MISSING articles and remove them from the mark lists." 5999 "Go through the list of MISSING articles and remove them from the mark lists."
@@ -6061,7 +6069,8 @@ If SELECT-ARTICLES, only select those articles from GROUP."
6061 (gnus-active gnus-newsgroup-name) del)) 6069 (gnus-active gnus-newsgroup-name) del))
6062 (push (list del 'del (list (cdr type))) delta-marks)))) 6070 (push (list del 'del (list (cdr type))) delta-marks))))
6063 6071
6064 (when list 6072 (when (or list
6073 (eq (cdr type) 'unexist))
6065 (push (cons (cdr type) list) newmarked))) 6074 (push (cons (cdr type) list) newmarked)))
6066 6075
6067 (when delta-marks 6076 (when delta-marks
@@ -10305,16 +10314,19 @@ This will be the case if the article has both been mailed and posted."
10305 'request-expire-articles gnus-newsgroup-name)) 10314 'request-expire-articles gnus-newsgroup-name))
10306 ;; This backend supports expiry. 10315 ;; This backend supports expiry.
10307 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name)) 10316 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name))
10308 (expirable (if total 10317 (expirable
10309 (progn 10318 (gnus-list-range-difference
10310 ;; We need to update the info for 10319 (if total
10311 ;; this group for `gnus-list-of-read-articles' 10320 (progn
10312 ;; to give us the right answer. 10321 ;; We need to update the info for
10313 (gnus-run-hooks 'gnus-exit-group-hook) 10322 ;; this group for `gnus-list-of-read-articles'
10314 (gnus-summary-update-info) 10323 ;; to give us the right answer.
10315 (gnus-list-of-read-articles gnus-newsgroup-name)) 10324 (gnus-run-hooks 'gnus-exit-group-hook)
10316 (setq gnus-newsgroup-expirable 10325 (gnus-summary-update-info)
10317 (sort gnus-newsgroup-expirable '<)))) 10326 (gnus-list-of-read-articles gnus-newsgroup-name))
10327 (setq gnus-newsgroup-expirable
10328 (sort gnus-newsgroup-expirable '<)))
10329 gnus-newsgroup-unexist))
10318 (expiry-wait (if now 'immediate 10330 (expiry-wait (if now 'immediate
10319 (gnus-group-find-parameter 10331 (gnus-group-find-parameter
10320 gnus-newsgroup-name 'expiry-wait))) 10332 gnus-newsgroup-name 'expiry-wait)))
@@ -12847,7 +12859,9 @@ If ALL is a number, fetch this number of articles."
12847 ;; Some nntp servers lie about their active range. When 12859 ;; Some nntp servers lie about their active range. When
12848 ;; this happens, the active range can be in the millions. 12860 ;; this happens, the active range can be in the millions.
12849 ;; Use a compressed range to avoid creating a huge list. 12861 ;; Use a compressed range to avoid creating a huge list.
12850 (gnus-range-difference (list gnus-newsgroup-active) old)) 12862 (gnus-range-difference
12863 (gnus-range-difference (list gnus-newsgroup-active) old)
12864 gnus-newsgroup-unexist))
12851 (setq len (gnus-range-length older)) 12865 (setq len (gnus-range-length older))
12852 (cond 12866 (cond
12853 ((null older) nil) 12867 ((null older) nil)
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 2c2dbd90c56..9a927a1cfab 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -2636,10 +2636,11 @@ a string, be sure to use a valid format, see RFC 2616."
2636 (scored . score) (saved . save) 2636 (scored . score) (saved . save)
2637 (cached . cache) (downloadable . download) 2637 (cached . cache) (downloadable . download)
2638 (unsendable . unsend) (forwarded . forward) 2638 (unsendable . unsend) (forwarded . forward)
2639 (seen . seen))) 2639 (seen . seen) (unexist . unexist)))
2640 2640
2641(defconst gnus-article-special-mark-lists 2641(defconst gnus-article-special-mark-lists
2642 '((seen range) 2642 '((seen range)
2643 (unexist range)
2643 (killed range) 2644 (killed range)
2644 (bookmark tuple) 2645 (bookmark tuple)
2645 (uid tuple) 2646 (uid tuple)
@@ -2654,7 +2655,7 @@ a string, be sure to use a valid format, see RFC 2616."
2654;; `score' is not a proper mark 2655;; `score' is not a proper mark
2655;; `bookmark': don't propagated it, or fix the bug in update-mark. 2656;; `bookmark': don't propagated it, or fix the bug in update-mark.
2656(defconst gnus-article-unpropagated-mark-lists 2657(defconst gnus-article-unpropagated-mark-lists
2657 '(seen cache download unsend score bookmark) 2658 '(seen cache download unsend score bookmark unexist)
2658 "Marks that shouldn't be propagated to back ends. 2659 "Marks that shouldn't be propagated to back ends.
2659Typical marks are those that make no sense in a standalone back end, 2660Typical marks are those that make no sense in a standalone back end,
2660such as a mark that says whether an article is stored in the cache 2661such as a mark that says whether an article is stored in the cache
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 8fdd69b47da..4d9320b995f 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -82,7 +82,8 @@ back on `network'.")
82 82
83(defvoo nnimap-inbox nil 83(defvoo nnimap-inbox nil
84 "The mail box where incoming mail arrives and should be split out of. 84 "The mail box where incoming mail arrives and should be split out of.
85For example, \"INBOX\".") 85This can be a string or a list of strings
86For example, \"INBOX\" or (\"INBOX\" \"SENT\").")
86 87
87(defvoo nnimap-split-methods nil 88(defvoo nnimap-split-methods nil
88 "How mail is split. 89 "How mail is split.
@@ -123,6 +124,16 @@ will fetch all parts that have types that match that string. A
123likely value would be \"text/\" to automatically fetch all 124likely value would be \"text/\" to automatically fetch all
124textual parts.") 125textual parts.")
125 126
127(defgroup nnimap nil
128 "IMAP for Gnus."
129 :group 'gnus)
130
131(defcustom nnimap-request-articles-find-limit nil
132 "Limit the number of articles to look for after moving an article."
133 :type 'integer
134 :version "24.3"
135 :group 'nnimap)
136
126(defvar nnimap-process nil) 137(defvar nnimap-process nil)
127 138
128(defvar nnimap-status-string "") 139(defvar nnimap-status-string "")
@@ -173,7 +184,7 @@ textual parts.")
173 (setq group (nnimap-decode-gnus-group group))) 184 (setq group (nnimap-decode-gnus-group group)))
174 (with-current-buffer nntp-server-buffer 185 (with-current-buffer nntp-server-buffer
175 (erase-buffer) 186 (erase-buffer)
176 (when (nnimap-possibly-change-group group server) 187 (when (nnimap-change-group group server)
177 (with-current-buffer (nnimap-buffer) 188 (with-current-buffer (nnimap-buffer)
178 (erase-buffer) 189 (erase-buffer)
179 (nnimap-wait-for-response 190 (nnimap-wait-for-response
@@ -567,10 +578,10 @@ textual parts.")
567 (when group 578 (when group
568 (setq group (nnimap-decode-gnus-group group))) 579 (setq group (nnimap-decode-gnus-group group)))
569 (with-current-buffer nntp-server-buffer 580 (with-current-buffer nntp-server-buffer
570 (let ((result (nnimap-possibly-change-group group server)) 581 (let ((result (nnimap-change-group group server))
571 parts structure) 582 parts structure)
572 (when (stringp article) 583 (when (stringp article)
573 (setq article (nnimap-find-article-by-message-id group article))) 584 (setq article (nnimap-find-article-by-message-id group server article)))
574 (when (and result 585 (when (and result
575 article) 586 article)
576 (erase-buffer) 587 (erase-buffer)
@@ -599,10 +610,10 @@ textual parts.")
599(deffoo nnimap-request-head (article &optional group server to-buffer) 610(deffoo nnimap-request-head (article &optional group server to-buffer)
600 (when group 611 (when group
601 (setq group (nnimap-decode-gnus-group group))) 612 (setq group (nnimap-decode-gnus-group group)))
602 (when (nnimap-possibly-change-group group server) 613 (when (nnimap-change-group group server)
603 (with-current-buffer (nnimap-buffer) 614 (with-current-buffer (nnimap-buffer)
604 (when (stringp article) 615 (when (stringp article)
605 (setq article (nnimap-find-article-by-message-id group article))) 616 (setq article (nnimap-find-article-by-message-id group server article)))
606 (if (null article) 617 (if (null article)
607 nil 618 nil
608 (nnimap-get-whole-article 619 (nnimap-get-whole-article
@@ -751,7 +762,7 @@ textual parts.")
751 762
752(deffoo nnimap-request-group (group &optional server dont-check info) 763(deffoo nnimap-request-group (group &optional server dont-check info)
753 (setq group (nnimap-decode-gnus-group group)) 764 (setq group (nnimap-decode-gnus-group group))
754 (let ((result (nnimap-possibly-change-group 765 (let ((result (nnimap-change-group
755 ;; Don't SELECT the group if we're going to select it 766 ;; Don't SELECT the group if we're going to select it
756 ;; later, anyway. 767 ;; later, anyway.
757 (if (and (not dont-check) 768 (if (and (not dont-check)
@@ -801,19 +812,19 @@ textual parts.")
801 812
802(deffoo nnimap-request-create-group (group &optional server args) 813(deffoo nnimap-request-create-group (group &optional server args)
803 (setq group (nnimap-decode-gnus-group group)) 814 (setq group (nnimap-decode-gnus-group group))
804 (when (nnimap-possibly-change-group nil server) 815 (when (nnimap-change-group nil server)
805 (with-current-buffer (nnimap-buffer) 816 (with-current-buffer (nnimap-buffer)
806 (car (nnimap-command "CREATE %S" (utf7-encode group t)))))) 817 (car (nnimap-command "CREATE %S" (utf7-encode group t))))))
807 818
808(deffoo nnimap-request-delete-group (group &optional force server) 819(deffoo nnimap-request-delete-group (group &optional force server)
809 (setq group (nnimap-decode-gnus-group group)) 820 (setq group (nnimap-decode-gnus-group group))
810 (when (nnimap-possibly-change-group nil server) 821 (when (nnimap-change-group nil server)
811 (with-current-buffer (nnimap-buffer) 822 (with-current-buffer (nnimap-buffer)
812 (car (nnimap-command "DELETE %S" (utf7-encode group t)))))) 823 (car (nnimap-command "DELETE %S" (utf7-encode group t))))))
813 824
814(deffoo nnimap-request-rename-group (group new-name &optional server) 825(deffoo nnimap-request-rename-group (group new-name &optional server)
815 (setq group (nnimap-decode-gnus-group group)) 826 (setq group (nnimap-decode-gnus-group group))
816 (when (nnimap-possibly-change-group nil server) 827 (when (nnimap-change-group nil server)
817 (with-current-buffer (nnimap-buffer) 828 (with-current-buffer (nnimap-buffer)
818 (nnimap-unselect-group) 829 (nnimap-unselect-group)
819 (car (nnimap-command "RENAME %S %S" 830 (car (nnimap-command "RENAME %S %S"
@@ -828,7 +839,7 @@ textual parts.")
828 839
829(deffoo nnimap-request-expunge-group (group &optional server) 840(deffoo nnimap-request-expunge-group (group &optional server)
830 (setq group (nnimap-decode-gnus-group group)) 841 (setq group (nnimap-decode-gnus-group group))
831 (when (nnimap-possibly-change-group group server) 842 (when (nnimap-change-group group server)
832 (with-current-buffer (nnimap-buffer) 843 (with-current-buffer (nnimap-buffer)
833 (car (nnimap-command "EXPUNGE"))))) 844 (car (nnimap-command "EXPUNGE")))))
834 845
@@ -856,6 +867,8 @@ textual parts.")
856(deffoo nnimap-request-move-article (article group server accept-form 867(deffoo nnimap-request-move-article (article group server accept-form
857 &optional last internal-move-group) 868 &optional last internal-move-group)
858 (setq group (nnimap-decode-gnus-group group)) 869 (setq group (nnimap-decode-gnus-group group))
870 (when internal-move-group
871 (setq internal-move-group (nnimap-decode-gnus-group internal-move-group)))
859 (with-temp-buffer 872 (with-temp-buffer
860 (mm-disable-multibyte) 873 (mm-disable-multibyte)
861 (when (funcall (if internal-move-group 874 (when (funcall (if internal-move-group
@@ -876,11 +889,12 @@ textual parts.")
876 (cons internal-move-group 889 (cons internal-move-group
877 (or (nnimap-find-uid-response "COPYUID" (cadr result)) 890 (or (nnimap-find-uid-response "COPYUID" (cadr result))
878 (nnimap-find-article-by-message-id 891 (nnimap-find-article-by-message-id
879 internal-move-group message-id))))) 892 internal-move-group server message-id
893 nnimap-request-articles-find-limit)))))
880 ;; Move the article to a different method. 894 ;; Move the article to a different method.
881 (let ((result (eval accept-form))) 895 (let ((result (eval accept-form)))
882 (when result 896 (when result
883 (nnimap-possibly-change-group group server) 897 (nnimap-change-group group server)
884 (nnimap-delete-article article) 898 (nnimap-delete-article article)
885 result))))))) 899 result)))))))
886 900
@@ -889,7 +903,7 @@ textual parts.")
889 (cond 903 (cond
890 ((null articles) 904 ((null articles)
891 nil) 905 nil)
892 ((not (nnimap-possibly-change-group group server)) 906 ((not (nnimap-change-group group server))
893 articles) 907 articles)
894 ((and force 908 ((and force
895 (eq nnmail-expiry-target 'delete)) 909 (eq nnmail-expiry-target 'delete))
@@ -926,7 +940,7 @@ textual parts.")
926 (gnus-server-equal (gnus-group-method nnmail-expiry-target) 940 (gnus-server-equal (gnus-group-method nnmail-expiry-target)
927 (gnus-server-to-method 941 (gnus-server-to-method
928 (format "nnimap:%s" server)))) 942 (format "nnimap:%s" server))))
929 (and (nnimap-possibly-change-group group server) 943 (and (nnimap-change-group group server)
930 (with-current-buffer (nnimap-buffer) 944 (with-current-buffer (nnimap-buffer)
931 (nnheader-message 7 "Expiring articles from %s: %s" group articles) 945 (nnheader-message 7 "Expiring articles from %s: %s" group articles)
932 (nnimap-command 946 (nnimap-command
@@ -956,7 +970,7 @@ textual parts.")
956 (when target 970 (when target
957 (push article deleted-articles)))))))) 971 (push article deleted-articles))))))))
958 ;; Change back to the current group again. 972 ;; Change back to the current group again.
959 (nnimap-possibly-change-group group server) 973 (nnimap-change-group group server)
960 (setq deleted-articles (nreverse deleted-articles)) 974 (setq deleted-articles (nreverse deleted-articles))
961 (nnimap-delete-article (gnus-compress-sequence deleted-articles)) 975 (nnimap-delete-article (gnus-compress-sequence deleted-articles))
962 deleted-articles)) 976 deleted-articles))
@@ -978,23 +992,37 @@ textual parts.")
978 (cdr (assoc "SEARCH" (cdr result)))))))))) 992 (cdr (assoc "SEARCH" (cdr result))))))))))
979 993
980 994
981(defun nnimap-find-article-by-message-id (group message-id) 995(defun nnimap-find-article-by-message-id (group server message-id
996 &optional limit)
997 "Search for message with MESSAGE-ID in GROUP from SERVER.
998If LIMIT, first try to limit the search to the N last articles."
982 (with-current-buffer (nnimap-buffer) 999 (with-current-buffer (nnimap-buffer)
983 (erase-buffer) 1000 (erase-buffer)
984 (unless (or (not group) (equal group (nnimap-group nnimap-object))) 1001 (let* ((change-group-result (nnimap-change-group group server nil t))
985 (setf (nnimap-group nnimap-object) nil) 1002 (number-of-article
986 (setf (nnimap-examined nnimap-object) group) 1003 (and (listp change-group-result)
987 (nnimap-send-command "EXAMINE %S" (utf7-encode group t))) 1004 (catch 'found
988 (let ((sequence 1005 (dolist (result (cdr change-group-result))
989 (nnimap-send-command "UID SEARCH HEADER Message-Id %S" message-id)) 1006 (when (equal "EXISTS" (cadr result))
990 article result) 1007 (throw 'found (car result)))))))
991 (setq result (nnimap-wait-for-response sequence)) 1008 (sequence
992 (when (and result 1009 (nnimap-send-command
993 (car (setq result (nnimap-parse-response)))) 1010 "UID SEARCH%s HEADER Message-Id %S"
994 ;; Select the last instance of the message in the group. 1011 (if (and limit number-of-article)
995 (and (setq article 1012 ;; The -1 is because IMAP message
996 (car (last (cdr (assoc "SEARCH" (cdr result)))))) 1013 ;; numbers are one-based rather than
997 (string-to-number article)))))) 1014 ;; zero-based.
1015 (format " %s:*" (- (string-to-number number-of-article)
1016 limit -1))
1017 "")
1018 message-id)))
1019 (when (nnimap-wait-for-response sequence)
1020 (let ((article (car (last (cdr (assoc "SEARCH"
1021 (nnimap-parse-response)))))))
1022 (if article
1023 (string-to-number article)
1024 (when (and limit number-of-article)
1025 (nnimap-find-article-by-message-id group server message-id))))))))
998 1026
999(defun nnimap-delete-article (articles) 1027(defun nnimap-delete-article (articles)
1000 (with-current-buffer (nnimap-buffer) 1028 (with-current-buffer (nnimap-buffer)
@@ -1015,11 +1043,14 @@ textual parts.")
1015(deffoo nnimap-request-scan (&optional group server) 1043(deffoo nnimap-request-scan (&optional group server)
1016 (when group 1044 (when group
1017 (setq group (nnimap-decode-gnus-group group))) 1045 (setq group (nnimap-decode-gnus-group group)))
1018 (when (and (nnimap-possibly-change-group nil server) 1046 (when (and (nnimap-change-group nil server)
1019 nnimap-inbox 1047 nnimap-inbox
1020 nnimap-split-methods) 1048 nnimap-split-methods)
1021 (nnheader-message 7 "nnimap %s splitting mail..." server) 1049 (nnheader-message 7 "nnimap %s splitting mail..." server)
1022 (nnimap-split-incoming-mail) 1050 (if (listp nnimap-inbox)
1051 (dolist (nnimap-inbox nnimap-inbox)
1052 (nnimap-split-incoming-mail))
1053 (nnimap-split-incoming-mail))
1023 (nnheader-message 7 "nnimap %s splitting mail...done" server))) 1054 (nnheader-message 7 "nnimap %s splitting mail...done" server)))
1024 1055
1025(defun nnimap-marks-to-flags (marks) 1056(defun nnimap-marks-to-flags (marks)
@@ -1031,7 +1062,7 @@ textual parts.")
1031 1062
1032(deffoo nnimap-request-update-group-status (group status &optional server) 1063(deffoo nnimap-request-update-group-status (group status &optional server)
1033 (setq group (nnimap-decode-gnus-group group)) 1064 (setq group (nnimap-decode-gnus-group group))
1034 (when (nnimap-possibly-change-group nil server) 1065 (when (nnimap-change-group nil server)
1035 (let ((command (assoc 1066 (let ((command (assoc
1036 status 1067 status
1037 '((subscribe "SUBSCRIBE") 1068 '((subscribe "SUBSCRIBE")
@@ -1042,7 +1073,7 @@ textual parts.")
1042 1073
1043(deffoo nnimap-request-set-mark (group actions &optional server) 1074(deffoo nnimap-request-set-mark (group actions &optional server)
1044 (setq group (nnimap-decode-gnus-group group)) 1075 (setq group (nnimap-decode-gnus-group group))
1045 (when (nnimap-possibly-change-group group server) 1076 (when (nnimap-change-group group server)
1046 (let (sequence) 1077 (let (sequence)
1047 (with-current-buffer (nnimap-buffer) 1078 (with-current-buffer (nnimap-buffer)
1048 (erase-buffer) 1079 (erase-buffer)
@@ -1067,7 +1098,7 @@ textual parts.")
1067 1098
1068(deffoo nnimap-request-accept-article (group &optional server last) 1099(deffoo nnimap-request-accept-article (group &optional server last)
1069 (setq group (nnimap-decode-gnus-group group)) 1100 (setq group (nnimap-decode-gnus-group group))
1070 (when (nnimap-possibly-change-group nil server) 1101 (when (nnimap-change-group nil server)
1071 (nnmail-check-syntax) 1102 (nnmail-check-syntax)
1072 (let ((message-id (message-field-value "message-id")) 1103 (let ((message-id (message-field-value "message-id"))
1073 sequence message) 1104 sequence message)
@@ -1099,7 +1130,8 @@ textual parts.")
1099 (cons group 1130 (cons group
1100 (or (nnimap-find-uid-response "APPENDUID" (car result)) 1131 (or (nnimap-find-uid-response "APPENDUID" (car result))
1101 (nnimap-find-article-by-message-id 1132 (nnimap-find-article-by-message-id
1102 group message-id)))))))))) 1133 group server message-id
1134 nnimap-request-articles-find-limit))))))))))
1103 1135
1104(defun nnimap-process-quirk (greeting-match type data) 1136(defun nnimap-process-quirk (greeting-match type data)
1105 (when (and (nnimap-greeting nnimap-object) 1137 (when (and (nnimap-greeting nnimap-object)
@@ -1145,7 +1177,7 @@ textual parts.")
1145(deffoo nnimap-request-replace-article (article group buffer) 1177(deffoo nnimap-request-replace-article (article group buffer)
1146 (setq group (nnimap-decode-gnus-group group)) 1178 (setq group (nnimap-decode-gnus-group group))
1147 (let (group-art) 1179 (let (group-art)
1148 (when (and (nnimap-possibly-change-group group nil) 1180 (when (and (nnimap-change-group group)
1149 ;; Put the article into the group. 1181 ;; Put the article into the group.
1150 (with-current-buffer buffer 1182 (with-current-buffer buffer
1151 (setq group-art 1183 (setq group-art
@@ -1180,8 +1212,17 @@ textual parts.")
1180 groups)))) 1212 groups))))
1181 (nreverse groups))) 1213 (nreverse groups)))
1182 1214
1215(defun nnimap-get-responses (sequences)
1216 (let (responses)
1217 (dolist (sequence sequences)
1218 (goto-char (point-min))
1219 (when (re-search-forward (format "^%d " sequence) nil t)
1220 (push (list sequence (nnimap-parse-response))
1221 responses)))
1222 responses))
1223
1183(deffoo nnimap-request-list (&optional server) 1224(deffoo nnimap-request-list (&optional server)
1184 (when (nnimap-possibly-change-group nil server) 1225 (when (nnimap-change-group nil server)
1185 (with-current-buffer nntp-server-buffer 1226 (with-current-buffer nntp-server-buffer
1186 (erase-buffer) 1227 (erase-buffer)
1187 (let ((groups 1228 (let ((groups
@@ -1228,7 +1269,7 @@ textual parts.")
1228 t))))) 1269 t)))))
1229 1270
1230(deffoo nnimap-request-newgroups (date &optional server) 1271(deffoo nnimap-request-newgroups (date &optional server)
1231 (when (nnimap-possibly-change-group nil server) 1272 (when (nnimap-change-group nil server)
1232 (with-current-buffer nntp-server-buffer 1273 (with-current-buffer nntp-server-buffer
1233 (erase-buffer) 1274 (erase-buffer)
1234 (dolist (group (with-current-buffer (nnimap-buffer) 1275 (dolist (group (with-current-buffer (nnimap-buffer)
@@ -1239,14 +1280,15 @@ textual parts.")
1239 t))) 1280 t)))
1240 1281
1241(deffoo nnimap-retrieve-group-data-early (server infos) 1282(deffoo nnimap-retrieve-group-data-early (server infos)
1242 (when (and (nnimap-possibly-change-group nil server) 1283 (when (and (nnimap-change-group nil server)
1243 infos) 1284 infos)
1244 (with-current-buffer (nnimap-buffer) 1285 (with-current-buffer (nnimap-buffer)
1245 (erase-buffer) 1286 (erase-buffer)
1246 (setf (nnimap-group nnimap-object) nil) 1287 (setf (nnimap-group nnimap-object) nil)
1247 (setf (nnimap-initial-resync nnimap-object) 0) 1288 (setf (nnimap-initial-resync nnimap-object) 0)
1248 (let ((qresyncp (nnimap-capability "QRESYNC")) 1289 (let ((qresyncp (nnimap-capability "QRESYNC"))
1249 params groups sequences active uidvalidity modseq group) 1290 params groups sequences active uidvalidity modseq group
1291 unexist)
1250 ;; Go through the infos and gather the data needed to know 1292 ;; Go through the infos and gather the data needed to know
1251 ;; what and how to request the data. 1293 ;; what and how to request the data.
1252 (dolist (info infos) 1294 (dolist (info infos)
@@ -1254,13 +1296,15 @@ textual parts.")
1254 group (nnimap-decode-gnus-group 1296 group (nnimap-decode-gnus-group
1255 (gnus-group-real-name (gnus-info-group info))) 1297 (gnus-group-real-name (gnus-info-group info)))
1256 active (cdr (assq 'active params)) 1298 active (cdr (assq 'active params))
1299 unexist (assq 'unexist (gnus-info-marks info))
1257 uidvalidity (cdr (assq 'uidvalidity params)) 1300 uidvalidity (cdr (assq 'uidvalidity params))
1258 modseq (cdr (assq 'modseq params))) 1301 modseq (cdr (assq 'modseq params)))
1259 (setf (nnimap-examined nnimap-object) group) 1302 (setf (nnimap-examined nnimap-object) group)
1260 (if (and qresyncp 1303 (if (and qresyncp
1261 uidvalidity 1304 uidvalidity
1262 active 1305 active
1263 modseq) 1306 modseq
1307 unexist)
1264 (push 1308 (push
1265 (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" 1309 (list (nnimap-send-command "EXAMINE %S (%s (%s %s))"
1266 (utf7-encode group t) 1310 (utf7-encode group t)
@@ -1279,11 +1323,10 @@ textual parts.")
1279 ;; is read-only or not. 1323 ;; is read-only or not.
1280 "SELECT")) 1324 "SELECT"))
1281 start) 1325 start)
1282 (if (and active uidvalidity) 1326 (if (and active uidvalidity unexist)
1283 ;; Fetch the last 100 flags. 1327 ;; Fetch the last 100 flags.
1284 (setq start (max 1 (- (cdr active) 100))) 1328 (setq start (max 1 (- (cdr active) 100)))
1285 (setf (nnimap-initial-resync nnimap-object) 1329 (incf (nnimap-initial-resync nnimap-object))
1286 (1+ (nnimap-initial-resync nnimap-object)))
1287 (setq start 1)) 1330 (setq start 1))
1288 (push (list (nnimap-send-command "%s %S" command 1331 (push (list (nnimap-send-command "%s %S" command
1289 (utf7-encode group t)) 1332 (utf7-encode group t))
@@ -1303,7 +1346,7 @@ textual parts.")
1303 1346
1304(deffoo nnimap-finish-retrieve-group-infos (server infos sequences) 1347(deffoo nnimap-finish-retrieve-group-infos (server infos sequences)
1305 (when (and sequences 1348 (when (and sequences
1306 (nnimap-possibly-change-group nil server t) 1349 (nnimap-change-group nil server t)
1307 ;; Check that the process is still alive. 1350 ;; Check that the process is still alive.
1308 (get-buffer-process (nnimap-buffer)) 1351 (get-buffer-process (nnimap-buffer))
1309 (memq (process-status (get-buffer-process (nnimap-buffer))) 1352 (memq (process-status (get-buffer-process (nnimap-buffer)))
@@ -1462,6 +1505,25 @@ textual parts.")
1462 (setq new-marks (gnus-range-nconcat old-marks new-marks))) 1505 (setq new-marks (gnus-range-nconcat old-marks new-marks)))
1463 (when new-marks 1506 (when new-marks
1464 (push (cons (car type) new-marks) marks))))) 1507 (push (cons (car type) new-marks) marks)))))
1508 ;; Keep track of non-existing articles.
1509 (let* ((old-unexists (assq 'unexist marks))
1510 (active (gnus-active group))
1511 (unexists
1512 (if completep
1513 (gnus-range-difference
1514 active
1515 (gnus-compress-sequence existing))
1516 (gnus-add-to-range
1517 (cdr old-unexists)
1518 (gnus-list-range-difference
1519 existing (gnus-active group))))))
1520 (when (> (car active) 1)
1521 (setq unexists (gnus-range-add
1522 (cons 1 (1- (car active)))
1523 unexists)))
1524 (if old-unexists
1525 (setcdr old-unexists unexists)
1526 (push (cons 'unexist unexists) marks)))
1465 (gnus-info-set-marks info marks t)))) 1527 (gnus-info-set-marks info marks t))))
1466 ;; Tell Gnus whether there are any \Recent messages in any of 1528 ;; Tell Gnus whether there are any \Recent messages in any of
1467 ;; the groups. 1529 ;; the groups.
@@ -1505,6 +1567,14 @@ textual parts.")
1505 (gnus-sorted-complement existing new-marks)))) 1567 (gnus-sorted-complement existing new-marks))))
1506 (when ticks 1568 (when ticks
1507 (push (cons (car type) ticks) marks))) 1569 (push (cons (car type) ticks) marks)))
1570 (gnus-info-set-marks info marks t))
1571 ;; Add vanished to the list of unexisting articles.
1572 (when vanished
1573 (let* ((old-unexists (assq 'unexist marks))
1574 (unexists (gnus-range-add (cdr old-unexists) vanished)))
1575 (if old-unexists
1576 (setcdr old-unexists unexists)
1577 (push (cons 'unexist unexists) marks)))
1508 (gnus-info-set-marks info marks t)))) 1578 (gnus-info-set-marks info marks t))))
1509 1579
1510(defun nnimap-imap-ranges-to-gnus-ranges (irange) 1580(defun nnimap-imap-ranges-to-gnus-ranges (irange)
@@ -1642,7 +1712,7 @@ textual parts.")
1642 (setq nnimap-status-string "Read-only server") 1712 (setq nnimap-status-string "Read-only server")
1643 nil) 1713 nil)
1644 1714
1645(defvar gnus-refer-thread-use-nnir) ; gnus-sum 1715(defvar gnus-refer-thread-use-nnir) ;; gnus-sum.el
1646(declare-function gnus-fetch-headers "gnus-sum" 1716(declare-function gnus-fetch-headers "gnus-sum"
1647 (articles &optional limit force-new dependencies)) 1717 (articles &optional limit force-new dependencies))
1648 1718
@@ -1653,7 +1723,7 @@ textual parts.")
1653 (setq group (nnimap-decode-gnus-group group))) 1723 (setq group (nnimap-decode-gnus-group group)))
1654 (if gnus-refer-thread-use-nnir 1724 (if gnus-refer-thread-use-nnir
1655 (nnir-search-thread header) 1725 (nnir-search-thread header)
1656 (when (nnimap-possibly-change-group group server) 1726 (when (nnimap-change-group group server)
1657 (let* ((cmd (nnimap-make-thread-query header)) 1727 (let* ((cmd (nnimap-make-thread-query header))
1658 (result (with-current-buffer (nnimap-buffer) 1728 (result (with-current-buffer (nnimap-buffer)
1659 (nnimap-command "UID SEARCH %s" cmd)))) 1729 (nnimap-command "UID SEARCH %s" cmd))))
@@ -1664,7 +1734,14 @@ textual parts.")
1664 (cdr (assoc "SEARCH" (cdr result)))))) 1734 (cdr (assoc "SEARCH" (cdr result))))))
1665 nil t)))))) 1735 nil t))))))
1666 1736
1667(defun nnimap-possibly-change-group (group server &optional no-reconnect) 1737(defun nnimap-change-group (group &optional server no-reconnect read-only)
1738 "Change group to GROUP if non-nil.
1739If SERVER is set, check that server is connected, otherwise retry
1740to reconnect, unless NO-RECONNECT is set to t. Return nil if
1741unsuccessful in connecting.
1742If GROUP is nil, return t.
1743If READ-ONLY is set, send EXAMINE rather than SELECT to the server.
1744Return the server's response to the SELECT or EXAMINE command."
1668 (let ((open-result t)) 1745 (let ((open-result t))
1669 (when (and server 1746 (when (and server
1670 (not (nnimap-server-opened server))) 1747 (not (nnimap-server-opened server)))
@@ -1676,13 +1753,15 @@ textual parts.")
1676 t) 1753 t)
1677 (t 1754 (t
1678 (with-current-buffer (nnimap-buffer) 1755 (with-current-buffer (nnimap-buffer)
1679 (if (equal group (nnimap-group nnimap-object)) 1756 (let ((result (nnimap-command "%s %S"
1680 t 1757 (if read-only
1681 (let ((result (nnimap-command "SELECT %S" (utf7-encode group t)))) 1758 "EXAMINE"
1682 (when (car result) 1759 "SELECT")
1683 (setf (nnimap-group nnimap-object) group 1760 (utf7-encode group t))))
1684 (nnimap-select-result nnimap-object) result) 1761 (when (car result)
1685 result)))))))) 1762 (setf (nnimap-group nnimap-object) group
1763 (nnimap-select-result nnimap-object) result)
1764 result)))))))
1686 1765
1687(defun nnimap-find-connection (buffer) 1766(defun nnimap-find-connection (buffer)
1688 "Find the connection delivering to BUFFER." 1767 "Find the connection delivering to BUFFER."
@@ -1718,15 +1797,24 @@ textual parts.")
1718(defvar nnimap-record-commands nil 1797(defvar nnimap-record-commands nil
1719 "If non-nil, log commands to the \"*imap log*\" buffer.") 1798 "If non-nil, log commands to the \"*imap log*\" buffer.")
1720 1799
1800(defun nnimap-log-buffer ()
1801 (let ((name "*imap log*"))
1802 (or (get-buffer name)
1803 (with-current-buffer (get-buffer-create name)
1804 (when (boundp 'window-point-insertion-type)
1805 (make-local-variable 'window-point-insertion-type)
1806 (setq window-point-insertion-type t))
1807 (current-buffer)))))
1808
1721(defun nnimap-log-command (command) 1809(defun nnimap-log-command (command)
1722 (when nnimap-record-commands 1810 (when nnimap-record-commands
1723 (with-current-buffer (get-buffer-create "*imap log*") 1811 (with-current-buffer (nnimap-log-buffer)
1724 (goto-char (point-max)) 1812 (goto-char (point-max))
1725 (insert (format-time-string "%H:%M:%S") 1813 (insert (format-time-string "%H:%M:%S")
1726 " [" nnimap-address "] " 1814 " [" nnimap-address "] "
1727 (if nnimap-inhibit-logging 1815 (if nnimap-inhibit-logging
1728 "(inhibited)\n" 1816 "(inhibited)\n"
1729 command)))) 1817 command))))
1730 command) 1818 command)
1731 1819
1732(defun nnimap-command (&rest args) 1820(defun nnimap-command (&rest args)
@@ -1865,15 +1953,6 @@ textual parts.")
1865 (forward-line 1))) 1953 (forward-line 1)))
1866 (buffer-substring (point) end)))) 1954 (buffer-substring (point) end))))
1867 1955
1868(defun nnimap-get-responses (sequences)
1869 (let (responses)
1870 (dolist (sequence sequences)
1871 (goto-char (point-min))
1872 (when (re-search-forward (format "^%d " sequence) nil t)
1873 (push (list sequence (nnimap-parse-response))
1874 responses)))
1875 responses))
1876
1877(defvar nnimap-incoming-split-list nil) 1956(defvar nnimap-incoming-split-list nil)
1878 1957
1879(defun nnimap-fetch-inbox (articles) 1958(defun nnimap-fetch-inbox (articles)
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index 120149ae0fb..22dee30e8fa 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -288,7 +288,7 @@ is `(valuefunc member)'."
288(eval-when-compile 288(eval-when-compile
289 (autoload 'nnimap-buffer "nnimap") 289 (autoload 'nnimap-buffer "nnimap")
290 (autoload 'nnimap-command "nnimap") 290 (autoload 'nnimap-command "nnimap")
291 (autoload 'nnimap-possibly-change-group "nnimap") 291 (autoload 'nnimap-change-group "nnimap")
292 (autoload 'nnimap-make-thread-query "nnimap") 292 (autoload 'nnimap-make-thread-query "nnimap")
293 (autoload 'gnus-registry-action "gnus-registry") 293 (autoload 'gnus-registry-action "gnus-registry")
294 (autoload 'gnus-registry-get-id-key "gnus-registry") 294 (autoload 'gnus-registry-get-id-key "gnus-registry")
@@ -973,7 +973,7 @@ details on the language and supported extensions."
973 #'(lambda (group) 973 #'(lambda (group)
974 (let (artlist) 974 (let (artlist)
975 (condition-case () 975 (condition-case ()
976 (when (nnimap-possibly-change-group 976 (when (nnimap-change-group
977 (gnus-group-short-name group) server) 977 (gnus-group-short-name group) server)
978 (with-current-buffer (nnimap-buffer) 978 (with-current-buffer (nnimap-buffer)
979 (message "Searching %s..." group) 979 (message "Searching %s..." group)