annotate lisp/gnus/nnvirtual.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 0293115a14e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; nnvirtual.el --- virtual newsgroups access for Gnus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Copyright (C) 1994,95,96 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: news
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; Boston, MA 02111-1307, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; The other access methods (nntp, nnspool, etc) are general news
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; access methods. This module relies on Gnus and can not be used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; separately.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (require 'nntp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (require 'nnheader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (require 'gnus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (require 'nnoo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (eval-when-compile (require 'cl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (nnoo-declare nnvirtual)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (defvoo nnvirtual-always-rescan nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 "*If non-nil, always scan groups for unread articles when entering a group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 If this variable is nil (which is the default) and you read articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 in a component group after the virtual group has been activated, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 read articles from the component group will show up when you enter the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 virtual group.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defvoo nnvirtual-component-regexp nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "*Regexp to match component groups.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (defconst nnvirtual-version "nnvirtual 1.0")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (defvoo nnvirtual-current-group nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (defvoo nnvirtual-component-groups nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (defvoo nnvirtual-mapping nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (defvoo nnvirtual-status-string "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (autoload 'gnus-cache-articles-in-group "gnus-cache"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;;; Interface functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (nnoo-define-basics nnvirtual)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (deffoo nnvirtual-retrieve-headers (articles &optional newsgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 server fetch-old)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (when (nnvirtual-possibly-change-server server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (set-buffer nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (if (stringp (car articles))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 'headers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (let ((vbuf (nnheader-set-temp-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (get-buffer-create " *virtual headers*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (unfetched (mapcar (lambda (g) (list g))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 nnvirtual-component-groups))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (system-name (system-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 cgroup article result prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (while articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (setq article (assq (pop articles) nnvirtual-mapping))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (when (and (setq cgroup (cadr article))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (gnus-check-server
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (gnus-find-method-for-group cgroup) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (gnus-request-group cgroup t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (setq prefix (gnus-group-real-prefix cgroup))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (when (setq result (gnus-retrieve-headers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (list (caddr article)) cgroup nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (set-buffer nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (if (zerop (buffer-size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (nconc (assq cgroup unfetched) (list (caddr article)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;; If we got HEAD headers, we convert them into NOV
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;; headers. This is slow, inefficient and, come to think
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ;; of it, downright evil. So sue me. I couldn't be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ;; bothered to write a header parse routine that could
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ;; parse a mixed HEAD/NOV buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (when (eq result 'headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (nnvirtual-convert-headers))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (while (not (eobp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (delete-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (point) (progn (read nntp-server-buffer) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (princ (car article) (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 "[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (goto-char (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (or (search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 "\t" (save-excursion (end-of-line) (point)) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (end-of-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (while (= (char-after (1- (point))) ? )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (delete-char 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (if (eolp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (or (= (char-after (1- (point))) ?\t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (insert ?\t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (insert "Xref: " system-name " " cgroup ":")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (princ (caddr article) (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (insert "\t"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (insert "Xref: " system-name " " cgroup ":")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (princ (caddr article) (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (insert " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (if (not (string= "" prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (while (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 "[^ ]+:[0-9]+"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (save-excursion (end-of-line) (point)) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (goto-char (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (insert prefix))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (or (= (char-after (1- (point))) ?\t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (insert ?\t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (set-buffer vbuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (insert-buffer-substring nntp-server-buffer)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ;; In case some of the articles have expired or been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ;; cancelled, we have to mark them as read in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; component group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (while unfetched
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (when (cdar unfetched)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (gnus-group-make-articles-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (caar unfetched) (sort (cdar unfetched) '<)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (setq unfetched (cdr unfetched)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ;; The headers are ready for reading, so they are inserted into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;; the nntp-server-buffer, which is where Gnus expects to find
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ;; them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (prog1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (set-buffer nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (insert-buffer-substring vbuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 'nov)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (kill-buffer vbuf)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (deffoo nnvirtual-request-article (article &optional group server buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (when (and (nnvirtual-possibly-change-server server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (numberp article))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (let* ((amap (assq article nnvirtual-mapping))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (cgroup (cadr amap)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ((not amap)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (nnheader-report 'nnvirtual "No such article: %s" article))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ((not (gnus-check-group cgroup))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (nnheader-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 'nnvirtual "Can't open server where %s exists" cgroup))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ((not (gnus-request-group cgroup t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (nnheader-report 'nnvirtual "Can't open component group %s" cgroup))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (if buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (gnus-request-article-this-buffer (caddr amap) cgroup))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (gnus-request-article (caddr amap) cgroup)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (deffoo nnvirtual-open-server (server &optional defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (unless (assq 'nnvirtual-component-regexp defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (push `(nnvirtual-component-regexp ,server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 defs))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (nnoo-change-server 'nnvirtual server defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (if nnvirtual-component-groups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (setq nnvirtual-mapping nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 ;; Go through the newsrc alist and find all component groups.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (let ((newsrc (cdr gnus-newsrc-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (while (setq group (car (pop newsrc)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (when (string-match nnvirtual-component-regexp group) ; Match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ;; Add this group to the list of component groups.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (setq nnvirtual-component-groups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (cons group (delete group nnvirtual-component-groups))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (if (not nnvirtual-component-groups)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (nnheader-report 'nnvirtual "No component groups: %s" server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (deffoo nnvirtual-request-group (group &optional server dont-check)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (nnvirtual-possibly-change-server server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (setq nnvirtual-component-groups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (delete (nnvirtual-current-group) nnvirtual-component-groups))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ((null nnvirtual-component-groups)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (setq nnvirtual-current-group nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (nnheader-report 'nnvirtual "No component groups in %s" group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (unless dont-check
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (nnvirtual-create-mapping))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (setq nnvirtual-current-group group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (let ((len (length nnvirtual-mapping)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (nnheader-insert "211 %d 1 %d %s\n" len len group)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (deffoo nnvirtual-request-type (group &optional article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (if (not article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 'unknown
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (let ((mart (assq article nnvirtual-mapping)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (when mart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (gnus-request-type (cadr mart) (car mart))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (deffoo nnvirtual-request-update-mark (group article mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (let* ((nart (assq article nnvirtual-mapping))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (cgroup (cadr nart))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 ;; The component group might be a virtual group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (nmark (gnus-request-update-mark cgroup (caddr nart) mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (when (and nart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (= mark nmark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (gnus-group-auto-expirable-p cgroup))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (setq mark gnus-expirable-mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (deffoo nnvirtual-close-group (group &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (when (nnvirtual-possibly-change-server server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ;; Copy (un)read articles.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (nnvirtual-update-reads)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;; We copy the marks from this group to the component
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ;; groups here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (nnvirtual-update-marked))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (deffoo nnvirtual-request-list (&optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (nnheader-report 'nnvirtual "LIST is not implemented."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (deffoo nnvirtual-request-newgroups (date &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (nnheader-report 'nnvirtual "NEWGROUPS is not supported."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (deffoo nnvirtual-request-list-newsgroups (&optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (nnheader-report 'nnvirtual "LIST NEWSGROUPS is not implemented."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (deffoo nnvirtual-request-update-info (group info &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (when (nnvirtual-possibly-change-server server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (let ((map nnvirtual-mapping)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (marks (mapcar (lambda (m) (list (cdr m))) gnus-article-mark-lists))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 reads mr m op)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ;; Go through the mapping.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (while map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (unless (nth 3 (setq m (pop map)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ;; Read article.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (push (car m) reads))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ;; Copy marks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (when (setq mr (nth 4 m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (while mr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (setcdr (setq op (assq (pop mr) marks)) (cons (car m) (cdr op))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 ;; Compress the marks and the reads.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (setq mr marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (while mr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (setcdr (car mr) (gnus-compress-sequence (sort (cdr (pop mr)) '<))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (setcar (cddr info) (gnus-compress-sequence (nreverse reads)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 ;; Remove empty marks lists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (while (and marks (not (cdar marks)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (setq marks (cdr marks)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (setq mr marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (while (cdr mr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (if (cdadr mr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (setq mr (cdr mr))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (setcdr mr (cddr mr))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ;; Enter these new marks into the info of the group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (if (nthcdr 3 info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (setcar (nthcdr 3 info) marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ;; Add the marks lists to the end of the info.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (when marks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (setcdr (nthcdr 2 info) (list marks))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (deffoo nnvirtual-catchup-group (group &optional server all)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (nnvirtual-possibly-change-server server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (let ((gnus-group-marked (copy-sequence nnvirtual-component-groups))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (gnus-expert-user t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ;; Make sure all groups are activated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (lambda (g)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (when (not (numberp (car (gnus-gethash g gnus-newsrc-hashtb))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (gnus-activate-group g)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 nnvirtual-component-groups)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (set-buffer gnus-group-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (gnus-group-catchup-current nil all))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (deffoo nnvirtual-find-group-art (group article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 "Return the real group and article for virtual GROUP and ARTICLE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (let ((mart (assq article nnvirtual-mapping)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (when mart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (cons (cadr mart) (caddr mart)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 ;;; Internal functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (defun nnvirtual-convert-headers ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 "Convert HEAD headers into NOV headers."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (set-buffer nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (let* ((dependencies (make-vector 100 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (headers (gnus-get-newsgroup-headers dependencies))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (while (setq header (pop headers))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (nnheader-insert-nov header)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (defun nnvirtual-possibly-change-server (server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (or (not server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (nnoo-current-server-p 'nnvirtual server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (nnvirtual-open-server server)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (defun nnvirtual-update-marked ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 "Copy marks from the virtual group to the component groups."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (let ((mark-lists gnus-article-mark-lists)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (marks (gnus-info-marks (gnus-get-info (nnvirtual-current-group))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 type list mart cgroups)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (while (setq type (cdr (pop mark-lists)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (setq list (gnus-uncompress-range (cdr (assq type marks))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (setq cgroups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (mapcar (lambda (g) (list g)) nnvirtual-component-groups))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (while list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (nconc (assoc (cadr (setq mart (assq (pop list) nnvirtual-mapping)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 cgroups)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (list (caddr mart))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (while cgroups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (gnus-add-marked-articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (caar cgroups) type (cdar cgroups) nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (gnus-group-update-group (car (pop cgroups)) t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (defun nnvirtual-update-reads ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 "Copy (un)reads from the current group to the component groups."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (let ((groups (mapcar (lambda (g) (list g)) nnvirtual-component-groups))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (articles (gnus-list-of-unread-articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (nnvirtual-current-group)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (while articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (setq m (assq (pop articles) nnvirtual-mapping))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (nconc (assoc (nth 1 m) groups) (list (nth 2 m))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (while groups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (gnus-update-read-articles (caar groups) (cdr (pop groups))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (defun nnvirtual-current-group ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 "Return the prefixed name of the current nnvirtual group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (concat "nnvirtual:" nnvirtual-current-group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (defsubst nnvirtual-marks (article marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 "Return a list of mark types for ARTICLE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (let (out)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (while marks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (when (memq article (cdar marks))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (push (caar marks) out))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (setq marks (cdr marks)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 out))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (defun nnvirtual-create-mapping ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 "Create an article mapping for the current group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (let* ((div nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 m marks list article unreads marks active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (map (sort
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (apply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 'nconc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (lambda (g)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (when (and (setq active (gnus-activate-group g))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (> (cdr active) (car active)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (setq unreads (gnus-list-of-unread-articles g)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 marks (gnus-uncompress-marks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (gnus-info-marks (gnus-get-info g))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (when gnus-use-cache
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (push (cons 'cache (gnus-cache-articles-in-group g))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 marks))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (setq div (/ (float (car active))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (if (zerop (cdr active))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 1 (cdr active))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (mapcar (lambda (n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (list (* div (- n (car active)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 g n (and (memq n unreads) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (inline (nnvirtual-marks n marks))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (gnus-uncompress-range active))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 nnvirtual-component-groups))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (lambda (m1 m2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (< (car m1) (car m2)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (i 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (setq nnvirtual-mapping map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 ;; Set the virtual article numbers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (while (setq m (pop map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (setcar m (setq article (incf i))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (provide 'nnvirtual)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 ;;; nnvirtual.el ends here