comparison lisp/gnus/nnvirtual.el @ 110468:8ceac426a2d7

merge trunk
author Kenichi Handa <handa@m17n.org>
date Tue, 21 Sep 2010 20:45:10 +0900
parents 93e093c035a0
children 417b1e4d63cd
comparison
equal deleted inserted replaced
110384:8d0ea2f29215 110468:8ceac426a2d7
91 91
92 92
93 (deffoo nnvirtual-retrieve-headers (articles &optional newsgroup 93 (deffoo nnvirtual-retrieve-headers (articles &optional newsgroup
94 server fetch-old) 94 server fetch-old)
95 (when (nnvirtual-possibly-change-server server) 95 (when (nnvirtual-possibly-change-server server)
96 (save-excursion 96 (with-current-buffer nntp-server-buffer
97 (set-buffer nntp-server-buffer)
98 (erase-buffer) 97 (erase-buffer)
99 (if (stringp (car articles)) 98 (if (stringp (car articles))
100 'headers 99 'headers
101 (let ((vbuf (nnheader-set-temp-buffer 100 (let ((vbuf (nnheader-set-temp-buffer
102 (get-buffer-create " *virtual headers*"))) 101 (get-buffer-create " *virtual headers*")))
168 167
169 ;; The headers are ready for reading, so they are inserted into 168 ;; The headers are ready for reading, so they are inserted into
170 ;; the nntp-server-buffer, which is where Gnus expects to find 169 ;; the nntp-server-buffer, which is where Gnus expects to find
171 ;; them. 170 ;; them.
172 (prog1 171 (prog1
173 (save-excursion 172 (with-current-buffer nntp-server-buffer
174 (set-buffer nntp-server-buffer)
175 (erase-buffer) 173 (erase-buffer)
176 (insert-buffer-substring vbuf) 174 (insert-buffer-substring vbuf)
177 ;; FIX FIX FIX, we should be able to sort faster than 175 ;; FIX FIX FIX, we should be able to sort faster than
178 ;; this if needed, since each cgroup is sorted, we just 176 ;; this if needed, since each cgroup is sorted, we just
179 ;; need to merge 177 ;; need to merge
213 ((not (gnus-request-group cgroup t)) 211 ((not (gnus-request-group cgroup t))
214 (nnheader-report 'nnvirtual "Can't open component group %s" cgroup)) 212 (nnheader-report 'nnvirtual "Can't open component group %s" cgroup))
215 (t 213 (t
216 (setq nnvirtual-last-accessed-component-group cgroup) 214 (setq nnvirtual-last-accessed-component-group cgroup)
217 (if buffer 215 (if buffer
218 (save-excursion 216 (with-current-buffer buffer
219 (set-buffer buffer)
220 ;; We bind this here to avoid double decoding. 217 ;; We bind this here to avoid double decoding.
221 (let ((gnus-article-decode-hook nil)) 218 (let ((gnus-article-decode-hook nil))
222 (gnus-request-article-this-buffer (cdr amap) cgroup))) 219 (gnus-request-article-this-buffer (cdr amap) cgroup)))
223 (gnus-request-article (cdr amap) cgroup)))))))) 220 (gnus-request-article (cdr amap) cgroup))))))))
224 221
248 (if (not nnvirtual-component-groups) 245 (if (not nnvirtual-component-groups)
249 (nnheader-report 'nnvirtual "No component groups: %s" server) 246 (nnheader-report 'nnvirtual "No component groups: %s" server)
250 t))) 247 t)))
251 248
252 249
253 (deffoo nnvirtual-request-group (group &optional server dont-check) 250 (deffoo nnvirtual-request-group (group &optional server dont-check info)
254 (nnvirtual-possibly-change-server server) 251 (nnvirtual-possibly-change-server server)
255 (setq nnvirtual-component-groups 252 (setq nnvirtual-component-groups
256 (delete (nnvirtual-current-group) nnvirtual-component-groups)) 253 (delete (nnvirtual-current-group) nnvirtual-component-groups))
257 (cond 254 (cond
258 ((null nnvirtual-component-groups) 255 ((null nnvirtual-component-groups)
333 (mapc 330 (mapc
334 (lambda (g) 331 (lambda (g)
335 (when (not (numberp (gnus-group-unread g))) 332 (when (not (numberp (gnus-group-unread g)))
336 (gnus-activate-group g))) 333 (gnus-activate-group g)))
337 nnvirtual-component-groups) 334 nnvirtual-component-groups)
338 (save-excursion 335 (with-current-buffer gnus-group-buffer
339 (set-buffer gnus-group-buffer)
340 (gnus-group-catchup-current nil all))))) 336 (gnus-group-catchup-current nil all)))))
341 337
342 338
343 (deffoo nnvirtual-find-group-art (group article) 339 (deffoo nnvirtual-find-group-art (group article)
344 "Return the real group and article for virtual GROUP and ARTICLE." 340 "Return the real group and article for virtual GROUP and ARTICLE."