Mercurial > emacs
annotate lisp/gnus/gnus-start.el @ 89983:0796fc36c2bd
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-43
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-553
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-557
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-558
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-559
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-561
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-30
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 21 Sep 2004 09:34:12 +0000 |
parents | cce1c0ee76ee 497f0d2ca551 |
children | f3ec05478165 |
rev | line source |
---|---|
17493 | 1 ;;; gnus-start.el --- startup functions for Gnus |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
3 ;; Free Software Foundation, Inc. |
17493 | 4 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 6 ;; Keywords: news |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
24 | |
25 ;;; Commentary: | |
26 | |
27 ;;; Code: | |
28 | |
29 (require 'gnus) | |
30 (require 'gnus-win) | |
31 (require 'gnus-int) | |
32 (require 'gnus-spec) | |
33 (require 'gnus-range) | |
34 (require 'gnus-util) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
35 (autoload 'message-make-date "message") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
36 (autoload 'gnus-agent-read-servers-validate "gnus-agent") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
37 (autoload 'gnus-agent-possibly-alter-active "gnus-agent") |
19520
6496595d79b8
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
38 (eval-when-compile (require 'cl)) |
17493 | 39 |
40 (defcustom gnus-startup-file (nnheader-concat gnus-home-directory ".newsrc") | |
41 "Your `.newsrc' file. | |
42 `.newsrc-SERVER' will be used instead if that exists." | |
43 :group 'gnus-start | |
44 :type 'file) | |
45 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
46 (defcustom gnus-backup-startup-file 'never |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
47 "Whether to create backup files. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
48 This variable takes the same values as the `version-control' |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
49 variable." |
57153
497f0d2ca551
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-558
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
50 :version "21.4" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
51 :group 'gnus-start |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
52 :type '(choice (const :tag "Never" never) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
53 (const :tag "If existing" nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
54 (other :tag "Always" t))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
55 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
56 (defcustom gnus-save-startup-file-via-temp-buffer t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
57 "Whether to write the startup file contents to a buffer then save |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
58 the buffer or write directly to the file. The buffer is faster |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
59 because all of the contents are written at once. The direct write |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
60 uses considerably less memory." |
57153
497f0d2ca551
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-558
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
61 :version "21.4" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
62 :group 'gnus-start |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
63 :type '(choice (const :tag "Write via buffer" t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
64 (const :tag "Write directly to file" nil))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
65 |
17493 | 66 (defcustom gnus-init-file (nnheader-concat gnus-home-directory ".gnus") |
19910
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
67 "Your Gnus Emacs-Lisp startup file name. |
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
68 If a file with the `.el' or `.elc' suffixes exists, it will be read instead." |
17493 | 69 :group 'gnus-start |
70 :type 'file) | |
71 | |
72 (defcustom gnus-site-init-file | |
19520
6496595d79b8
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
73 (condition-case nil |
19910
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
74 (concat (file-name-directory |
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
75 (directory-file-name installation-directory)) |
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
76 "site-lisp/gnus-init") |
19520
6496595d79b8
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
77 (error nil)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
78 "The site-wide Gnus Emacs-Lisp startup file name, or nil if none. |
19910
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
79 If a file with the `.el' or `.elc' suffixes exists, it will be read instead." |
17493 | 80 :group 'gnus-start |
19910
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
81 :type '(choice file (const nil))) |
17493 | 82 |
83 (defcustom gnus-default-subscribed-newsgroups nil | |
19910
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
84 "List of newsgroups to subscribe, when a user runs Gnus the first time. |
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
85 The value should be a list of strings. |
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
86 If it is t, Gnus will not do anything special the first time it is |
17493 | 87 started; it'll just use the normal newsgroups subscription methods." |
88 :group 'gnus-start | |
19910
103cd29aea6f
(gnus-default-subscribed-newsgroups): Fix custom type. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
19520
diff
changeset
|
89 :type '(choice (repeat string) (const :tag "Nothing special" t))) |
17493 | 90 |
91 (defcustom gnus-use-dribble-file t | |
92 "*Non-nil means that Gnus will use a dribble file to store user updates. | |
93 If Emacs should crash without saving the .newsrc files, complete | |
94 information can be restored from the dribble file." | |
95 :group 'gnus-dribble-file | |
96 :type 'boolean) | |
97 | |
98 (defcustom gnus-dribble-directory nil | |
99 "*The directory where dribble files will be saved. | |
100 If this variable is nil, the directory where the .newsrc files are | |
101 saved will be used." | |
102 :group 'gnus-dribble-file | |
103 :type '(choice directory (const nil))) | |
104 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
105 (defcustom gnus-check-new-newsgroups 'ask-server |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
106 "*Non-nil means that Gnus will run `gnus-find-new-newsgroups' at startup. |
17493 | 107 This normally finds new newsgroups by comparing the active groups the |
108 servers have already reported with those Gnus already knows, either alive | |
109 or killed. | |
110 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
111 When any of the following are true, `gnus-find-new-newsgroups' will instead |
17493 | 112 ask the servers (primary, secondary, and archive servers) to list new |
113 groups since the last time it checked: | |
114 1. This variable is `ask-server'. | |
115 2. This variable is a list of select methods (see below). | |
116 3. `gnus-read-active-file' is nil or `some'. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
117 4. A prefix argument is given to `gnus-find-new-newsgroups' interactively. |
17493 | 118 |
119 Thus, if this variable is `ask-server' or a list of select methods or | |
120 `gnus-read-active-file' is nil or `some', then the killed list is no | |
121 longer necessary, so you could safely set `gnus-save-killed-list' to nil. | |
122 | |
123 This variable can be a list of select methods which Gnus will query with | |
124 the `ask-server' method in addition to the primary, secondary, and archive | |
125 servers. | |
126 | |
127 Eg. | |
128 (setq gnus-check-new-newsgroups | |
129 '((nntp \"some.server\") (nntp \"other.server\"))) | |
130 | |
131 If this variable is nil, then you have to tell Gnus explicitly to | |
132 check for new newsgroups with \\<gnus-group-mode-map>\\[gnus-find-new-newsgroups]." | |
133 :group 'gnus-start | |
134 :type '(choice (const :tag "no" nil) | |
135 (const :tag "by brute force" t) | |
136 (const :tag "ask servers" ask-server) | |
137 (repeat :menu-tag "ask additional servers" | |
138 :tag "ask additional servers" | |
139 :value ((nntp "")) | |
140 (sexp :format "%v")))) | |
141 | |
142 (defcustom gnus-check-bogus-newsgroups nil | |
143 "*Non-nil means that Gnus will check and remove bogus newsgroup at startup. | |
144 If this variable is nil, then you have to tell Gnus explicitly to | |
145 check for bogus newsgroups with \\<gnus-group-mode-map>\\[gnus-group-check-bogus-groups]." | |
146 :group 'gnus-start-server | |
147 :type 'boolean) | |
148 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
149 (defcustom gnus-read-active-file 'some |
17493 | 150 "*Non-nil means that Gnus will read the entire active file at startup. |
151 If this variable is nil, Gnus will only know about the groups in your | |
152 `.newsrc' file. | |
153 | |
154 If this variable is `some', Gnus will try to only read the relevant | |
155 parts of the active file from the server. Not all servers support | |
156 this, and it might be quite slow with other servers, but this should | |
157 generally be faster than both the t and nil value. | |
158 | |
159 If you set this variable to nil or `some', you probably still want to | |
160 be told about new newsgroups that arrive. To do that, set | |
161 `gnus-check-new-newsgroups' to `ask-server'. This may not work | |
162 properly with all servers." | |
163 :group 'gnus-start-server | |
164 :type '(choice (const nil) | |
165 (const some) | |
166 (const t))) | |
167 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
168 (defconst gnus-level-subscribed 5 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
169 "Groups with levels less than or equal to this variable are subscribed.") |
17493 | 170 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
171 (defconst gnus-level-unsubscribed 7 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
172 "Groups with levels less than or equal to this variable are unsubscribed. |
17493 | 173 Groups with levels less than `gnus-level-subscribed', which should be |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
174 less than this variable, are subscribed.") |
17493 | 175 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
176 (defconst gnus-level-zombie 8 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
177 "Groups with this level are zombie groups.") |
17493 | 178 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
179 (defconst gnus-level-killed 9 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
180 "Groups with this level are killed.") |
17493 | 181 |
182 (defcustom gnus-level-default-subscribed 3 | |
183 "*New subscribed groups will be subscribed at this level." | |
184 :group 'gnus-group-levels | |
185 :type 'integer) | |
186 | |
187 (defcustom gnus-level-default-unsubscribed 6 | |
188 "*New unsubscribed groups will be unsubscribed at this level." | |
189 :group 'gnus-group-levels | |
190 :type 'integer) | |
191 | |
192 (defcustom gnus-activate-level (1+ gnus-level-subscribed) | |
193 "*Groups higher than this level won't be activated on startup. | |
194 Setting this variable to something low might save lots of time when | |
195 you have many groups that you aren't interested in." | |
196 :group 'gnus-group-levels | |
197 :type 'integer) | |
198 | |
199 (defcustom gnus-activate-foreign-newsgroups 4 | |
200 "*If nil, Gnus will not check foreign newsgroups at startup. | |
201 If it is non-nil, it should be a number between one and nine. Foreign | |
202 newsgroups that have a level lower or equal to this number will be | |
203 activated on startup. For instance, if you want to active all | |
204 subscribed newsgroups, but not the rest, you'd set this variable to | |
205 `gnus-level-subscribed'. | |
206 | |
207 If you subscribe to lots of newsgroups from different servers, startup | |
208 might take a while. By setting this variable to nil, you'll save time, | |
209 but you won't be told how many unread articles there are in the | |
210 groups." | |
211 :group 'gnus-group-levels | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
212 :type '(choice integer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
213 (const :tag "none" nil))) |
17493 | 214 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
215 (defcustom gnus-read-newsrc-file t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
216 "*Non-nil means that Gnus will read the `.newsrc' file. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
217 Gnus always reads its own startup file, which is called |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
218 \".newsrc.eld\". The file called \".newsrc\" is in a format that can |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
219 be readily understood by other newsreaders. If you don't plan on |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
220 using other newsreaders, set this variable to nil to save some time on |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
221 entry." |
33396
e2512753e160
(gnus-read-newsrc-file): Add :version.
Dave Love <fx@gnu.org>
parents:
33327
diff
changeset
|
222 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
223 :group 'gnus-newsrc |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
224 :type 'boolean) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
225 |
17493 | 226 (defcustom gnus-save-newsrc-file t |
227 "*Non-nil means that Gnus will save the `.newsrc' file. | |
228 Gnus always saves its own startup file, which is called | |
229 \".newsrc.eld\". The file called \".newsrc\" is in a format that can | |
230 be readily understood by other newsreaders. If you don't plan on | |
231 using other newsreaders, set this variable to nil to save some time on | |
232 exit." | |
233 :group 'gnus-newsrc | |
234 :type 'boolean) | |
235 | |
236 (defcustom gnus-save-killed-list t | |
237 "*If non-nil, save the list of killed groups to the startup file. | |
238 If you set this variable to nil, you'll save both time (when starting | |
239 and quitting) and space (both memory and disk), but it will also mean | |
240 that Gnus has no record of which groups are new and which are old, so | |
241 the automatic new newsgroups subscription methods become meaningless. | |
242 | |
243 You should always set `gnus-check-new-newsgroups' to `ask-server' or | |
244 nil if you set this variable to nil. | |
245 | |
246 This variable can also be a regexp. In that case, all groups that do | |
247 not match this regexp will be removed before saving the list." | |
248 :group 'gnus-newsrc | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
249 :type '(radio (sexp :format "Non-nil\n" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
250 :match (lambda (widget value) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
251 (and value (not (stringp value)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
252 :value t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
253 (const nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
254 (regexp :format "%t: %v\n" :size 0))) |
17493 | 255 |
256 (defcustom gnus-ignored-newsgroups | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
257 (mapconcat 'identity |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
258 '("^to\\." ; not "real" groups |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
259 "^[0-9. \t]+\\( \\|$\\)" ; all digits in name |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
260 "^[\"][]\"[#'()]" ; bogus characters |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
261 ) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
262 "\\|") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
263 "*A regexp to match uninteresting newsgroups in the active file. |
17493 | 264 Any lines in the active file matching this regular expression are |
265 removed from the newsgroup list before anything else is done to it, | |
266 thus making them effectively non-existent." | |
267 :group 'gnus-group-new | |
268 :type 'regexp) | |
269 | |
270 (defcustom gnus-subscribe-newsgroup-method 'gnus-subscribe-zombies | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
271 "*Function(s) called with a group name when new group is detected. |
17493 | 272 A few pre-made functions are supplied: `gnus-subscribe-randomly' |
273 inserts new groups at the beginning of the list of groups; | |
274 `gnus-subscribe-alphabetically' inserts new groups in strict | |
275 alphabetic order; `gnus-subscribe-hierarchically' inserts new groups | |
276 in hierarchical newsgroup order; `gnus-subscribe-interactively' asks | |
277 for your decision; `gnus-subscribe-killed' kills all new groups; | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
278 `gnus-subscribe-zombies' will make all new groups into zombies; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
279 `gnus-subscribe-topics' will enter groups into the topics that |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
280 claim them." |
17493 | 281 :group 'gnus-group-new |
282 :type '(radio (function-item gnus-subscribe-randomly) | |
283 (function-item gnus-subscribe-alphabetically) | |
284 (function-item gnus-subscribe-hierarchically) | |
285 (function-item gnus-subscribe-interactively) | |
286 (function-item gnus-subscribe-killed) | |
287 (function-item gnus-subscribe-zombies) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
288 (function-item gnus-subscribe-topics) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
289 function |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
290 (repeat function))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
291 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
292 (defcustom gnus-subscribe-newsgroup-hooks nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
293 "*Hooks run after you subscribe to a new group. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
294 The hooks will be called with new group's name as argument." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
295 :group 'gnus-group-new |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
296 :type 'hook) |
17493 | 297 |
298 (defcustom gnus-subscribe-options-newsgroup-method | |
299 'gnus-subscribe-alphabetically | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
300 "*Function(s) called to subscribe newsgroups mentioned on \"options -n\" lines. |
17493 | 301 If, for instance, you want to subscribe to all newsgroups in the |
302 \"no\" and \"alt\" hierarchies, you'd put the following in your | |
303 .newsrc file: | |
304 | |
305 options -n no.all alt.all | |
306 | |
307 Gnus will the subscribe all new newsgroups in these hierarchies with | |
308 the subscription method in this variable." | |
309 :group 'gnus-group-new | |
310 :type '(radio (function-item gnus-subscribe-randomly) | |
311 (function-item gnus-subscribe-alphabetically) | |
312 (function-item gnus-subscribe-hierarchically) | |
313 (function-item gnus-subscribe-interactively) | |
314 (function-item gnus-subscribe-killed) | |
315 (function-item gnus-subscribe-zombies) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
316 (function-item gnus-subscribe-topics) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
317 function |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
318 (repeat function))) |
17493 | 319 |
320 (defcustom gnus-subscribe-hierarchical-interactive nil | |
321 "*If non-nil, Gnus will offer to subscribe hierarchically. | |
322 When a new hierarchy appears, Gnus will ask the user: | |
323 | |
324 'alt.binaries': Do you want to subscribe to this hierarchy? ([d]ys): | |
325 | |
326 If the user pressed `d', Gnus will descend the hierarchy, `y' will | |
327 subscribe to all newsgroups in the hierarchy and `s' will skip this | |
328 hierarchy in its entirety." | |
329 :group 'gnus-group-new | |
330 :type 'boolean) | |
331 | |
332 (defcustom gnus-auto-subscribed-groups | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
333 "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl\\|^nnmaildir" |
17493 | 334 "*All new groups that match this regexp will be subscribed automatically. |
335 Note that this variable only deals with new groups. It has no effect | |
336 whatsoever on old groups. | |
337 | |
338 New groups that match this regexp will not be handled by | |
339 `gnus-subscribe-newsgroup-method'. Instead, they will | |
340 be subscribed using `gnus-subscribe-options-newsgroup-method'." | |
341 :group 'gnus-group-new | |
342 :type 'regexp) | |
343 | |
344 (defcustom gnus-options-subscribe nil | |
345 "*All new groups matching this regexp will be subscribed unconditionally. | |
346 Note that this variable deals only with new newsgroups. This variable | |
347 does not affect old newsgroups. | |
348 | |
349 New groups that match this regexp will not be handled by | |
350 `gnus-subscribe-newsgroup-method'. Instead, they will | |
351 be subscribed using `gnus-subscribe-options-newsgroup-method'." | |
352 :group 'gnus-group-new | |
353 :type '(choice regexp | |
354 (const :tag "none" nil))) | |
355 | |
356 (defcustom gnus-options-not-subscribe nil | |
357 "*All new groups matching this regexp will be ignored. | |
358 Note that this variable deals only with new newsgroups. This variable | |
359 does not affect old (already subscribed) newsgroups." | |
360 :group 'gnus-group-new | |
361 :type '(choice regexp | |
362 (const :tag "none" nil))) | |
363 | |
364 (defcustom gnus-modtime-botch nil | |
365 "*Non-nil means .newsrc should be deleted prior to save. | |
366 Its use is due to the bogus appearance that .newsrc was modified on | |
367 disc." | |
368 :group 'gnus-newsrc | |
369 :type 'boolean) | |
370 | |
371 (defcustom gnus-check-bogus-groups-hook nil | |
372 "A hook run after removing bogus groups." | |
373 :group 'gnus-start-server | |
374 :type 'hook) | |
375 | |
376 (defcustom gnus-startup-hook nil | |
377 "A hook called at startup. | |
378 This hook is called after Gnus is connected to the NNTP server." | |
379 :group 'gnus-start | |
380 :type 'hook) | |
381 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
382 (defcustom gnus-before-startup-hook nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
383 "A hook called at before startup. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
384 This hook is called as the first thing when Gnus is started." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
385 :group 'gnus-start |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
386 :type 'hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
387 |
17493 | 388 (defcustom gnus-started-hook nil |
389 "A hook called as the last thing after startup." | |
390 :group 'gnus-start | |
391 :type 'hook) | |
392 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
393 (defcustom gnus-setup-news-hook |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
394 '(gnus-fixup-nnimap-unread-after-getting-new-news) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
395 "A hook after reading the .newsrc file, but before generating the buffer." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
396 :group 'gnus-start |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
397 :type 'hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
398 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
399 (defcustom gnus-get-top-new-news-hook nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
400 "A hook run just before Gnus checks for new news globally." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
401 :group 'gnus-group-new |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
402 :type 'hook) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
403 |
17493 | 404 (defcustom gnus-get-new-news-hook nil |
405 "A hook run just before Gnus checks for new news." | |
406 :group 'gnus-group-new | |
407 :type 'hook) | |
408 | |
409 (defcustom gnus-after-getting-new-news-hook | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
410 '(gnus-display-time-event-handler |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
411 gnus-fixup-nnimap-unread-after-getting-new-news) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
412 "*A hook run after Gnus checks for new news when Gnus is already running." |
17493 | 413 :group 'gnus-group-new |
414 :type 'hook) | |
415 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
416 (defcustom gnus-read-newsrc-el-hook nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
417 "A hook called after reading the newsrc.eld? file." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
418 :group 'gnus-newsrc |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
419 :type 'hook) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
420 |
17493 | 421 (defcustom gnus-save-newsrc-hook nil |
422 "A hook called before saving any of the newsrc files." | |
423 :group 'gnus-newsrc | |
424 :type 'hook) | |
425 | |
426 (defcustom gnus-save-quick-newsrc-hook nil | |
427 "A hook called just before saving the quick newsrc file. | |
428 Can be used to turn version control on or off." | |
429 :group 'gnus-newsrc | |
430 :type 'hook) | |
431 | |
432 (defcustom gnus-save-standard-newsrc-hook nil | |
433 "A hook called just before saving the standard newsrc file. | |
434 Can be used to turn version control on or off." | |
435 :group 'gnus-newsrc | |
436 :type 'hook) | |
437 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
438 (defcustom gnus-group-mode-hook nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
439 "Hook for Gnus group mode." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
440 :group 'gnus-group-various |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
441 :options '(gnus-topic-mode) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
442 :type 'hook) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
443 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
444 (defcustom gnus-always-read-dribble-file nil |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
445 "Unconditionally read the dribble file." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
446 :group 'gnus-newsrc |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
447 :type 'boolean) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
448 |
38627
6520def531cc
(gnus-startup-file-coding-system): Revert to binary.
Gerd Moellmann <gerd@gnu.org>
parents:
38612
diff
changeset
|
449 ;;; Internal variables |
6520def531cc
(gnus-startup-file-coding-system): Revert to binary.
Gerd Moellmann <gerd@gnu.org>
parents:
38612
diff
changeset
|
450 |
88919
acc369108294
(gnus-read-newsrc-el-file): Don't bind
Dave Love <fx@gnu.org>
parents:
42628
diff
changeset
|
451 ;; Fixme: deal with old emacs-mule when mm-universal-coding-system is |
acc369108294
(gnus-read-newsrc-el-file): Don't bind
Dave Love <fx@gnu.org>
parents:
42628
diff
changeset
|
452 ;; utf-8-emacs. |
42627
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
453 (defvar gnus-ding-file-coding-system mm-universal-coding-system |
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
454 "Coding system for ding file.") |
17493 | 455 |
456 (defvar gnus-newsrc-file-version nil) | |
457 (defvar gnus-override-subscribe-method nil) | |
458 (defvar gnus-dribble-buffer nil) | |
459 (defvar gnus-newsrc-options nil | |
460 "Options line in the .newsrc file.") | |
461 | |
462 (defvar gnus-newsrc-options-n nil | |
463 "List of regexps representing groups to be subscribed/ignored unconditionally.") | |
464 | |
465 (defvar gnus-newsrc-last-checked-date nil | |
466 "Date Gnus last asked server for new newsgroups.") | |
467 | |
468 (defvar gnus-current-startup-file nil | |
469 "Startup file for the current host.") | |
470 | |
471 ;; Byte-compiler warning. | |
472 (defvar gnus-group-line-format) | |
473 | |
474 ;; Suggested by Brian Edmonds <edmonds@cs.ubc.ca>. | |
475 (defvar gnus-init-inhibit nil) | |
476 (defun gnus-read-init-file (&optional inhibit-next) | |
477 ;; Don't load .gnus if the -q option was used. | |
478 (when init-file-user | |
479 (if gnus-init-inhibit | |
480 (setq gnus-init-inhibit nil) | |
481 (setq gnus-init-inhibit inhibit-next) | |
42627
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
482 (dolist (file (list gnus-site-init-file gnus-init-file)) |
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
483 (when (and file |
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
484 (locate-library file)) |
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
485 (if (or debug-on-error debug-on-quit) |
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
486 (load file nil t) |
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
487 (condition-case var |
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
488 (load file nil t) |
2270bf351eba
* gnus-start.el (gnus-read-init-file): Cleaned up.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38627
diff
changeset
|
489 (error |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
490 (error "Error in %s: %s" file (cadr var)))))))))) |
17493 | 491 |
492 ;; For subscribing new newsgroup | |
493 | |
494 (defun gnus-subscribe-hierarchical-interactive (groups) | |
495 (let ((groups (sort groups 'string<)) | |
496 prefixes prefix start ans group starts) | |
497 (while groups | |
498 (setq prefixes (list "^")) | |
499 (while (and groups prefixes) | |
500 (while (not (string-match (car prefixes) (car groups))) | |
501 (setq prefixes (cdr prefixes))) | |
502 (setq prefix (car prefixes)) | |
503 (setq start (1- (length prefix))) | |
504 (if (and (string-match "[^\\.]\\." (car groups) start) | |
505 (cdr groups) | |
506 (setq prefix | |
507 (concat "^" (substring (car groups) 0 (match-end 0)))) | |
508 (string-match prefix (cadr groups))) | |
509 (progn | |
510 (push prefix prefixes) | |
511 (message "Descend hierarchy %s? ([y]nsq): " | |
512 (substring prefix 1 (1- (length prefix)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
513 (while (not (memq (setq ans (read-char-exclusive)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
514 '(?y ?\n ?\r ?n ?s ?q))) |
17493 | 515 (ding) |
516 (message "Descend hierarchy %s? ([y]nsq): " | |
517 (substring prefix 1 (1- (length prefix))))) | |
518 (cond ((= ans ?n) | |
519 (while (and groups | |
520 (string-match prefix | |
521 (setq group (car groups)))) | |
522 (push group gnus-killed-list) | |
523 (gnus-sethash group group gnus-killed-hashtb) | |
524 (setq groups (cdr groups))) | |
525 (setq starts (cdr starts))) | |
526 ((= ans ?s) | |
527 (while (and groups | |
528 (string-match prefix | |
529 (setq group (car groups)))) | |
530 (gnus-sethash group group gnus-killed-hashtb) | |
531 (gnus-subscribe-alphabetically (car groups)) | |
532 (setq groups (cdr groups))) | |
533 (setq starts (cdr starts))) | |
534 ((= ans ?q) | |
535 (while groups | |
536 (setq group (car groups)) | |
537 (push group gnus-killed-list) | |
538 (gnus-sethash group group gnus-killed-hashtb) | |
539 (setq groups (cdr groups)))) | |
540 (t nil))) | |
541 (message "Subscribe %s? ([n]yq)" (car groups)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
542 (while (not (memq (setq ans (read-char-exclusive)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
543 '(?y ?\n ?\r ?q ?n))) |
17493 | 544 (ding) |
545 (message "Subscribe %s? ([n]yq)" (car groups))) | |
546 (setq group (car groups)) | |
547 (cond ((= ans ?y) | |
548 (gnus-subscribe-alphabetically (car groups)) | |
549 (gnus-sethash group group gnus-killed-hashtb)) | |
550 ((= ans ?q) | |
551 (while groups | |
552 (setq group (car groups)) | |
553 (push group gnus-killed-list) | |
554 (gnus-sethash group group gnus-killed-hashtb) | |
555 (setq groups (cdr groups)))) | |
556 (t | |
557 (push group gnus-killed-list) | |
558 (gnus-sethash group group gnus-killed-hashtb))) | |
559 (setq groups (cdr groups))))))) | |
560 | |
561 (defun gnus-subscribe-randomly (newsgroup) | |
562 "Subscribe new NEWSGROUP by making it the first newsgroup." | |
563 (gnus-subscribe-newsgroup newsgroup)) | |
564 | |
565 (defun gnus-subscribe-alphabetically (newgroup) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
566 "Subscribe new NEWGROUP and insert it in alphabetical order." |
17493 | 567 (let ((groups (cdr gnus-newsrc-alist)) |
568 before) | |
569 (while (and (not before) groups) | |
570 (if (string< newgroup (caar groups)) | |
571 (setq before (caar groups)) | |
572 (setq groups (cdr groups)))) | |
573 (gnus-subscribe-newsgroup newgroup before))) | |
574 | |
575 (defun gnus-subscribe-hierarchically (newgroup) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
576 "Subscribe new NEWGROUP and insert it in hierarchical newsgroup order." |
17493 | 577 ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams) |
578 (save-excursion | |
579 (set-buffer (nnheader-find-file-noselect gnus-current-startup-file)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
580 (prog1 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
581 (let ((groupkey newgroup) before) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
582 (while (and (not before) groupkey) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
583 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
584 (let ((groupkey-re |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
585 (concat "^\\(" (regexp-quote groupkey) ".*\\)[!:]"))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
586 (while (and (re-search-forward groupkey-re nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
587 (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
588 (setq before (match-string 1)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
589 (string< before newgroup))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
590 ;; Remove tail of newsgroup name (eg. a.b.c -> a.b) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
591 (setq groupkey |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
592 (when (string-match "^\\(.*\\)\\.[^.]+$" groupkey) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
593 (substring groupkey (match-beginning 1) (match-end 1))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
594 (gnus-subscribe-newsgroup newgroup before)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
595 (kill-buffer (current-buffer))))) |
17493 | 596 |
597 (defun gnus-subscribe-interactively (group) | |
598 "Subscribe the new GROUP interactively. | |
599 It is inserted in hierarchical newsgroup order if subscribed. If not, | |
600 it is killed." | |
601 (if (gnus-y-or-n-p (format "Subscribe new newsgroup: %s " group)) | |
602 (gnus-subscribe-hierarchically group) | |
603 (push group gnus-killed-list))) | |
604 | |
605 (defun gnus-subscribe-zombies (group) | |
606 "Make the new GROUP into a zombie group." | |
607 (push group gnus-zombie-list)) | |
608 | |
609 (defun gnus-subscribe-killed (group) | |
610 "Make the new GROUP a killed group." | |
611 (push group gnus-killed-list)) | |
612 | |
613 (defun gnus-subscribe-newsgroup (newsgroup &optional next) | |
614 "Subscribe new NEWSGROUP. | |
615 If NEXT is non-nil, it is inserted before NEXT. Otherwise it is made | |
616 the first newsgroup." | |
617 (save-excursion | |
618 (goto-char (point-min)) | |
619 ;; We subscribe the group by changing its level to `subscribed'. | |
620 (gnus-group-change-level | |
621 newsgroup gnus-level-default-subscribed | |
622 gnus-level-killed (gnus-gethash (or next "dummy.group") | |
623 gnus-newsrc-hashtb)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
624 (gnus-message 5 "Subscribe newsgroup: %s" newsgroup) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
625 (run-hook-with-args 'gnus-subscribe-newsgroup-hooks newsgroup) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
626 t)) |
17493 | 627 |
628 (defun gnus-read-active-file-p () | |
629 "Say whether the active file has been read from `gnus-select-method'." | |
630 (memq gnus-select-method gnus-have-read-active-file)) | |
631 | |
632 ;;; General various misc type functions. | |
633 | |
634 ;; Silence byte-compiler. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
635 (eval-when-compile |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
636 (defvar gnus-current-headers) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
637 (defvar gnus-thread-indent-array) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
638 (defvar gnus-newsgroup-name) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
639 (defvar gnus-newsgroup-headers) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
640 (defvar gnus-group-list-mode) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
641 (defvar gnus-group-mark-positions) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
642 (defvar gnus-newsgroup-data) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
643 (defvar gnus-newsgroup-unreads) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
644 (defvar nnoo-state-alist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
645 (defvar gnus-current-select-method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
646 (defvar mail-sources) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
647 (defvar nnmail-scan-directory-mail-source-once) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
648 (defvar nnmail-split-history) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
649 (defvar nnmail-spool-file)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
650 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
651 (defun gnus-close-all-servers () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
652 "Close all servers." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
653 (interactive) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
654 (dolist (server gnus-opened-servers) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
655 (gnus-close-server (car server)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
656 |
17493 | 657 (defun gnus-clear-system () |
658 "Clear all variables and buffers." | |
659 ;; Clear Gnus variables. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
660 (let ((variables (remove 'gnus-format-specs gnus-variable-list))) |
17493 | 661 (while variables |
662 (set (car variables) nil) | |
663 (setq variables (cdr variables)))) | |
664 ;; Clear other internal variables. | |
665 (setq gnus-list-of-killed-groups nil | |
666 gnus-have-read-active-file nil | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
667 gnus-agent-covered-methods nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
668 gnus-server-method-cache nil |
17493 | 669 gnus-newsrc-alist nil |
670 gnus-newsrc-hashtb nil | |
671 gnus-killed-list nil | |
672 gnus-zombie-list nil | |
673 gnus-killed-hashtb nil | |
674 gnus-active-hashtb nil | |
675 gnus-moderated-hashtb nil | |
676 gnus-description-hashtb nil | |
677 gnus-current-headers nil | |
678 gnus-thread-indent-array nil | |
679 gnus-newsgroup-headers nil | |
680 gnus-newsgroup-name nil | |
681 gnus-server-alist nil | |
682 gnus-group-list-mode nil | |
683 gnus-opened-servers nil | |
684 gnus-group-mark-positions nil | |
685 gnus-newsgroup-data nil | |
686 gnus-newsgroup-unreads nil | |
687 nnoo-state-alist nil | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
688 gnus-current-select-method nil |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
689 nnmail-split-history nil |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
690 gnus-ephemeral-servers nil) |
17493 | 691 (gnus-shutdown 'gnus) |
692 ;; Kill the startup file. | |
693 (and gnus-current-startup-file | |
694 (get-file-buffer gnus-current-startup-file) | |
695 (kill-buffer (get-file-buffer gnus-current-startup-file))) | |
696 ;; Clear the dribble buffer. | |
697 (gnus-dribble-clear) | |
698 ;; Kill global KILL file buffer. | |
699 (when (get-file-buffer (gnus-newsgroup-kill-file nil)) | |
700 (kill-buffer (get-file-buffer (gnus-newsgroup-kill-file nil)))) | |
701 (gnus-kill-buffer nntp-server-buffer) | |
702 ;; Kill Gnus buffers. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
703 (dolist (buffer (gnus-buffers)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
704 (gnus-kill-buffer buffer)) |
17493 | 705 ;; Remove Gnus frames. |
706 (gnus-kill-gnus-frames)) | |
707 | |
708 (defun gnus-no-server-1 (&optional arg slave) | |
709 "Read network news. | |
710 If ARG is a positive number, Gnus will use that as the | |
711 startup level. If ARG is nil, Gnus will be started at level 2. | |
712 If ARG is non-nil and not a positive number, Gnus will | |
713 prompt the user for the name of an NNTP server to use. | |
714 As opposed to `gnus', this command will not connect to the local server." | |
715 (interactive "P") | |
716 (let ((val (or arg (1- gnus-level-default-subscribed)))) | |
717 (gnus val t slave) | |
718 (make-local-variable 'gnus-group-use-permanent-levels) | |
719 (setq gnus-group-use-permanent-levels val))) | |
720 | |
721 (defun gnus-1 (&optional arg dont-connect slave) | |
722 "Read network news. | |
723 If ARG is non-nil and a positive number, Gnus will use that as the | |
724 startup level. If ARG is non-nil and not a positive number, Gnus will | |
725 prompt the user for the name of an NNTP server to use." | |
726 (interactive "P") | |
727 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
728 (if (gnus-alive-p) |
17493 | 729 (progn |
730 (switch-to-buffer gnus-group-buffer) | |
731 (gnus-group-get-new-news | |
732 (and (numberp arg) | |
733 (> arg 0) | |
734 (max (car gnus-group-list-mode) arg)))) | |
735 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
736 (gnus-clear-system) |
17493 | 737 (gnus-splash) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
738 (gnus-run-hooks 'gnus-before-startup-hook) |
17493 | 739 (nnheader-init-server-buffer) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
740 (setq gnus-slave slave) |
17493 | 741 (gnus-read-init-file) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
742 (if gnus-agent |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
743 (gnus-agentize)) |
17493 | 744 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
745 (when gnus-simple-splash |
17493 | 746 (setq gnus-simple-splash nil) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
747 (cond |
32939
c8119677d63e
Use (featurep 'xemacs) instead of the `gnus-xemacs' variable, as the
Miles Bader <miles@gnu.org>
parents:
31783
diff
changeset
|
748 ((featurep 'xemacs) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
749 (gnus-xmas-splash)) |
31783
65104da03c90
(gnus-1) <gnus-simple-splash>: Don't test for X
Dave Love <fx@gnu.org>
parents:
31716
diff
changeset
|
750 ((and window-system |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
751 (= (frame-height) (1+ (window-height)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
752 (gnus-x-splash)))) |
17493 | 753 |
754 (let ((level (and (numberp arg) (> arg 0) arg)) | |
755 did-connect) | |
756 (unwind-protect | |
757 (progn | |
758 (unless dont-connect | |
759 (setq did-connect | |
760 (gnus-start-news-server (and arg (not level)))))) | |
761 (if (and (not dont-connect) | |
762 (not did-connect)) | |
763 (gnus-group-quit) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
764 (gnus-run-hooks 'gnus-startup-hook) |
17493 | 765 ;; NNTP server is successfully open. |
766 | |
767 ;; Find the current startup file name. | |
768 (setq gnus-current-startup-file | |
769 (gnus-make-newsrc-file gnus-startup-file)) | |
770 | |
771 ;; Read the dribble file. | |
772 (when (or gnus-slave gnus-use-dribble-file) | |
773 (gnus-dribble-read-file)) | |
774 | |
775 ;; Allow using GroupLens predictions. | |
776 (when gnus-use-grouplens | |
777 (bbb-login) | |
778 (add-hook 'gnus-summary-mode-hook 'gnus-grouplens-mode)) | |
779 | |
780 ;; Do the actual startup. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
781 (if gnus-agent |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
782 (gnus-request-create-group "queue" '(nndraft ""))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
783 (gnus-request-create-group "drafts" '(nndraft "")) |
17493 | 784 (gnus-setup-news nil level dont-connect) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
785 (gnus-run-hooks 'gnus-setup-news-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
786 (gnus-start-draft-setup) |
17493 | 787 ;; Generate the group buffer. |
788 (gnus-group-list-groups level) | |
789 (gnus-group-first-unread-group) | |
790 (gnus-configure-windows 'group) | |
791 (gnus-group-set-mode-line) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
792 (gnus-run-hooks 'gnus-started-hook)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
793 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
794 (defun gnus-start-draft-setup () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
795 "Make sure the draft group exists." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
796 (gnus-request-create-group "drafts" '(nndraft "")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
797 (unless (gnus-gethash "nndraft:drafts" gnus-newsrc-hashtb) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
798 (let ((gnus-level-default-subscribed 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
799 (gnus-subscribe-group "nndraft:drafts" nil '(nndraft ""))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
800 (gnus-group-set-parameter |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
801 "nndraft:drafts" 'gnus-dummy '((gnus-draft-mode))))) |
17493 | 802 |
803 | |
804 ;;; | |
805 ;;; Dribble file | |
806 ;;; | |
807 | |
808 (defvar gnus-dribble-ignore nil) | |
809 (defvar gnus-dribble-eval-file nil) | |
810 | |
811 (defun gnus-dribble-file-name () | |
812 "Return the dribble file for the current .newsrc." | |
813 (concat | |
814 (if gnus-dribble-directory | |
815 (concat (file-name-as-directory gnus-dribble-directory) | |
816 (file-name-nondirectory gnus-current-startup-file)) | |
817 gnus-current-startup-file) | |
818 "-dribble")) | |
819 | |
820 (defun gnus-dribble-enter (string) | |
821 "Enter STRING into the dribble buffer." | |
822 (when (and (not gnus-dribble-ignore) | |
823 gnus-dribble-buffer | |
824 (buffer-name gnus-dribble-buffer)) | |
825 (let ((obuf (current-buffer))) | |
826 (set-buffer gnus-dribble-buffer) | |
827 (goto-char (point-max)) | |
828 (insert string "\n") | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
829 ;; This has been commented by Josh Huber <huber@alum.wpi.edu> |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
830 ;; It causes problems with both XEmacs and Emacs 21, and doesn't |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
831 ;; seem to be of much value. (FIXME: remove this after we make sure |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
832 ;; it's not needed). |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
833 ;; (set-window-point (get-buffer-window (current-buffer)) (point-max)) |
17493 | 834 (bury-buffer gnus-dribble-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
835 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
836 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
837 (gnus-group-set-mode-line)) |
17493 | 838 (set-buffer obuf)))) |
839 | |
840 (defun gnus-dribble-touch () | |
841 "Touch the dribble buffer." | |
842 (gnus-dribble-enter "")) | |
843 | |
844 (defun gnus-dribble-read-file () | |
845 "Read the dribble file from disk." | |
846 (let ((dribble-file (gnus-dribble-file-name))) | |
847 (save-excursion | |
848 (set-buffer (setq gnus-dribble-buffer | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
849 (gnus-get-buffer-create |
17493 | 850 (file-name-nondirectory dribble-file)))) |
851 (erase-buffer) | |
852 (setq buffer-file-name dribble-file) | |
853 (auto-save-mode t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
854 (buffer-disable-undo) |
17493 | 855 (bury-buffer (current-buffer)) |
856 (set-buffer-modified-p nil) | |
857 (let ((auto (make-auto-save-file-name)) | |
858 (gnus-dribble-ignore t) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
859 (purpose nil) |
17493 | 860 modes) |
861 (when (or (file-exists-p auto) (file-exists-p dribble-file)) | |
862 ;; Load whichever file is newest -- the auto save file | |
863 ;; or the "real" file. | |
864 (if (file-newer-than-file-p auto dribble-file) | |
865 (nnheader-insert-file-contents auto) | |
866 (nnheader-insert-file-contents dribble-file)) | |
867 (unless (zerop (buffer-size)) | |
868 (set-buffer-modified-p t)) | |
869 ;; Set the file modes to reflect the .newsrc file modes. | |
870 (save-buffer) | |
871 (when (and (file-exists-p gnus-current-startup-file) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
872 (file-exists-p dribble-file) |
17493 | 873 (setq modes (file-modes gnus-current-startup-file))) |
874 (set-file-modes dribble-file modes)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
875 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
876 (when (search-forward "Gnus was exited on purpose" nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
877 (setq purpose t)) |
17493 | 878 ;; Possibly eval the file later. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
879 (when (or gnus-always-read-dribble-file |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
880 (gnus-y-or-n-p |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
881 (if purpose |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
882 "Gnus exited on purpose without saving; read auto-save file anyway? " |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
883 "Gnus auto-save file exists. Do you want to read it? "))) |
17493 | 884 (setq gnus-dribble-eval-file t))))))) |
885 | |
886 (defun gnus-dribble-eval-file () | |
887 (when gnus-dribble-eval-file | |
888 (setq gnus-dribble-eval-file nil) | |
889 (save-excursion | |
890 (let ((gnus-dribble-ignore t)) | |
891 (set-buffer gnus-dribble-buffer) | |
892 (eval-buffer (current-buffer)))))) | |
893 | |
894 (defun gnus-dribble-delete-file () | |
895 (when (file-exists-p (gnus-dribble-file-name)) | |
896 (delete-file (gnus-dribble-file-name))) | |
897 (when gnus-dribble-buffer | |
898 (save-excursion | |
899 (set-buffer gnus-dribble-buffer) | |
900 (let ((auto (make-auto-save-file-name))) | |
901 (when (file-exists-p auto) | |
902 (delete-file auto)) | |
903 (erase-buffer) | |
904 (set-buffer-modified-p nil))))) | |
905 | |
906 (defun gnus-dribble-save () | |
907 (when (and gnus-dribble-buffer | |
908 (buffer-name gnus-dribble-buffer)) | |
909 (save-excursion | |
910 (set-buffer gnus-dribble-buffer) | |
911 (save-buffer)))) | |
912 | |
913 (defun gnus-dribble-clear () | |
914 (when (gnus-buffer-exists-p gnus-dribble-buffer) | |
915 (save-excursion | |
916 (set-buffer gnus-dribble-buffer) | |
917 (erase-buffer) | |
918 (set-buffer-modified-p nil) | |
919 (setq buffer-saved-size (buffer-size))))) | |
920 | |
921 | |
922 ;;; | |
923 ;;; Active & Newsrc File Handling | |
924 ;;; | |
925 | |
926 (defun gnus-setup-news (&optional rawfile level dont-connect) | |
927 "Setup news information. | |
928 If RAWFILE is non-nil, the .newsrc file will also be read. | |
929 If LEVEL is non-nil, the news will be set up at level LEVEL." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
930 (require 'nnmail) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
931 (let ((init (not (and gnus-newsrc-alist gnus-active-hashtb (not rawfile)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
932 ;; Binding this variable will inhibit multiple fetchings |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
933 ;; of the same mail source. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
934 (nnmail-fetched-sources (list t))) |
17493 | 935 |
936 (when init | |
937 ;; Clear some variables to re-initialize news information. | |
938 (setq gnus-newsrc-alist nil | |
939 gnus-active-hashtb nil) | |
940 ;; Read the newsrc file and create `gnus-newsrc-hashtb'. | |
941 (gnus-read-newsrc-file rawfile)) | |
942 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
943 ;; Make sure the archive server is available to all and sundry. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
944 (when gnus-message-archive-method |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
945 (unless (assoc "archive" gnus-server-alist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
946 (push `("archive" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
947 nnfolder |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
948 "archive" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
949 (nnfolder-directory |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
950 ,(nnheader-concat message-directory "archive")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
951 (nnfolder-active-file |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
952 ,(nnheader-concat message-directory "archive/active")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
953 (nnfolder-get-new-mail nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
954 (nnfolder-inhibit-expiry t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
955 gnus-server-alist))) |
17493 | 956 |
957 ;; If we don't read the complete active file, we fill in the | |
958 ;; hashtb here. | |
959 (when (or (null gnus-read-active-file) | |
960 (eq gnus-read-active-file 'some)) | |
961 (gnus-update-active-hashtb-from-killed)) | |
962 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
963 ;; Validate agent covered methods now that gnus-server-alist has |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
964 ;; been initialized. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
965 ;; NOTE: This is here for one purpose only. By validating the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
966 ;; agentized server's, it converts the old 5.10.3, and earlier, |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
967 ;; format to the current format. That enables the agent code |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
968 ;; within gnus-read-active-file to function correctly. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
969 (if gnus-agent |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
970 (gnus-agent-read-servers-validate)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
971 |
17493 | 972 ;; Read the active file and create `gnus-active-hashtb'. |
973 ;; If `gnus-read-active-file' is nil, then we just create an empty | |
974 ;; hash table. The partial filling out of the hash table will be | |
975 ;; done in `gnus-get-unread-articles'. | |
976 (and gnus-read-active-file | |
977 (not level) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
978 (gnus-read-active-file nil dont-connect)) |
17493 | 979 |
980 (unless gnus-active-hashtb | |
981 (setq gnus-active-hashtb (gnus-make-hashtable 4096))) | |
982 | |
983 ;; Initialize the cache. | |
984 (when gnus-use-cache | |
985 (gnus-cache-open)) | |
986 | |
987 ;; Possibly eval the dribble file. | |
988 (and init | |
989 (or gnus-use-dribble-file gnus-slave) | |
990 (gnus-dribble-eval-file)) | |
991 | |
992 ;; Slave Gnusii should then clear the dribble buffer. | |
993 (when (and init gnus-slave) | |
994 (gnus-dribble-clear)) | |
995 | |
996 (gnus-update-format-specifications) | |
997 | |
998 ;; See whether we need to read the description file. | |
999 (when (and (boundp 'gnus-group-line-format) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1000 (stringp gnus-group-line-format) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1001 (let ((case-fold-search nil)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1002 (string-match "%[-,0-9]*D" gnus-group-line-format)) |
17493 | 1003 (not gnus-description-hashtb) |
1004 (not dont-connect) | |
1005 gnus-read-active-file) | |
1006 (gnus-read-all-descriptions-files)) | |
1007 | |
1008 ;; Find new newsgroups and treat them. | |
1009 (when (and init gnus-check-new-newsgroups (not level) | |
1010 (gnus-check-server gnus-select-method) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1011 (not gnus-slave) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1012 gnus-plugged) |
17493 | 1013 (gnus-find-new-newsgroups)) |
1014 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1015 ;; Check and remove bogus newsgroups. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1016 (when (and init gnus-check-bogus-newsgroups |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1017 gnus-read-active-file (not level) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1018 (gnus-server-opened gnus-select-method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1019 (gnus-check-bogus-newsgroups)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1020 |
17493 | 1021 ;; We might read in new NoCeM messages here. |
1022 (when (and gnus-use-nocem | |
1023 (not level) | |
1024 (not dont-connect)) | |
1025 (gnus-nocem-scan-groups)) | |
1026 | |
1027 ;; Read any slave files. | |
1028 (gnus-master-read-slave-newsrc) | |
1029 | |
1030 ;; Find the number of unread articles in each non-dead group. | |
1031 (let ((gnus-read-active-file (and (not level) gnus-read-active-file))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1032 (gnus-get-unread-articles level)))) |
17493 | 1033 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1034 (defun gnus-call-subscribe-functions (method group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1035 "Call METHOD to subscribe GROUP. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1036 If no function returns `non-nil', call `gnus-subscribe-zombies'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1037 (unless (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1038 ((functionp method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1039 (funcall method group)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1040 ((listp method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1041 (catch 'found |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1042 (dolist (func method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1043 (if (funcall func group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1044 (throw 'found t))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1045 nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1046 (t nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1047 (gnus-subscribe-zombies group))) |
17493 | 1048 |
1049 (defun gnus-find-new-newsgroups (&optional arg) | |
1050 "Search for new newsgroups and add them. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1051 Each new newsgroup will be treated with `gnus-subscribe-newsgroup-method'. |
17493 | 1052 The `-n' option line from .newsrc is respected. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1053 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1054 With 1 C-u, use the `ask-server' method to query the server for new |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1055 groups. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1056 With 2 C-u's, use most complete method possible to query the server |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1057 for new groups, and subscribe the new groups as zombies." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1058 (interactive "p") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1059 (let* ((gnus-subscribe-newsgroup-method |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1060 gnus-subscribe-newsgroup-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1061 (check (cond |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1062 ((or (and (= (or arg 1) 4) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1063 (not (listp gnus-check-new-newsgroups))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1064 (null gnus-read-active-file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1065 (eq gnus-read-active-file 'some)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1066 'ask-server) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1067 ((= (or arg 1) 16) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1068 (setq gnus-subscribe-newsgroup-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1069 'gnus-subscribe-zombies) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1070 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1071 (t gnus-check-new-newsgroups)))) |
17493 | 1072 (unless (gnus-check-first-time-used) |
1073 (if (or (consp check) | |
1074 (eq check 'ask-server)) | |
1075 ;; Ask the server for new groups. | |
1076 (gnus-ask-server-for-new-groups) | |
1077 ;; Go through the active hashtb and look for new groups. | |
1078 (let ((groups 0) | |
1079 group new-newsgroups) | |
1080 (gnus-message 5 "Looking for new newsgroups...") | |
1081 (unless gnus-have-read-active-file | |
1082 (gnus-read-active-file)) | |
38526
98b3bb015deb
(gnus-find-new-newsgroups): Use
Gerd Moellmann <gerd@gnu.org>
parents:
33396
diff
changeset
|
1083 (setq gnus-newsrc-last-checked-date (message-make-date)) |
17493 | 1084 (unless gnus-killed-hashtb |
1085 (gnus-make-hashtable-from-killed)) | |
1086 ;; Go though every newsgroup in `gnus-active-hashtb' and compare | |
1087 ;; with `gnus-newsrc-hashtb' and `gnus-killed-hashtb'. | |
1088 (mapatoms | |
1089 (lambda (sym) | |
1090 (if (or (null (setq group (symbol-name sym))) | |
1091 (not (boundp sym)) | |
1092 (null (symbol-value sym)) | |
1093 (gnus-gethash group gnus-killed-hashtb) | |
1094 (gnus-gethash group gnus-newsrc-hashtb)) | |
1095 () | |
1096 (let ((do-sub (gnus-matches-options-n group))) | |
1097 (cond | |
1098 ((eq do-sub 'subscribe) | |
1099 (setq groups (1+ groups)) | |
1100 (gnus-sethash group group gnus-killed-hashtb) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1101 (gnus-call-subscribe-functions |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1102 gnus-subscribe-options-newsgroup-method group)) |
17493 | 1103 ((eq do-sub 'ignore) |
1104 nil) | |
1105 (t | |
1106 (setq groups (1+ groups)) | |
1107 (gnus-sethash group group gnus-killed-hashtb) | |
1108 (if gnus-subscribe-hierarchical-interactive | |
1109 (push group new-newsgroups) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1110 (gnus-call-subscribe-functions |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1111 gnus-subscribe-newsgroup-method group))))))) |
17493 | 1112 gnus-active-hashtb) |
1113 (when new-newsgroups | |
1114 (gnus-subscribe-hierarchical-interactive new-newsgroups)) | |
1115 (if (> groups 0) | |
1116 (gnus-message 5 "%d new newsgroup%s arrived." | |
1117 groups (if (> groups 1) "s have" " has")) | |
1118 (gnus-message 5 "No new newsgroups."))))))) | |
1119 | |
1120 (defun gnus-matches-options-n (group) | |
1121 ;; Returns `subscribe' if the group is to be unconditionally | |
1122 ;; subscribed, `ignore' if it is to be ignored, and nil if there is | |
1123 ;; no match for the group. | |
1124 | |
1125 ;; First we check the two user variables. | |
1126 (cond | |
1127 ((and gnus-options-subscribe | |
1128 (string-match gnus-options-subscribe group)) | |
1129 'subscribe) | |
1130 ((and gnus-auto-subscribed-groups | |
1131 (string-match gnus-auto-subscribed-groups group)) | |
1132 'subscribe) | |
1133 ((and gnus-options-not-subscribe | |
1134 (string-match gnus-options-not-subscribe group)) | |
1135 'ignore) | |
1136 ;; Then we go through the list that was retrieved from the .newsrc | |
1137 ;; file. This list has elements on the form | |
1138 ;; `(REGEXP . {ignore,subscribe})'. The first match found (the list | |
1139 ;; is in the reverse order of the options line) is returned. | |
1140 (t | |
1141 (let ((regs gnus-newsrc-options-n)) | |
1142 (while (and regs | |
1143 (not (string-match (caar regs) group))) | |
1144 (setq regs (cdr regs))) | |
1145 (and regs (cdar regs)))))) | |
1146 | |
1147 (defun gnus-ask-server-for-new-groups () | |
38526
98b3bb015deb
(gnus-find-new-newsgroups): Use
Gerd Moellmann <gerd@gnu.org>
parents:
33396
diff
changeset
|
1148 (let* ((new-date (message-make-date)) |
98b3bb015deb
(gnus-find-new-newsgroups): Use
Gerd Moellmann <gerd@gnu.org>
parents:
33396
diff
changeset
|
1149 (date (or gnus-newsrc-last-checked-date new-date)) |
17493 | 1150 (methods (cons gnus-select-method |
1151 (nconc | |
1152 (when (gnus-archive-server-wanted-p) | |
1153 (list "archive")) | |
1154 (append | |
1155 (and (consp gnus-check-new-newsgroups) | |
1156 gnus-check-new-newsgroups) | |
1157 gnus-secondary-select-methods)))) | |
1158 (groups 0) | |
1159 group new-newsgroups got-new method hashtb | |
1160 gnus-override-subscribe-method) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1161 (unless gnus-killed-hashtb |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1162 (gnus-make-hashtable-from-killed)) |
17493 | 1163 ;; Go through both primary and secondary select methods and |
1164 ;; request new newsgroups. | |
1165 (while (setq method (gnus-server-get-method nil (pop methods))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1166 (setq new-newsgroups nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1167 gnus-override-subscribe-method method) |
17493 | 1168 (when (and (gnus-check-server method) |
1169 (gnus-request-newgroups date method)) | |
1170 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1171 (setq got-new t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1172 hashtb (gnus-make-hashtable 100)) |
17493 | 1173 (set-buffer nntp-server-buffer) |
1174 ;; Enter all the new groups into a hashtable. | |
1175 (gnus-active-to-gnus-format method hashtb 'ignore)) | |
1176 ;; Now all new groups from `method' are in `hashtb'. | |
1177 (mapatoms | |
1178 (lambda (group-sym) | |
1179 (if (or (null (setq group (symbol-name group-sym))) | |
1180 (not (boundp group-sym)) | |
1181 (null (symbol-value group-sym)) | |
1182 (gnus-gethash group gnus-newsrc-hashtb) | |
1183 (member group gnus-zombie-list) | |
1184 (member group gnus-killed-list)) | |
1185 ;; The group is already known. | |
1186 () | |
1187 ;; Make this group active. | |
1188 (when (symbol-value group-sym) | |
1189 (gnus-set-active group (symbol-value group-sym))) | |
1190 ;; Check whether we want it or not. | |
1191 (let ((do-sub (gnus-matches-options-n group))) | |
1192 (cond | |
1193 ((eq do-sub 'subscribe) | |
1194 (incf groups) | |
1195 (gnus-sethash group group gnus-killed-hashtb) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1196 (gnus-call-subscribe-functions |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1197 gnus-subscribe-options-newsgroup-method group)) |
17493 | 1198 ((eq do-sub 'ignore) |
1199 nil) | |
1200 (t | |
1201 (incf groups) | |
1202 (gnus-sethash group group gnus-killed-hashtb) | |
1203 (if gnus-subscribe-hierarchical-interactive | |
1204 (push group new-newsgroups) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1205 (gnus-call-subscribe-functions |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1206 gnus-subscribe-newsgroup-method group))))))) |
17493 | 1207 hashtb)) |
1208 (when new-newsgroups | |
1209 (gnus-subscribe-hierarchical-interactive new-newsgroups))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1210 (if (> groups 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1211 (gnus-message 5 "%d new newsgroup%s arrived" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1212 groups (if (> groups 1) "s have" " has")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1213 (gnus-message 5 "No new newsgroups")) |
17493 | 1214 (when got-new |
1215 (setq gnus-newsrc-last-checked-date new-date)) | |
1216 got-new)) | |
1217 | |
1218 (defun gnus-check-first-time-used () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1219 (catch 'ended |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1220 ;; First check if any of the following files exist. If they do, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1221 ;; it's not the first time the user has used Gnus. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1222 (dolist (file (list (concat gnus-current-startup-file ".el") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1223 (concat gnus-current-startup-file ".eld") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1224 (concat gnus-startup-file ".el") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1225 (concat gnus-startup-file ".eld"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1226 (when (file-exists-p file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1227 (throw 'ended nil))) |
17493 | 1228 (gnus-message 6 "First time user; subscribing you to default groups") |
1229 (unless (gnus-read-active-file-p) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1230 (let ((gnus-read-active-file t)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1231 (gnus-read-active-file))) |
38526
98b3bb015deb
(gnus-find-new-newsgroups): Use
Gerd Moellmann <gerd@gnu.org>
parents:
33396
diff
changeset
|
1232 (setq gnus-newsrc-last-checked-date (message-make-date)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1233 ;; Subscribe to the default newsgroups. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1234 (let ((groups (or gnus-default-subscribed-newsgroups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1235 gnus-backup-default-subscribed-newsgroups)) |
17493 | 1236 group) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1237 (if (eq groups t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1238 ;; If t, we subscribe (or not) all groups as if they were new. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1239 (mapatoms |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1240 (lambda (sym) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1241 (when (setq group (symbol-name sym)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1242 (let ((do-sub (gnus-matches-options-n group))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1243 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1244 ((eq do-sub 'subscribe) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1245 (gnus-sethash group group gnus-killed-hashtb) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1246 (gnus-call-subscribe-functions |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1247 gnus-subscribe-options-newsgroup-method group)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1248 ((eq do-sub 'ignore) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1249 nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1250 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1251 (push group gnus-killed-list)))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1252 gnus-active-hashtb) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1253 (dolist (group groups) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1254 ;; Only subscribe the default groups that are activated. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1255 (when (gnus-active group) |
17493 | 1256 (gnus-group-change-level |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1257 group gnus-level-default-subscribed gnus-level-killed))) |
23103 | 1258 (save-excursion |
1259 (set-buffer gnus-group-buffer) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1260 ;; Don't error if the group already exists. This happens when a |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1261 ;; first-time user types 'F'. -- didier |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1262 (gnus-group-make-help-group t)) |
17493 | 1263 (when gnus-novice-user |
1264 (gnus-message 7 "`A k' to list killed groups")))))) | |
1265 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1266 (defun gnus-subscribe-group (group &optional previous method) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1267 "Subscribe GROUP and put it after PREVIOUS." |
17493 | 1268 (gnus-group-change-level |
1269 (if method | |
1270 (list t group gnus-level-default-subscribed nil nil method) | |
1271 group) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1272 gnus-level-default-subscribed gnus-level-killed previous t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1273 t) |
17493 | 1274 |
1275 ;; `gnus-group-change-level' is the fundamental function for changing | |
1276 ;; subscription levels of newsgroups. This might mean just changing | |
1277 ;; from level 1 to 2, which is pretty trivial, from 2 to 6 or back | |
1278 ;; again, which subscribes/unsubscribes a group, which is equally | |
1279 ;; trivial. Changing from 1-7 to 8-9 means that you kill a group, and | |
1280 ;; from 8-9 to 1-7 means that you remove the group from the list of | |
1281 ;; killed (or zombie) groups and add them to the (kinda) subscribed | |
1282 ;; groups. And last but not least, moving from 8 to 9 and 9 to 8, | |
1283 ;; which is trivial. | |
1284 ;; ENTRY can either be a string (newsgroup name) or a list (if | |
1285 ;; FROMKILLED is t, it's a list on the format (NUM INFO-LIST), | |
1286 ;; otherwise it's a list in the format of the `gnus-newsrc-hashtb' | |
1287 ;; entries. | |
1288 ;; LEVEL is the new level of the group, OLDLEVEL is the old level and | |
1289 ;; PREVIOUS is the group (in hashtb entry format) to insert this group | |
1290 ;; after. | |
1291 (defun gnus-group-change-level (entry level &optional oldlevel | |
1292 previous fromkilled) | |
1293 (let (group info active num) | |
1294 ;; Glean what info we can from the arguments | |
1295 (if (consp entry) | |
1296 (if fromkilled (setq group (nth 1 entry)) | |
1297 (setq group (car (nth 2 entry)))) | |
1298 (setq group entry)) | |
1299 (when (and (stringp entry) | |
1300 oldlevel | |
1301 (< oldlevel gnus-level-zombie)) | |
1302 (setq entry (gnus-gethash entry gnus-newsrc-hashtb))) | |
1303 (if (and (not oldlevel) | |
1304 (consp entry)) | |
1305 (setq oldlevel (gnus-info-level (nth 2 entry))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1306 (setq oldlevel (or oldlevel gnus-level-killed))) |
17493 | 1307 (when (stringp previous) |
1308 (setq previous (gnus-gethash previous gnus-newsrc-hashtb))) | |
1309 | |
1310 (if (and (>= oldlevel gnus-level-zombie) | |
1311 (gnus-gethash group gnus-newsrc-hashtb)) | |
1312 ;; We are trying to subscribe a group that is already | |
1313 ;; subscribed. | |
1314 () ; Do nothing. | |
1315 | |
1316 (unless (gnus-ephemeral-group-p group) | |
1317 (gnus-dribble-enter | |
1318 (format "(gnus-group-change-level %S %S %S %S %S)" | |
1319 group level oldlevel (car (nth 2 previous)) fromkilled))) | |
1320 | |
1321 ;; Then we remove the newgroup from any old structures, if needed. | |
1322 ;; If the group was killed, we remove it from the killed or zombie | |
1323 ;; list. If not, and it is in fact going to be killed, we remove | |
1324 ;; it from the newsrc hash table and assoc. | |
1325 (cond | |
1326 ((>= oldlevel gnus-level-zombie) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1327 ;; oldlevel could be wrong. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1328 (setq gnus-zombie-list (delete group gnus-zombie-list)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1329 (setq gnus-killed-list (delete group gnus-killed-list))) |
17493 | 1330 (t |
1331 (when (and (>= level gnus-level-zombie) | |
1332 entry) | |
1333 (gnus-sethash (car (nth 2 entry)) nil gnus-newsrc-hashtb) | |
1334 (when (nth 3 entry) | |
1335 (setcdr (gnus-gethash (car (nth 3 entry)) | |
1336 gnus-newsrc-hashtb) | |
1337 (cdr entry))) | |
1338 (setcdr (cdr entry) (cdddr entry))))) | |
1339 | |
1340 ;; Finally we enter (if needed) the list where it is supposed to | |
1341 ;; go, and change the subscription level. If it is to be killed, | |
1342 ;; we enter it into the killed or zombie list. | |
1343 (cond | |
1344 ((>= level gnus-level-zombie) | |
1345 ;; Remove from the hash table. | |
1346 (gnus-sethash group nil gnus-newsrc-hashtb) | |
1347 ;; We do not enter foreign groups into the list of dead | |
1348 ;; groups. | |
1349 (unless (gnus-group-foreign-p group) | |
1350 (if (= level gnus-level-zombie) | |
1351 (push group gnus-zombie-list) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1352 (if (= oldlevel gnus-level-killed) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1353 ;; Remove from active hashtb. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1354 (unintern group gnus-active-hashtb) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1355 ;; Don't add it into killed-list if it was killed. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1356 (push group gnus-killed-list))))) |
17493 | 1357 (t |
1358 ;; If the list is to be entered into the newsrc assoc, and | |
1359 ;; it was killed, we have to create an entry in the newsrc | |
1360 ;; hashtb format and fix the pointers in the newsrc assoc. | |
1361 (if (< oldlevel gnus-level-zombie) | |
1362 ;; It was alive, and it is going to stay alive, so we | |
1363 ;; just change the level and don't change any pointers or | |
1364 ;; hash table entries. | |
1365 (setcar (cdaddr entry) level) | |
1366 (if (listp entry) | |
1367 (setq info (cdr entry) | |
1368 num (car entry)) | |
1369 (setq active (gnus-active group)) | |
1370 (setq num | |
1371 (if active (- (1+ (cdr active)) (car active)) t)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1372 ;; Shorten the select method if possible, if we need to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1373 ;; store it at all (native groups). |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1374 (let ((method (gnus-method-simplify |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1375 (or gnus-override-subscribe-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1376 (gnus-group-method group))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1377 (if method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1378 (setq info (list group level nil nil method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1379 (setq info (list group level nil))))) |
17493 | 1380 (unless previous |
1381 (setq previous | |
1382 (let ((p gnus-newsrc-alist)) | |
1383 (while (cddr p) | |
1384 (setq p (cdr p))) | |
1385 p))) | |
1386 (setq entry (cons info (cddr previous))) | |
1387 (if (cdr previous) | |
1388 (progn | |
1389 (setcdr (cdr previous) entry) | |
1390 (gnus-sethash group (cons num (cdr previous)) | |
1391 gnus-newsrc-hashtb)) | |
1392 (setcdr previous entry) | |
1393 (gnus-sethash group (cons num previous) | |
1394 gnus-newsrc-hashtb)) | |
1395 (when (cdr entry) | |
1396 (setcdr (gnus-gethash (caadr entry) gnus-newsrc-hashtb) entry)) | |
1397 (gnus-dribble-enter | |
1398 (format | |
1399 "(gnus-group-set-info '%S)" info))))) | |
1400 (when gnus-group-change-level-function | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1401 (funcall gnus-group-change-level-function |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1402 group level oldlevel previous))))) |
17493 | 1403 |
1404 (defun gnus-kill-newsgroup (newsgroup) | |
1405 "Obsolete function. Kills a newsgroup." | |
1406 (gnus-group-change-level | |
1407 (gnus-gethash newsgroup gnus-newsrc-hashtb) gnus-level-killed)) | |
1408 | |
1409 (defun gnus-check-bogus-newsgroups (&optional confirm) | |
1410 "Remove bogus newsgroups. | |
1411 If CONFIRM is non-nil, the user has to confirm the deletion of every | |
1412 newsgroup." | |
1413 (let ((newsrc (cdr gnus-newsrc-alist)) | |
1414 bogus group entry info) | |
1415 (gnus-message 5 "Checking bogus newsgroups...") | |
1416 (unless (gnus-read-active-file-p) | |
1417 (gnus-read-active-file t)) | |
1418 (when (gnus-read-active-file-p) | |
1419 ;; Find all bogus newsgroup that are subscribed. | |
1420 (while newsrc | |
1421 (setq info (pop newsrc) | |
1422 group (gnus-info-group info)) | |
1423 (unless (or (gnus-active group) ; Active | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1424 (and (gnus-info-method info) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1425 (not (gnus-secondary-method-p |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1426 (gnus-info-method info))))) ; Foreign |
17493 | 1427 ;; Found a bogus newsgroup. |
1428 (push group bogus))) | |
1429 (if confirm | |
1430 (map-y-or-n-p | |
1431 "Remove bogus group %s? " | |
1432 (lambda (group) | |
1433 ;; Remove all bogus subscribed groups by first killing them, and | |
1434 ;; then removing them from the list of killed groups. | |
1435 (when (setq entry (gnus-gethash group gnus-newsrc-hashtb)) | |
1436 (gnus-group-change-level entry gnus-level-killed) | |
1437 (setq gnus-killed-list (delete group gnus-killed-list)))) | |
1438 bogus '("group" "groups" "remove")) | |
1439 (while (setq group (pop bogus)) | |
1440 ;; Remove all bogus subscribed groups by first killing them, and | |
1441 ;; then removing them from the list of killed groups. | |
1442 (when (setq entry (gnus-gethash group gnus-newsrc-hashtb)) | |
1443 (gnus-group-change-level entry gnus-level-killed) | |
1444 (setq gnus-killed-list (delete group gnus-killed-list))))) | |
1445 ;; Then we remove all bogus groups from the list of killed and | |
1446 ;; zombie groups. They are removed without confirmation. | |
1447 (let ((dead-lists '(gnus-killed-list gnus-zombie-list)) | |
1448 killed) | |
1449 (while dead-lists | |
1450 (setq killed (symbol-value (car dead-lists))) | |
1451 (while killed | |
1452 (unless (gnus-active (setq group (pop killed))) | |
1453 ;; The group is bogus. | |
1454 ;; !!!Slow as hell. | |
1455 (set (car dead-lists) | |
1456 (delete group (symbol-value (car dead-lists)))))) | |
1457 (setq dead-lists (cdr dead-lists)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1458 (gnus-run-hooks 'gnus-check-bogus-groups-hook) |
17493 | 1459 (gnus-message 5 "Checking bogus newsgroups...done")))) |
1460 | |
1461 (defun gnus-check-duplicate-killed-groups () | |
1462 "Remove duplicates from the list of killed groups." | |
1463 (interactive) | |
1464 (let ((killed gnus-killed-list)) | |
1465 (while killed | |
1466 (gnus-message 9 "%d" (length killed)) | |
1467 (setcdr killed (delete (car killed) (cdr killed))) | |
1468 (setq killed (cdr killed))))) | |
1469 | |
1470 ;; We want to inline a function from gnus-cache, so we cheat here: | |
1471 (eval-when-compile | |
1472 (defvar gnus-cache-active-hashtb) | |
1473 (defun gnus-cache-possibly-alter-active (group active) | |
1474 "Alter the ACTIVE info for GROUP to reflect the articles in the cache." | |
1475 (when gnus-cache-active-hashtb | |
1476 (let ((cache-active (gnus-gethash group gnus-cache-active-hashtb))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1477 (when cache-active |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1478 (when (< (car cache-active) (car active)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1479 (setcar active (car cache-active))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1480 (when (> (cdr cache-active) (cdr active)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1481 (setcdr active (cdr cache-active)))))))) |
17493 | 1482 |
1483 (defun gnus-activate-group (group &optional scan dont-check method) | |
1484 ;; Check whether a group has been activated or not. | |
1485 ;; If SCAN, request a scan of that group as well. | |
1486 (let ((method (or method (inline (gnus-find-method-for-group group)))) | |
1487 active) | |
1488 (and (inline (gnus-check-server method)) | |
1489 ;; We escape all bugs and quit here to make it possible to | |
1490 ;; continue if a group is so out-there that it reports bugs | |
1491 ;; and stuff. | |
1492 (progn | |
1493 (and scan | |
1494 (gnus-check-backend-function 'request-scan (car method)) | |
1495 (gnus-request-scan group method)) | |
1496 t) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1497 (if (or debug-on-error debug-on-quit) |
17493 | 1498 (inline (gnus-request-group group dont-check method)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1499 (condition-case nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1500 (inline (gnus-request-group group dont-check method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1501 ;;(error nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1502 (quit |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1503 (message "Quit activating %s" group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1504 nil))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1505 (unless dont-check |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1506 (setq active (gnus-parse-active)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1507 ;; If there are no articles in the group, the GROUP |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1508 ;; command may have responded with the `(0 . 0)'. We |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1509 ;; ignore this if we already have an active entry |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1510 ;; for the group. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1511 (if (and (zerop (car active)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1512 (zerop (cdr active)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1513 (gnus-active group)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1514 (gnus-active group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1515 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1516 (gnus-set-active group active) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1517 ;; Return the new active info. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1518 active))))) |
17493 | 1519 |
1520 (defun gnus-get-unread-articles-in-group (info active &optional update) | |
1521 (when active | |
1522 ;; Allow the backend to update the info in the group. | |
1523 (when (and update | |
1524 (gnus-request-update-info | |
1525 info (inline (gnus-find-method-for-group | |
1526 (gnus-info-group info))))) | |
1527 (gnus-activate-group (gnus-info-group info) nil t)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1528 |
17493 | 1529 (let* ((range (gnus-info-read info)) |
1530 (num 0)) | |
1531 ;; If a cache is present, we may have to alter the active info. | |
1532 (when (and gnus-use-cache info) | |
1533 (inline (gnus-cache-possibly-alter-active | |
1534 (gnus-info-group info) active))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1535 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1536 ;; If the agent is enabled, we may have to alter the active info. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1537 (when (and gnus-agent info) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1538 (gnus-agent-possibly-alter-active |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1539 (gnus-info-group info) active)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1540 |
17493 | 1541 ;; Modify the list of read articles according to what articles |
1542 ;; are available; then tally the unread articles and add the | |
1543 ;; number to the group hash table entry. | |
1544 (cond | |
1545 ((zerop (cdr active)) | |
1546 (setq num 0)) | |
1547 ((not range) | |
1548 (setq num (- (1+ (cdr active)) (car active)))) | |
1549 ((not (listp (cdr range))) | |
1550 ;; Fix a single (num . num) range according to the | |
1551 ;; active hash table. | |
1552 ;; Fix by Carsten Bormann <cabo@Informatik.Uni-Bremen.DE>. | |
1553 (and (< (cdr range) (car active)) (setcdr range (1- (car active)))) | |
1554 (and (> (cdr range) (cdr active)) (setcdr range (cdr active))) | |
1555 ;; Compute number of unread articles. | |
1556 (setq num (max 0 (- (cdr active) (- (1+ (cdr range)) (car range)))))) | |
1557 (t | |
1558 ;; The read list is a list of ranges. Fix them according to | |
1559 ;; the active hash table. | |
1560 ;; First peel off any elements that are below the lower | |
1561 ;; active limit. | |
1562 (while (and (cdr range) | |
1563 (>= (car active) | |
1564 (or (and (atom (cadr range)) (cadr range)) | |
1565 (caadr range)))) | |
1566 (if (numberp (car range)) | |
1567 (setcar range | |
1568 (cons (car range) | |
1569 (or (and (numberp (cadr range)) | |
1570 (cadr range)) | |
1571 (cdadr range)))) | |
1572 (setcdr (car range) | |
1573 (or (and (numberp (nth 1 range)) (nth 1 range)) | |
1574 (cdadr range)))) | |
1575 (setcdr range (cddr range))) | |
1576 ;; Adjust the first element to be the same as the lower limit. | |
1577 (when (and (not (atom (car range))) | |
1578 (< (cdar range) (car active))) | |
1579 (setcdr (car range) (1- (car active)))) | |
1580 ;; Then we want to peel off any elements that are higher | |
1581 ;; than the upper active limit. | |
1582 (let ((srange range)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1583 ;; Go past all valid elements. |
17493 | 1584 (while (and (cdr srange) |
1585 (<= (or (and (atom (cadr srange)) | |
1586 (cadr srange)) | |
1587 (caadr srange)) | |
1588 (cdr active))) | |
1589 (setq srange (cdr srange))) | |
1590 (when (cdr srange) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1591 ;; Nuke all remaining invalid elements. |
17493 | 1592 (setcdr srange nil)) |
1593 | |
1594 ;; Adjust the final element. | |
1595 (when (and (not (atom (car srange))) | |
1596 (> (cdar srange) (cdr active))) | |
1597 (setcdr (car srange) (cdr active)))) | |
1598 ;; Compute the number of unread articles. | |
1599 (while range | |
1600 (setq num (+ num (- (1+ (or (and (atom (car range)) (car range)) | |
1601 (cdar range))) | |
1602 (or (and (atom (car range)) (car range)) | |
1603 (caar range))))) | |
1604 (setq range (cdr range))) | |
1605 (setq num (max 0 (- (cdr active) num))))) | |
1606 ;; Set the number of unread articles. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1607 (when (and info |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1608 (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb)) |
17493 | 1609 (setcar (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb) num)) |
1610 num))) | |
1611 | |
1612 ;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb' | |
1613 ;; and compute how many unread articles there are in each group. | |
1614 (defun gnus-get-unread-articles (&optional level) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1615 (setq gnus-server-method-cache nil) |
17493 | 1616 (let* ((newsrc (cdr gnus-newsrc-alist)) |
1617 (level (or level gnus-activate-level (1+ gnus-level-subscribed))) | |
1618 (foreign-level | |
1619 (min | |
1620 (cond ((and gnus-activate-foreign-newsgroups | |
1621 (not (numberp gnus-activate-foreign-newsgroups))) | |
1622 (1+ gnus-level-subscribed)) | |
1623 ((numberp gnus-activate-foreign-newsgroups) | |
1624 gnus-activate-foreign-newsgroups) | |
1625 (t 0)) | |
1626 level)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1627 (methods-cache nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1628 (type-cache nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1629 scanned-methods info group active method retrieve-groups cmethod |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1630 method-type) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1631 (gnus-message 6 "Checking new news...") |
17493 | 1632 |
1633 (while newsrc | |
1634 (setq active (gnus-active (setq group (gnus-info-group | |
1635 (setq info (pop newsrc)))))) | |
1636 | |
1637 ;; Check newsgroups. If the user doesn't want to check them, or | |
1638 ;; they can't be checked (for instance, if the news server can't | |
1639 ;; be reached) we just set the number of unread articles in this | |
1640 ;; newsgroup to t. This means that Gnus thinks that there are | |
1641 ;; unread articles, but it has no idea how many. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1642 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1643 ;; To be more explicit: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1644 ;; >0 for an active group with messages |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1645 ;; 0 for an active group with no unread messages |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1646 ;; nil for non-foreign groups that the user has requested not be checked |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1647 ;; t for unchecked foreign groups or bogus groups, or groups that can't |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1648 ;; be checked, for one reason or other. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1649 (when (setq method (gnus-info-method info)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1650 (if (setq cmethod (assoc method methods-cache)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1651 (setq method (cdr cmethod)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1652 (setq cmethod (inline (gnus-server-get-method nil method))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1653 (push (cons method cmethod) methods-cache) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1654 (setq method cmethod))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1655 (when (and method |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1656 (not (setq method-type (cdr (assoc method type-cache))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1657 (setq method-type |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1658 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1659 ((gnus-secondary-method-p method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1660 'secondary) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1661 ((inline (gnus-server-equal gnus-select-method method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1662 'primary) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1663 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1664 'foreign))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1665 (push (cons method method-type) type-cache)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1666 (if (and method |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1667 (eq method-type 'foreign)) |
17493 | 1668 ;; These groups are foreign. Check the level. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1669 (when (and (<= (gnus-info-level info) foreign-level) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1670 (setq active (gnus-activate-group group 'scan))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1671 ;; Let the Gnus agent save the active file. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1672 (when (and gnus-agent active (gnus-online method)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1673 (gnus-agent-save-group-info |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1674 method (gnus-group-real-name group) active)) |
17493 | 1675 (unless (inline (gnus-virtual-group-p group)) |
1676 (inline (gnus-close-group group))) | |
1677 (when (fboundp (intern (concat (symbol-name (car method)) | |
1678 "-request-update-info"))) | |
1679 (inline (gnus-request-update-info info method)))) | |
1680 ;; These groups are native or secondary. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1681 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1682 ;; We don't want these groups. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1683 ((> (gnus-info-level info) level) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1684 (setq active 'ignore)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1685 ;; Activate groups. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1686 ((not gnus-read-active-file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1687 (if (gnus-check-backend-function 'retrieve-groups group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1688 ;; if server support gnus-retrieve-groups we push |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1689 ;; the group onto retrievegroups for later checking |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1690 (if (assoc method retrieve-groups) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1691 (setcdr (assoc method retrieve-groups) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1692 (cons group (cdr (assoc method retrieve-groups)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1693 (push (list method group) retrieve-groups)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1694 ;; hack: `nnmail-get-new-mail' changes the mail-source depending |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1695 ;; on the group, so we must perform a scan for every group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1696 ;; if the users has any directory mail sources. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1697 ;; hack: if `nnmail-scan-directory-mail-source-once' is non-nil, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1698 ;; for it scan all spool files even when the groups are |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1699 ;; not required. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1700 (if (and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1701 (or nnmail-scan-directory-mail-source-once |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1702 (null (assq 'directory |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1703 (or mail-sources |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1704 (if (listp nnmail-spool-file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1705 nnmail-spool-file |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1706 (list nnmail-spool-file)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1707 (member method scanned-methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1708 (setq active (gnus-activate-group group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1709 (setq active (gnus-activate-group group 'scan)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1710 (push method scanned-methods)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1711 (when active |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1712 (gnus-close-group group)))))) |
17493 | 1713 |
1714 ;; Get the number of unread articles in the group. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1715 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1716 ((eq active 'ignore) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1717 ;; Don't do anything. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1718 ) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1719 (active |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1720 (inline (gnus-get-unread-articles-in-group info active t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1721 (t |
17493 | 1722 ;; The group couldn't be reached, so we nix out the number of |
1723 ;; unread articles and stuff. | |
1724 (gnus-set-active group nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1725 (let ((tmp (gnus-gethash group gnus-newsrc-hashtb))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1726 (when tmp |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1727 (setcar tmp t)))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1728 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1729 ;; iterate through groups on methods which support gnus-retrieve-groups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1730 ;; and fetch a partial active file and use it to find new news. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1731 (dolist (rg retrieve-groups) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1732 (let ((method (or (car rg) gnus-select-method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1733 (groups (cdr rg))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1734 (when (gnus-check-server method) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1735 ;; Request that the backend scan its incoming messages. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1736 (when (gnus-check-backend-function 'request-scan (car method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1737 (gnus-request-scan nil method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1738 (gnus-read-active-file-2 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1739 (mapcar (lambda (group) (gnus-group-real-name group)) groups) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1740 method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1741 (dolist (group groups) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1742 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1743 ((setq active (gnus-active (gnus-info-group |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1744 (setq info (gnus-get-info group))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1745 (inline (gnus-get-unread-articles-in-group info active t))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1746 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1747 ;; The group couldn't be reached, so we nix out the number of |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1748 ;; unread articles and stuff. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1749 (gnus-set-active group nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1750 (setcar (gnus-gethash group gnus-newsrc-hashtb) t))))))) |
17493 | 1751 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1752 (gnus-message 6 "Checking new news...done"))) |
17493 | 1753 |
1754 ;; Create a hash table out of the newsrc alist. The `car's of the | |
1755 ;; alist elements are used as keys. | |
1756 (defun gnus-make-hashtable-from-newsrc-alist () | |
1757 (let ((alist gnus-newsrc-alist) | |
1758 (ohashtb gnus-newsrc-hashtb) | |
1759 prev) | |
1760 (setq gnus-newsrc-hashtb (gnus-make-hashtable (length alist))) | |
1761 (setq alist | |
1762 (setq prev (setq gnus-newsrc-alist | |
1763 (if (equal (caar gnus-newsrc-alist) | |
1764 "dummy.group") | |
1765 gnus-newsrc-alist | |
1766 (cons (list "dummy.group" 0 nil) alist))))) | |
1767 (while alist | |
1768 (gnus-sethash | |
1769 (caar alist) | |
1770 ;; Preserve number of unread articles in groups. | |
1771 (cons (and ohashtb (car (gnus-gethash (caar alist) ohashtb))) | |
1772 prev) | |
1773 gnus-newsrc-hashtb) | |
1774 (setq prev alist | |
1775 alist (cdr alist))))) | |
1776 | |
1777 (defun gnus-make-hashtable-from-killed () | |
1778 "Create a hash table from the killed and zombie lists." | |
1779 (let ((lists '(gnus-killed-list gnus-zombie-list)) | |
1780 list) | |
1781 (setq gnus-killed-hashtb | |
1782 (gnus-make-hashtable | |
1783 (+ (length gnus-killed-list) (length gnus-zombie-list)))) | |
1784 (while lists | |
1785 (setq list (symbol-value (pop lists))) | |
1786 (while list | |
1787 (gnus-sethash (car list) (pop list) gnus-killed-hashtb))))) | |
1788 | |
1789 (defun gnus-parse-active () | |
1790 "Parse active info in the nntp server buffer." | |
1791 (save-excursion | |
1792 (set-buffer nntp-server-buffer) | |
1793 (goto-char (point-min)) | |
1794 ;; Parse the result we got from `gnus-request-group'. | |
1795 (when (looking-at "[0-9]+ [0-9]+ \\([0-9]+\\) [0-9]+") | |
1796 (goto-char (match-beginning 1)) | |
1797 (cons (read (current-buffer)) | |
1798 (read (current-buffer)))))) | |
1799 | |
1800 (defun gnus-make-articles-unread (group articles) | |
1801 "Mark ARTICLES in GROUP as unread." | |
1802 (let* ((info (nth 2 (or (gnus-gethash group gnus-newsrc-hashtb) | |
1803 (gnus-gethash (gnus-group-real-name group) | |
1804 gnus-newsrc-hashtb)))) | |
1805 (ranges (gnus-info-read info)) | |
1806 news article) | |
1807 (while articles | |
1808 (when (gnus-member-of-range | |
1809 (setq article (pop articles)) ranges) | |
1810 (push article news))) | |
1811 (when news | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1812 ;; Enter this list into the group info. |
17493 | 1813 (gnus-info-set-read |
1814 info (gnus-remove-from-range (gnus-info-read info) (nreverse news))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1815 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1816 ;; Set the number of unread articles in gnus-newsrc-hashtb. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1817 (gnus-get-unread-articles-in-group info (gnus-active group)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1818 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1819 ;; Insert the change into the group buffer and the dribble file. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1820 (gnus-group-update-group group t)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1821 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1822 (defun gnus-make-ascending-articles-unread (group articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1823 "Mark ascending ARTICLES in GROUP as unread." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1824 (let* ((entry (or (gnus-gethash group gnus-newsrc-hashtb) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1825 (gnus-gethash (gnus-group-real-name group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1826 gnus-newsrc-hashtb))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1827 (info (nth 2 entry)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1828 (ranges (gnus-info-read info)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1829 (r ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1830 modified) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1831 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1832 (while articles |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1833 (let ((article (pop articles))) ; get the next article to remove from ranges |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1834 (while (let ((range (car ranges))) ; note the current range |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1835 (if (atom range) ; single value range |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1836 (cond ((not range) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1837 ;; the articles extend past the end of the ranges |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1838 ;; OK - I'm done |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1839 (setq articles nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1840 ((< range article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1841 ;; this range preceeds the article. Leave the range unmodified. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1842 (pop ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1843 ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1844 ((= range article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1845 ;; this range exactly matches the article; REMOVE THE RANGE. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1846 ;; NOTE: When the range being removed is the last range, the list is corrupted by inserting null at its end. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1847 (setcar ranges (cadr ranges)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1848 (setcdr ranges (cddr ranges)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1849 (setq modified (if (car ranges) t 'remove-null)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1850 nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1851 (let ((min (car range)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1852 (max (cdr range))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1853 ;; I have a min/max range to consider |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1854 (cond ((> min max) ; invalid range introduced by splitter |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1855 (setcar ranges (cadr ranges)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1856 (setcdr ranges (cddr ranges)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1857 (setq modified (if (car ranges) t 'remove-null)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1858 ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1859 ((= min max) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1860 ;; replace min/max range with a single-value range |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1861 (setcar ranges min) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1862 ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1863 ((< max article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1864 ;; this range preceeds the article. Leave the range unmodified. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1865 (pop ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1866 ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1867 ((< article min) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1868 ;; this article preceeds the range. Return null to move to the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1869 ;; next article |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1870 nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1871 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1872 ;; this article splits the range into two parts |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1873 (setcdr ranges (cons (cons (1+ article) max) (cdr ranges))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1874 (setcdr range (1- article)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1875 (setq modified t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1876 ranges)))))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1877 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1878 (when modified |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1879 (when (eq modified 'remove-null) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1880 (setq r (delq nil r))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1881 ;; Enter this list into the group info. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1882 (gnus-info-set-read info r) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1883 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1884 ;; Set the number of unread articles in gnus-newsrc-hashtb. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1885 (gnus-get-unread-articles-in-group info (gnus-active group)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1886 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1887 ;; Insert the change into the group buffer and the dribble file. |
17493 | 1888 (gnus-group-update-group group t)))) |
1889 | |
1890 ;; Enter all dead groups into the hashtb. | |
1891 (defun gnus-update-active-hashtb-from-killed () | |
1892 (let ((hashtb (setq gnus-active-hashtb (gnus-make-hashtable 4096))) | |
1893 (lists (list gnus-killed-list gnus-zombie-list)) | |
1894 killed) | |
1895 (while lists | |
1896 (setq killed (car lists)) | |
1897 (while killed | |
1898 (gnus-sethash (car killed) nil hashtb) | |
1899 (setq killed (cdr killed))) | |
1900 (setq lists (cdr lists))))) | |
1901 | |
1902 (defun gnus-get-killed-groups () | |
1903 "Go through the active hashtb and mark all unknown groups as killed." | |
1904 ;; First make sure active file has been read. | |
1905 (unless (gnus-read-active-file-p) | |
1906 (let ((gnus-read-active-file t)) | |
1907 (gnus-read-active-file))) | |
1908 (unless gnus-killed-hashtb | |
1909 (gnus-make-hashtable-from-killed)) | |
1910 ;; Go through all newsgroups that are known to Gnus - enlarge kill list. | |
1911 (mapatoms | |
1912 (lambda (sym) | |
1913 (let ((groups 0) | |
1914 (group (symbol-name sym))) | |
1915 (if (or (null group) | |
1916 (gnus-gethash group gnus-killed-hashtb) | |
1917 (gnus-gethash group gnus-newsrc-hashtb)) | |
1918 () | |
1919 (let ((do-sub (gnus-matches-options-n group))) | |
1920 (if (or (eq do-sub 'subscribe) (eq do-sub 'ignore)) | |
1921 () | |
1922 (setq groups (1+ groups)) | |
1923 (push group gnus-killed-list) | |
1924 (gnus-sethash group group gnus-killed-hashtb)))))) | |
1925 gnus-active-hashtb) | |
1926 (gnus-dribble-touch)) | |
1927 | |
1928 ;; Get the active file(s) from the backend(s). | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1929 (defun gnus-read-active-file (&optional force not-native) |
17493 | 1930 (gnus-group-set-mode-line) |
1931 (let ((methods | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1932 (mapcar |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1933 (lambda (m) (if (stringp m) (gnus-server-get-method nil m) m)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1934 (append |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1935 (if (and (not not-native) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1936 (gnus-check-server gnus-select-method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1937 ;; The native server is available. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1938 (cons gnus-select-method gnus-secondary-select-methods) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1939 ;; The native server is down, so we just do the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1940 ;; secondary ones. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1941 gnus-secondary-select-methods) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1942 ;; Also read from the archive server. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1943 (when (gnus-archive-server-wanted-p) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1944 (list "archive"))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1945 method) |
17493 | 1946 (setq gnus-have-read-active-file nil) |
1947 (save-excursion | |
1948 (set-buffer nntp-server-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1949 (while (setq method (pop methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1950 ;; Only do each method once, in case the methods appear more |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1951 ;; than once in this list. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1952 (unless (member method methods) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1953 (if (or debug-on-error debug-on-quit) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1954 (gnus-read-active-file-1 method force) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1955 (condition-case () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1956 (gnus-read-active-file-1 method force) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1957 ;; We catch C-g so that we can continue past servers |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1958 ;; that do not respond. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1959 (quit |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1960 (message "Quit reading the active file") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1961 nil)))))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1962 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1963 (defun gnus-read-active-file-1 (method force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1964 (let (where mesg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1965 (setq where (nth 1 method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1966 mesg (format "Reading active file%s via %s..." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1967 (if (and where (not (zerop (length where)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1968 (concat " from " where) "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1969 (car method))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1970 (gnus-message 5 mesg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1971 (when (gnus-check-server method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1972 ;; Request that the backend scan its incoming messages. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1973 (when (gnus-check-backend-function 'request-scan (car method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1974 (gnus-request-scan nil method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1975 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1976 ((and (eq gnus-read-active-file 'some) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1977 (gnus-check-backend-function 'retrieve-groups (car method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1978 (not force)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1979 (let ((newsrc (cdr gnus-newsrc-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1980 (gmethod (gnus-server-get-method nil method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1981 groups info) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1982 (while (setq info (pop newsrc)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1983 (when (inline |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1984 (gnus-server-equal |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1985 (inline |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1986 (gnus-find-method-for-group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1987 (gnus-info-group info) info)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1988 gmethod)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1989 (push (gnus-group-real-name (gnus-info-group info)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1990 groups))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1991 (gnus-read-active-file-2 groups method))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1992 ((null method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1993 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1994 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1995 (if (not (gnus-request-list method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1996 (unless (equal method gnus-message-archive-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1997 (gnus-error 1 "Cannot read active file from %s server" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1998 (car method))) |
17493 | 1999 (gnus-message 5 mesg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2000 (gnus-active-to-gnus-format method gnus-active-hashtb nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2001 ;; We mark this active file as read. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2002 (push method gnus-have-read-active-file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2003 (gnus-message 5 "%sdone" mesg))))))) |
17493 | 2004 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2005 (defun gnus-read-active-file-2 (groups method) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2006 "Read an active file for GROUPS in METHOD using `gnus-retrieve-groups'." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2007 (when groups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2008 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2009 (set-buffer nntp-server-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2010 (gnus-check-server method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2011 (let ((list-type (gnus-retrieve-groups groups method))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2012 (cond ((not list-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2013 (gnus-error |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2014 1.2 "Cannot read partial active file from %s server." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2015 (car method))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2016 ((eq list-type 'active) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2017 (gnus-active-to-gnus-format method gnus-active-hashtb nil t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2018 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2019 (gnus-groups-to-gnus-format method gnus-active-hashtb t))))))) |
17493 | 2020 |
2021 ;; Read an active file and place the results in `gnus-active-hashtb'. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2022 (defun gnus-active-to-gnus-format (&optional method hashtb ignore-errors |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2023 real-active) |
17493 | 2024 (unless method |
2025 (setq method gnus-select-method)) | |
2026 (let ((cur (current-buffer)) | |
2027 (hashtb (or hashtb | |
2028 (if (and gnus-active-hashtb | |
2029 (not (equal method gnus-select-method))) | |
2030 gnus-active-hashtb | |
2031 (setq gnus-active-hashtb | |
2032 (if (equal method gnus-select-method) | |
2033 (gnus-make-hashtable | |
2034 (count-lines (point-min) (point-max))) | |
2035 (gnus-make-hashtable 4096))))))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2036 ;; Delete unnecessary lines. |
17493 | 2037 (goto-char (point-min)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2038 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2039 ((string= gnus-ignored-newsgroups "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2040 (delete-matching-lines "^to\\.")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2041 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2042 (delete-matching-lines (concat "^to\\.\\|" gnus-ignored-newsgroups)))) |
17493 | 2043 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2044 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2045 (unless (re-search-forward "[\\\"]" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2046 ;; Make the group names readable as a lisp expression even if they |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2047 ;; contain special characters. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2048 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2049 (while (re-search-backward "[][';?()#]" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2050 (insert ?\\))) |
17493 | 2051 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2052 ;; Let the Gnus agent save the active file. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2053 (when (and gnus-agent real-active (gnus-online method)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2054 (gnus-agent-save-active method)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2055 |
17493 | 2056 ;; If these are groups from a foreign select method, we insert the |
2057 ;; group prefix in front of the group names. | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2058 (when (not (gnus-server-equal |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2059 (gnus-server-get-method nil method) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2060 (gnus-server-get-method nil gnus-select-method))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2061 (let ((prefix (gnus-group-prefixed-name "" method))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2062 (goto-char (point-min)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2063 (while (and (not (eobp)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2064 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2065 (when (= (following-char) ?\") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2066 (forward-char 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2067 (insert prefix) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2068 (zerop (forward-line 1))))))) |
17493 | 2069 ;; Store the active file in a hash table. |
2070 (goto-char (point-min)) | |
2071 (let (group max min) | |
2072 (while (not (eobp)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2073 (condition-case () |
17493 | 2074 (progn |
2075 (narrow-to-region (point) (gnus-point-at-eol)) | |
2076 ;; group gets set to a symbol interned in the hash table | |
2077 ;; (what a hack!!) - jwz | |
2078 (setq group (let ((obarray hashtb)) (read cur))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2079 ;; ### The extended group name scheme makes |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2080 ;; the previous optimization strategy sort of pointless... |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2081 (when (stringp group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2082 (setq group (intern group hashtb))) |
17493 | 2083 (if (and (numberp (setq max (read cur))) |
2084 (numberp (setq min (read cur))) | |
2085 (progn | |
2086 (skip-chars-forward " \t") | |
2087 (not | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2088 (or (eq (char-after) ?=) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2089 (eq (char-after) ?x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2090 (eq (char-after) ?j))))) |
17493 | 2091 (progn |
2092 (set group (cons min max)) | |
2093 ;; if group is moderated, stick in moderation table | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2094 (when (eq (char-after) ?m) |
17493 | 2095 (unless gnus-moderated-hashtb |
2096 (setq gnus-moderated-hashtb (gnus-make-hashtable))) | |
2097 (gnus-sethash (symbol-name group) t | |
2098 gnus-moderated-hashtb))) | |
2099 (set group nil))) | |
2100 (error | |
2101 (and group | |
2102 (symbolp group) | |
2103 (set group nil)) | |
2104 (unless ignore-errors | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2105 (gnus-message 3 "Warning - invalid active: %s" |
17493 | 2106 (buffer-substring |
2107 (gnus-point-at-bol) (gnus-point-at-eol)))))) | |
2108 (widen) | |
2109 (forward-line 1))))) | |
2110 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2111 (defun gnus-groups-to-gnus-format (method &optional hashtb real-active) |
17493 | 2112 ;; Parse a "groups" active file. |
2113 (let ((cur (current-buffer)) | |
2114 (hashtb (or hashtb | |
2115 (if (and method gnus-active-hashtb) | |
2116 gnus-active-hashtb | |
2117 (setq gnus-active-hashtb | |
2118 (gnus-make-hashtable | |
2119 (count-lines (point-min) (point-max))))))) | |
2120 (prefix (and method | |
2121 (not (gnus-server-equal | |
2122 (gnus-server-get-method nil method) | |
2123 (gnus-server-get-method nil gnus-select-method))) | |
2124 (gnus-group-prefixed-name "" method)))) | |
2125 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2126 ;; Let the Gnus agent save the active file. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2127 (if (and gnus-agent |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2128 real-active |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2129 (gnus-online method) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2130 (gnus-agent-method-p method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2131 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2132 (gnus-agent-save-groups method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2133 (gnus-active-to-gnus-format method hashtb nil real-active)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2134 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2135 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2136 ;; We split this into to separate loops, one with the prefix |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2137 ;; and one without to speed the reading up somewhat. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2138 (if prefix |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2139 (let (min max opoint group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2140 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2141 (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2142 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2143 (read cur) (read cur) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2144 (setq min (read cur) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2145 max (read cur) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2146 opoint (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2147 (skip-chars-forward " \t") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2148 (insert prefix) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2149 (goto-char opoint) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2150 (set (let ((obarray hashtb)) (read cur)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2151 (cons min max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2152 (error (and group (symbolp group) (set group nil)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2153 (forward-line 1))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2154 (let (min max group) |
17493 | 2155 (while (not (eobp)) |
2156 (condition-case () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2157 (when (eq (char-after) ?2) |
17493 | 2158 (read cur) (read cur) |
2159 (setq min (read cur) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2160 max (read cur)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2161 (set (setq group (let ((obarray hashtb)) (read cur))) |
17493 | 2162 (cons min max))) |
2163 (error (and group (symbolp group) (set group nil)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2164 (forward-line 1))))))) |
17493 | 2165 |
2166 (defun gnus-read-newsrc-file (&optional force) | |
2167 "Read startup file. | |
2168 If FORCE is non-nil, the .newsrc file is read." | |
2169 ;; Reset variables that might be defined in the .newsrc.eld file. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2170 (let ((variables (remove 'gnus-format-specs gnus-variable-list))) |
17493 | 2171 (while variables |
2172 (set (car variables) nil) | |
2173 (setq variables (cdr variables)))) | |
2174 (let* ((newsrc-file gnus-current-startup-file) | |
2175 (quick-file (concat newsrc-file ".el"))) | |
2176 (save-excursion | |
2177 ;; We always load the .newsrc.eld file. If always contains | |
2178 ;; much information that can not be gotten from the .newsrc | |
2179 ;; file (ticked articles, killed groups, foreign methods, etc.) | |
2180 (gnus-read-newsrc-el-file quick-file) | |
2181 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2182 (when (and gnus-read-newsrc-file |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2183 (file-exists-p gnus-current-startup-file) |
17493 | 2184 (or force |
2185 (and (file-newer-than-file-p newsrc-file quick-file) | |
2186 (file-newer-than-file-p newsrc-file | |
2187 (concat quick-file "d"))) | |
2188 (not gnus-newsrc-alist))) | |
2189 ;; We read the .newsrc file. Note that if there if a | |
2190 ;; .newsrc.eld file exists, it has already been read, and | |
2191 ;; the `gnus-newsrc-hashtb' has been created. While reading | |
2192 ;; the .newsrc file, Gnus will only use the information it | |
2193 ;; can find there for changing the data already read - | |
2194 ;; i. e., reading the .newsrc file will not trash the data | |
2195 ;; already read (except for read articles). | |
2196 (save-excursion | |
2197 (gnus-message 5 "Reading %s..." newsrc-file) | |
2198 (set-buffer (nnheader-find-file-noselect newsrc-file)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2199 (buffer-disable-undo) |
17493 | 2200 (gnus-newsrc-to-gnus-format) |
2201 (kill-buffer (current-buffer)) | |
2202 (gnus-message 5 "Reading %s...done" newsrc-file))) | |
2203 | |
2204 ;; Convert old to new. | |
2205 (gnus-convert-old-newsrc)))) | |
2206 | |
2207 (defun gnus-convert-old-newsrc () | |
2208 "Convert old newsrc into the new format, if needed." | |
2209 (let ((fcv (and gnus-newsrc-file-version | |
2210 (gnus-continuum-version gnus-newsrc-file-version)))) | |
2211 (cond | |
2212 ;; No .newsrc.eld file was loaded. | |
2213 ((null fcv) nil) | |
2214 ;; Gnus 5 .newsrc.eld was loaded. | |
2215 ((< fcv (gnus-continuum-version "September Gnus v0.1")) | |
2216 (gnus-convert-old-ticks))))) | |
2217 | |
2218 (defun gnus-convert-old-ticks () | |
2219 (let ((newsrc (cdr gnus-newsrc-alist)) | |
2220 marks info dormant ticked) | |
2221 (while (setq info (pop newsrc)) | |
2222 (when (setq marks (gnus-info-marks info)) | |
2223 (setq dormant (cdr (assq 'dormant marks)) | |
2224 ticked (cdr (assq 'tick marks))) | |
2225 (when (or dormant ticked) | |
2226 (gnus-info-set-read | |
2227 info | |
2228 (gnus-add-to-range | |
2229 (gnus-info-read info) | |
2230 (nconc (gnus-uncompress-range dormant) | |
2231 (gnus-uncompress-range ticked))))))))) | |
2232 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2233 (defun gnus-load (file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2234 "Load FILE, but in such a way that read errors can be reported." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2235 (with-temp-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2236 (insert-file-contents file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2237 (while (not (eobp)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2238 (condition-case type |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2239 (let ((form (read (current-buffer)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2240 (eval form)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2241 (error |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2242 (unless (eq (car type) 'end-of-file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2243 (let ((error (format "Error in %s line %d" file |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2244 (count-lines (point-min) (point))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2245 (ding) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2246 (unless (gnus-yes-or-no-p (concat error "; continue? ")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2247 (error "%s" error))))))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2248 |
17493 | 2249 (defun gnus-read-newsrc-el-file (file) |
2250 (let ((ding-file (concat file "d"))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2251 (when (file-exists-p ding-file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2252 ;; We always, always read the .eld file. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2253 (gnus-message 5 "Reading %s..." ding-file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2254 (let (gnus-newsrc-assoc) |
89971
cce1c0ee76ee
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36
Miles Bader <miles@gnu.org>
diff
changeset
|
2255 (gnus-load ding-file) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2256 ;; Older versions of `gnus-format-specs' are no longer valid |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2257 ;; in Oort Gnus 0.01. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2258 (let ((version |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2259 (and gnus-newsrc-file-version |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2260 (gnus-continuum-version gnus-newsrc-file-version)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2261 (when (or (not version) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2262 (< version 5.090009)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2263 (setq gnus-format-specs gnus-default-format-specs))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2264 (when gnus-newsrc-assoc |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2265 (setq gnus-newsrc-alist gnus-newsrc-assoc)))) |
17493 | 2266 (gnus-make-hashtable-from-newsrc-alist) |
2267 (when (file-newer-than-file-p file ding-file) | |
2268 ;; Old format quick file | |
2269 (gnus-message 5 "Reading %s..." file) | |
2270 ;; The .el file is newer than the .eld file, so we read that one | |
2271 ;; as well. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2272 (gnus-read-old-newsrc-el-file file))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2273 (gnus-run-hooks 'gnus-read-newsrc-el-hook)) |
17493 | 2274 |
2275 ;; Parse the old-style quick startup file | |
2276 (defun gnus-read-old-newsrc-el-file (file) | |
2277 (let (newsrc killed marked group m info) | |
2278 (prog1 | |
2279 (let ((gnus-killed-assoc nil) | |
2280 gnus-marked-assoc gnus-newsrc-alist gnus-newsrc-assoc) | |
2281 (prog1 | |
2282 (ignore-errors | |
2283 (load file t t t)) | |
2284 (setq newsrc gnus-newsrc-assoc | |
2285 killed gnus-killed-assoc | |
2286 marked gnus-marked-assoc))) | |
2287 (setq gnus-newsrc-alist nil) | |
2288 (while (setq group (pop newsrc)) | |
2289 (if (setq info (gnus-get-info (car group))) | |
2290 (progn | |
2291 (gnus-info-set-read info (cddr group)) | |
2292 (gnus-info-set-level | |
2293 info (if (nth 1 group) gnus-level-default-subscribed | |
2294 gnus-level-default-unsubscribed)) | |
2295 (push info gnus-newsrc-alist)) | |
2296 (push (setq info | |
2297 (list (car group) | |
2298 (if (nth 1 group) gnus-level-default-subscribed | |
2299 gnus-level-default-unsubscribed) | |
2300 (cddr group))) | |
2301 gnus-newsrc-alist)) | |
2302 ;; Copy marks into info. | |
2303 (when (setq m (assoc (car group) marked)) | |
2304 (unless (nthcdr 3 info) | |
2305 (nconc info (list nil))) | |
2306 (gnus-info-set-marks | |
2307 info (list (cons 'tick (gnus-compress-sequence | |
2308 (sort (cdr m) '<) t)))))) | |
2309 (setq newsrc killed) | |
2310 (while newsrc | |
2311 (setcar newsrc (caar newsrc)) | |
2312 (setq newsrc (cdr newsrc))) | |
2313 (setq gnus-killed-list killed)) | |
2314 ;; The .el file version of this variable does not begin with | |
2315 ;; "options", while the .eld version does, so we just add it if it | |
2316 ;; isn't there. | |
2317 (when | |
2318 gnus-newsrc-options | |
2319 (when (not (string-match "^ *options" gnus-newsrc-options)) | |
2320 (setq gnus-newsrc-options (concat "options " gnus-newsrc-options))) | |
2321 (when (not (string-match "\n$" gnus-newsrc-options)) | |
2322 (setq gnus-newsrc-options (concat gnus-newsrc-options "\n"))) | |
2323 ;; Finally, if we read some options lines, we parse them. | |
2324 (unless (string= gnus-newsrc-options "") | |
2325 (gnus-newsrc-parse-options gnus-newsrc-options))) | |
2326 | |
2327 (setq gnus-newsrc-alist (nreverse gnus-newsrc-alist)) | |
2328 (gnus-make-hashtable-from-newsrc-alist))) | |
2329 | |
2330 (defun gnus-make-newsrc-file (file) | |
2331 "Make server dependent file name by catenating FILE and server host name." | |
2332 (let* ((file (expand-file-name file nil)) | |
2333 (real-file (concat file "-" (nth 1 gnus-select-method)))) | |
2334 (if (or (file-exists-p real-file) | |
2335 (file-exists-p (concat real-file ".el")) | |
2336 (file-exists-p (concat real-file ".eld"))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2337 real-file |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2338 file))) |
17493 | 2339 |
2340 (defun gnus-newsrc-to-gnus-format () | |
2341 (setq gnus-newsrc-options "") | |
2342 (setq gnus-newsrc-options-n nil) | |
2343 | |
2344 (unless gnus-active-hashtb | |
2345 (setq gnus-active-hashtb (gnus-make-hashtable 4096))) | |
2346 (let ((buf (current-buffer)) | |
2347 (already-read (> (length gnus-newsrc-alist) 1)) | |
2348 group subscribed options-symbol newsrc Options-symbol | |
2349 symbol reads num1) | |
2350 (goto-char (point-min)) | |
2351 ;; We intern the symbol `options' in the active hashtb so that we | |
2352 ;; can `eq' against it later. | |
2353 (set (setq options-symbol (intern "options" gnus-active-hashtb)) nil) | |
2354 (set (setq Options-symbol (intern "Options" gnus-active-hashtb)) nil) | |
2355 | |
2356 (while (not (eobp)) | |
2357 ;; We first read the first word on the line by narrowing and | |
2358 ;; then reading into `gnus-active-hashtb'. Most groups will | |
2359 ;; already exist in that hashtb, so this will save some string | |
2360 ;; space. | |
2361 (narrow-to-region | |
2362 (point) | |
2363 (progn (skip-chars-forward "^ \t!:\n") (point))) | |
2364 (goto-char (point-min)) | |
2365 (setq symbol | |
2366 (and (/= (point-min) (point-max)) | |
2367 (let ((obarray gnus-active-hashtb)) (read buf)))) | |
2368 (widen) | |
2369 ;; Now, the symbol we have read is either `options' or a group | |
2370 ;; name. If it is an options line, we just add it to a string. | |
2371 (cond | |
2372 ((or (eq symbol options-symbol) | |
2373 (eq symbol Options-symbol)) | |
2374 (setq gnus-newsrc-options | |
2375 ;; This concating is quite inefficient, but since our | |
2376 ;; thorough studies show that approx 99.37% of all | |
2377 ;; .newsrc files only contain a single options line, we | |
2378 ;; don't give a damn, frankly, my dear. | |
2379 (concat gnus-newsrc-options | |
2380 (buffer-substring | |
2381 (gnus-point-at-bol) | |
2382 ;; Options may continue on the next line. | |
2383 (or (and (re-search-forward "^[^ \t]" nil 'move) | |
2384 (progn (beginning-of-line) (point))) | |
2385 (point))))) | |
2386 (forward-line -1)) | |
2387 (symbol | |
2388 ;; Group names can be just numbers. | |
2389 (when (numberp symbol) | |
2390 (setq symbol (intern (int-to-string symbol) gnus-active-hashtb))) | |
2391 (unless (boundp symbol) | |
2392 (set symbol nil)) | |
2393 ;; It was a group name. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2394 (setq subscribed (eq (char-after) ?:) |
17493 | 2395 group (symbol-name symbol) |
2396 reads nil) | |
2397 (if (eolp) | |
2398 ;; If the line ends here, this is clearly a buggy line, so | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2399 ;; we put point a the beginning of line and let the cond |
17493 | 2400 ;; below do the error handling. |
2401 (beginning-of-line) | |
2402 ;; We skip to the beginning of the ranges. | |
2403 (skip-chars-forward "!: \t")) | |
2404 ;; We are now at the beginning of the list of read articles. | |
2405 ;; We read them range by range. | |
2406 (while | |
2407 (cond | |
2408 ((looking-at "[0-9]+") | |
2409 ;; We narrow and read a number instead of buffer-substring/ | |
2410 ;; string-to-int because it's faster. narrow/widen is | |
2411 ;; faster than save-restriction/narrow, and save-restriction | |
2412 ;; produces a garbage object. | |
2413 (setq num1 (progn | |
2414 (narrow-to-region (match-beginning 0) (match-end 0)) | |
2415 (read buf))) | |
2416 (widen) | |
2417 ;; If the next character is a dash, then this is a range. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2418 (if (eq (char-after) ?-) |
17493 | 2419 (progn |
2420 ;; We read the upper bound of the range. | |
2421 (forward-char 1) | |
2422 (if (not (looking-at "[0-9]+")) | |
2423 ;; This is a buggy line, by we pretend that | |
2424 ;; it's kinda OK. Perhaps the user should be | |
2425 ;; dinged? | |
2426 (push num1 reads) | |
2427 (push | |
2428 (cons num1 | |
2429 (progn | |
2430 (narrow-to-region (match-beginning 0) | |
2431 (match-end 0)) | |
2432 (read buf))) | |
2433 reads) | |
2434 (widen))) | |
2435 ;; It was just a simple number, so we add it to the | |
2436 ;; list of ranges. | |
2437 (push num1 reads)) | |
2438 ;; If the next char in ?\n, then we have reached the end | |
2439 ;; of the line and return nil. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2440 (not (eq (char-after) ?\n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2441 ((eq (char-after) ?\n) |
17493 | 2442 ;; End of line, so we end. |
2443 nil) | |
2444 (t | |
2445 ;; Not numbers and not eol, so this might be a buggy | |
2446 ;; line... | |
2447 (unless (eobp) | |
2448 ;; If it was eob instead of ?\n, we allow it. | |
2449 ;; The line was buggy. | |
2450 (setq group nil) | |
2451 (gnus-error 3.1 "Mangled line: %s" | |
2452 (buffer-substring (gnus-point-at-bol) | |
2453 (gnus-point-at-eol)))) | |
2454 nil)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2455 ;; Skip past ", ". Spaces are invalid in these ranges, but |
17493 | 2456 ;; we allow them, because it's a common mistake to put a |
2457 ;; space after the comma. | |
2458 (skip-chars-forward ", ")) | |
2459 | |
2460 ;; We have already read .newsrc.eld, so we gently update the | |
2461 ;; data in the hash table with the information we have just | |
2462 ;; read. | |
2463 (when group | |
2464 (let ((info (gnus-get-info group)) | |
2465 level) | |
2466 (if info | |
2467 ;; There is an entry for this file in the alist. | |
2468 (progn | |
2469 (gnus-info-set-read info (nreverse reads)) | |
2470 ;; We update the level very gently. In fact, we | |
2471 ;; only change it if there's been a status change | |
2472 ;; from subscribed to unsubscribed, or vice versa. | |
2473 (setq level (gnus-info-level info)) | |
2474 (cond ((and (<= level gnus-level-subscribed) | |
2475 (not subscribed)) | |
2476 (setq level (if reads | |
2477 gnus-level-default-unsubscribed | |
2478 (1+ gnus-level-default-unsubscribed)))) | |
2479 ((and (> level gnus-level-subscribed) subscribed) | |
2480 (setq level gnus-level-default-subscribed))) | |
2481 (gnus-info-set-level info level)) | |
2482 ;; This is a new group. | |
2483 (setq info (list group | |
2484 (if subscribed | |
2485 gnus-level-default-subscribed | |
2486 (if reads | |
2487 (1+ gnus-level-subscribed) | |
2488 gnus-level-default-unsubscribed)) | |
2489 (nreverse reads)))) | |
2490 (push info newsrc))))) | |
2491 (forward-line 1)) | |
2492 | |
2493 (setq newsrc (nreverse newsrc)) | |
2494 | |
2495 (if (not already-read) | |
2496 () | |
2497 ;; We now have two newsrc lists - `newsrc', which is what we | |
2498 ;; have read from .newsrc, and `gnus-newsrc-alist', which is | |
2499 ;; what we've read from .newsrc.eld. We have to merge these | |
2500 ;; lists. We do this by "attaching" any (foreign) groups in the | |
2501 ;; gnus-newsrc-alist to the (native) group that precedes them. | |
2502 (let ((rc (cdr gnus-newsrc-alist)) | |
2503 (prev gnus-newsrc-alist) | |
2504 entry mentry) | |
2505 (while rc | |
2506 (or (null (nth 4 (car rc))) ; It's a native group. | |
2507 (assoc (caar rc) newsrc) ; It's already in the alist. | |
2508 (if (setq entry (assoc (caar prev) newsrc)) | |
2509 (setcdr (setq mentry (memq entry newsrc)) | |
2510 (cons (car rc) (cdr mentry))) | |
2511 (push (car rc) newsrc))) | |
2512 (setq prev rc | |
2513 rc (cdr rc))))) | |
2514 | |
2515 (setq gnus-newsrc-alist newsrc) | |
2516 ;; We make the newsrc hashtb. | |
2517 (gnus-make-hashtable-from-newsrc-alist) | |
2518 | |
2519 ;; Finally, if we read some options lines, we parse them. | |
2520 (unless (string= gnus-newsrc-options "") | |
2521 (gnus-newsrc-parse-options gnus-newsrc-options)))) | |
2522 | |
2523 ;; Parse options lines to find "options -n !all rec.all" and stuff. | |
2524 ;; The return value will be a list on the form | |
2525 ;; ((regexp1 . ignore) | |
2526 ;; (regexp2 . subscribe)...) | |
2527 ;; When handling new newsgroups, groups that match a `ignore' regexp | |
2528 ;; will be ignored, and groups that match a `subscribe' regexp will be | |
2529 ;; subscribed. A line like | |
2530 ;; options -n !all rec.all | |
2531 ;; will lead to a list that looks like | |
2532 ;; (("^rec\\..+" . subscribe) | |
2533 ;; ("^.+" . ignore)) | |
2534 ;; So all "rec.*" groups will be subscribed, while all the other | |
2535 ;; groups will be ignored. Note that "options -n !all rec.all" is very | |
2536 ;; different from "options -n rec.all !all". | |
2537 (defun gnus-newsrc-parse-options (options) | |
2538 (let (out eol) | |
2539 (save-excursion | |
2540 (gnus-set-work-buffer) | |
2541 (insert (regexp-quote options)) | |
2542 ;; First we treat all continuation lines. | |
2543 (goto-char (point-min)) | |
2544 (while (re-search-forward "\n[ \t]+" nil t) | |
2545 (replace-match " " t t)) | |
2546 ;; Then we transform all "all"s into ".+"s. | |
2547 (goto-char (point-min)) | |
2548 (while (re-search-forward "\\ball\\b" nil t) | |
2549 (replace-match ".+" t t)) | |
2550 (goto-char (point-min)) | |
2551 ;; We remove all other options than the "-n" ones. | |
2552 (while (re-search-forward "[ \t]-[^n][^-]*" nil t) | |
2553 (replace-match " ") | |
2554 (forward-char -1)) | |
2555 (goto-char (point-min)) | |
2556 | |
2557 ;; We are only interested in "options -n" lines - we | |
2558 ;; ignore the other option lines. | |
2559 (while (re-search-forward "[ \t]-n" nil t) | |
2560 (setq eol | |
2561 (or (save-excursion | |
2562 (and (re-search-forward "[ \t]-n" (gnus-point-at-eol) t) | |
2563 (- (point) 2))) | |
2564 (gnus-point-at-eol))) | |
2565 ;; Search for all "words"... | |
2566 (while (re-search-forward "[^ \t,\n]+" eol t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2567 (if (eq (char-after (match-beginning 0)) ?!) |
17493 | 2568 ;; If the word begins with a bang (!), this is a "not" |
2569 ;; spec. We put this spec (minus the bang) and the | |
2570 ;; symbol `ignore' into the list. | |
2571 (push (cons (concat | |
2572 "^" (buffer-substring | |
2573 (1+ (match-beginning 0)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2574 (match-end 0)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2575 "\\($\\|\\.\\)") |
17493 | 2576 'ignore) |
2577 out) | |
2578 ;; There was no bang, so this is a "yes" spec. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2579 (push (cons (concat "^" (match-string 0) "\\($\\|\\.\\)") |
17493 | 2580 'subscribe) |
2581 out)))) | |
2582 | |
2583 (setq gnus-newsrc-options-n out)))) | |
2584 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2585 (eval-and-compile |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2586 (defalias 'gnus-long-file-names |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2587 (if (fboundp 'msdos-long-file-names) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2588 'msdos-long-file-names |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2589 (lambda () t)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2590 |
17493 | 2591 (defun gnus-save-newsrc-file (&optional force) |
2592 "Save .newsrc file." | |
2593 ;; Note: We cannot save .newsrc file if all newsgroups are removed | |
2594 ;; from the variable gnus-newsrc-alist. | |
2595 (when (and (or gnus-newsrc-alist gnus-killed-list) | |
2596 gnus-current-startup-file) | |
2597 (save-excursion | |
2598 (if (and (or gnus-use-dribble-file gnus-slave) | |
2599 (not force) | |
2600 (or (not gnus-dribble-buffer) | |
2601 (not (buffer-name gnus-dribble-buffer)) | |
2602 (zerop (save-excursion | |
2603 (set-buffer gnus-dribble-buffer) | |
2604 (buffer-size))))) | |
2605 (gnus-message 4 "(No changes need to be saved)") | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2606 (gnus-run-hooks 'gnus-save-newsrc-hook) |
17493 | 2607 (if gnus-slave |
2608 (gnus-slave-save-newsrc) | |
2609 ;; Save .newsrc. | |
2610 (when gnus-save-newsrc-file | |
2611 (gnus-message 8 "Saving %s..." gnus-current-startup-file) | |
2612 (gnus-gnus-to-newsrc-format) | |
2613 (gnus-message 8 "Saving %s...done" gnus-current-startup-file)) | |
2614 ;; Save .newsrc.eld. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2615 (set-buffer (gnus-get-buffer-create " *Gnus-newsrc*")) |
17493 | 2616 (make-local-variable 'version-control) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2617 (setq version-control gnus-backup-startup-file) |
17493 | 2618 (setq buffer-file-name |
2619 (concat gnus-current-startup-file ".eld")) | |
2620 (setq default-directory (file-name-directory buffer-file-name)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2621 (buffer-disable-undo) |
17493 | 2622 (erase-buffer) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2623 (gnus-message 5 "Saving %s.eld..." gnus-current-startup-file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2624 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2625 (if gnus-save-startup-file-via-temp-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2626 (let ((coding-system-for-write gnus-ding-file-coding-system) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2627 (standard-output (current-buffer))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2628 (gnus-gnus-to-quick-newsrc-format) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2629 (gnus-run-hooks 'gnus-save-quick-newsrc-hook) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2630 (save-buffer)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2631 (let ((coding-system-for-write gnus-ding-file-coding-system) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2632 (version-control gnus-backup-startup-file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2633 (startup-file (concat gnus-current-startup-file ".eld")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2634 (working-dir (file-name-directory gnus-current-startup-file)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2635 working-file |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2636 (i -1)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2637 ;; Generate the name of a non-existent file. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2638 (while (progn (setq working-file |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2639 (format |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2640 (if (and (eq system-type 'ms-dos) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2641 (not (gnus-long-file-names))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2642 "%s#%d.tm#" ; MSDOS limits files to 8+3 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2643 (if (memq system-type '(vax-vms axp-vms)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2644 "%s$tmp$%d" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2645 "%s#tmp#%d")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2646 working-dir (setq i (1+ i)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2647 (file-exists-p working-file))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2648 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2649 (unwind-protect |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2650 (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2651 (gnus-with-output-to-file working-file |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2652 (gnus-gnus-to-quick-newsrc-format) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2653 (gnus-run-hooks 'gnus-save-quick-newsrc-hook)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2654 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2655 ;; These bindings will mislead the current buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2656 ;; into thinking that it is visiting the startup |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2657 ;; file. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2658 (let ((buffer-backed-up nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2659 (buffer-file-name startup-file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2660 (file-precious-flag t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2661 (setmodes (file-modes startup-file))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2662 ;; Backup the current version of the startup file. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2663 (backup-buffer) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2664 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2665 ;; Replace the existing startup file with the temp file. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2666 (rename-file working-file startup-file t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2667 (set-file-modes startup-file setmodes))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2668 (condition-case nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2669 (delete-file working-file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2670 (file-error nil))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2671 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2672 (gnus-kill-buffer (current-buffer)) |
17493 | 2673 (gnus-message |
2674 5 "Saving %s.eld...done" gnus-current-startup-file)) | |
2675 (gnus-dribble-delete-file) | |
2676 (gnus-group-set-mode-line))))) | |
2677 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2678 (defun gnus-gnus-to-quick-newsrc-format (&optional minimal name &rest specific-variables) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2679 "Print Gnus variables such as `gnus-newsrc-alist' in Lisp format." |
89971
cce1c0ee76ee
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36
Miles Bader <miles@gnu.org>
diff
changeset
|
2680 (princ (format ";; -*- emacs-lisp; coding: %s;-*-\n" |
cce1c0ee76ee
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36
Miles Bader <miles@gnu.org>
diff
changeset
|
2681 gnus-ding-file-coding-system)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2682 (if name |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2683 (princ (format ";; %s\n" name)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2684 (princ ";; Gnus startup file.\n")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2685 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2686 (unless minimal |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2687 (princ "\ |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2688 ;; Never delete this file -- if you want to force Gnus to read the |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2689 ;; .newsrc file (if you have one), touch .newsrc instead.\n") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2690 (princ "(setq gnus-newsrc-file-version ") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2691 (princ (gnus-prin1-to-string gnus-version)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2692 (princ ")\n")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2693 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2694 (let* ((print-quoted t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2695 (print-readably t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2696 (print-escape-multibyte nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2697 (print-escape-nonascii t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2698 (print-length nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2699 (print-level nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2700 (print-escape-newlines t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2701 (gnus-killed-list |
17493 | 2702 (if (and gnus-save-killed-list |
2703 (stringp gnus-save-killed-list)) | |
2704 (gnus-strip-killed-list) | |
2705 gnus-killed-list)) | |
2706 (variables | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2707 (or specific-variables |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2708 (if gnus-save-killed-list gnus-variable-list |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2709 ;; Remove the `gnus-killed-list' from the list of variables |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2710 ;; to be saved, if required. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2711 (delq 'gnus-killed-list (copy-sequence gnus-variable-list))))) |
17493 | 2712 ;; Peel off the "dummy" group. |
2713 (gnus-newsrc-alist (cdr gnus-newsrc-alist)) | |
2714 variable) | |
2715 ;; Insert the variables into the file. | |
2716 (while variables | |
2717 (when (and (boundp (setq variable (pop variables))) | |
2718 (symbol-value variable)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2719 (princ "(setq ") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2720 (princ (symbol-name variable)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2721 (princ " '") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2722 (prin1 (symbol-value variable)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2723 (princ ")\n"))))) |
17493 | 2724 |
2725 (defun gnus-strip-killed-list () | |
2726 "Return the killed list minus the groups that match `gnus-save-killed-list'." | |
2727 (let ((list gnus-killed-list) | |
2728 olist) | |
2729 (while list | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2730 (when (string-match gnus-save-killed-list (car list)) |
17493 | 2731 (push (car list) olist)) |
2732 (pop list)) | |
2733 (nreverse olist))) | |
2734 | |
2735 (defun gnus-gnus-to-newsrc-format () | |
2736 ;; Generate and save the .newsrc file. | |
2737 (save-excursion | |
2738 (set-buffer (create-file-buffer gnus-current-startup-file)) | |
2739 (let ((newsrc (cdr gnus-newsrc-alist)) | |
2740 (standard-output (current-buffer)) | |
2741 info ranges range method) | |
2742 (setq buffer-file-name gnus-current-startup-file) | |
2743 (setq default-directory (file-name-directory buffer-file-name)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2744 (buffer-disable-undo) |
17493 | 2745 (erase-buffer) |
2746 ;; Write options. | |
2747 (when gnus-newsrc-options | |
2748 (insert gnus-newsrc-options)) | |
2749 ;; Write subscribed and unsubscribed. | |
2750 (while (setq info (pop newsrc)) | |
2751 ;; Don't write foreign groups to .newsrc. | |
2752 (when (or (null (setq method (gnus-info-method info))) | |
2753 (equal method "native") | |
2754 (inline (gnus-server-equal method gnus-select-method))) | |
2755 (insert (gnus-info-group info) | |
2756 (if (> (gnus-info-level info) gnus-level-subscribed) | |
2757 "!" ":")) | |
2758 (when (setq ranges (gnus-info-read info)) | |
2759 (insert " ") | |
2760 (if (not (listp (cdr ranges))) | |
2761 (if (= (car ranges) (cdr ranges)) | |
2762 (princ (car ranges)) | |
2763 (princ (car ranges)) | |
2764 (insert "-") | |
2765 (princ (cdr ranges))) | |
2766 (while (setq range (pop ranges)) | |
2767 (if (or (atom range) (= (car range) (cdr range))) | |
2768 (princ (or (and (atom range) range) (car range))) | |
2769 (princ (car range)) | |
2770 (insert "-") | |
2771 (princ (cdr range))) | |
2772 (when ranges | |
2773 (insert ","))))) | |
2774 (insert "\n"))) | |
2775 (make-local-variable 'version-control) | |
2776 (setq version-control 'never) | |
2777 ;; It has been reported that sometime the modtime on the .newsrc | |
2778 ;; file seems to be off. We really do want to overwrite it, so | |
2779 ;; we clear the modtime here before saving. It's a bit odd, | |
2780 ;; though... | |
2781 ;; sometimes the modtime clear isn't sufficient. most brute force: | |
2782 ;; delete the silly thing entirely first. but this fails to provide | |
2783 ;; such niceties as .newsrc~ creation. | |
2784 (if gnus-modtime-botch | |
2785 (delete-file gnus-startup-file) | |
2786 (clear-visited-file-modtime)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2787 (gnus-run-hooks 'gnus-save-standard-newsrc-hook) |
17493 | 2788 (save-buffer) |
2789 (kill-buffer (current-buffer))))) | |
2790 | |
2791 | |
2792 ;;; | |
2793 ;;; Slave functions. | |
2794 ;;; | |
2795 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2796 (defvar gnus-slave-mode nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2797 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2798 (defun gnus-slave-mode () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2799 "Minor mode for slave Gnusae." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2800 (gnus-add-minor-mode 'gnus-slave-mode " Slave" (make-sparse-keymap)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2801 (gnus-run-hooks 'gnus-slave-mode-hook)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2802 |
17493 | 2803 (defun gnus-slave-save-newsrc () |
2804 (save-excursion | |
2805 (set-buffer gnus-dribble-buffer) | |
2806 (let ((slave-name | |
44075
7782e54757bb
* mail-source.el (make-source-make-complex-temp-name): Use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
42628
diff
changeset
|
2807 (mm-make-temp-file (concat gnus-current-startup-file "-slave-"))) |
17493 | 2808 (modes (ignore-errors |
2809 (file-modes (concat gnus-current-startup-file ".eld"))))) | |
38627
6520def531cc
(gnus-startup-file-coding-system): Revert to binary.
Gerd Moellmann <gerd@gnu.org>
parents:
38612
diff
changeset
|
2810 (let ((coding-system-for-write gnus-ding-file-coding-system)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2811 (gnus-write-buffer slave-name)) |
17493 | 2812 (when modes |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2813 (set-file-modes slave-name modes))))) |
17493 | 2814 |
2815 (defun gnus-master-read-slave-newsrc () | |
2816 (let ((slave-files | |
2817 (directory-files | |
2818 (file-name-directory gnus-current-startup-file) | |
2819 t (concat | |
2820 "^" (regexp-quote | |
2821 (concat | |
2822 (file-name-nondirectory gnus-current-startup-file) | |
2823 "-slave-"))) | |
2824 t)) | |
2825 file) | |
2826 (if (not slave-files) | |
2827 () ; There are no slave files to read. | |
2828 (gnus-message 7 "Reading slave newsrcs...") | |
2829 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2830 (set-buffer (gnus-get-buffer-create " *gnus slave*")) |
17493 | 2831 (setq slave-files |
2832 (sort (mapcar (lambda (file) | |
2833 (list (nth 5 (file-attributes file)) file)) | |
2834 slave-files) | |
2835 (lambda (f1 f2) | |
2836 (or (< (caar f1) (caar f2)) | |
2837 (< (nth 1 (car f1)) (nth 1 (car f2))))))) | |
2838 (while slave-files | |
2839 (erase-buffer) | |
2840 (setq file (nth 1 (car slave-files))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2841 (nnheader-insert-file-contents file) |
17493 | 2842 (when (condition-case () |
2843 (progn | |
2844 (eval-buffer (current-buffer)) | |
2845 t) | |
2846 (error | |
2847 (gnus-error 3.2 "Possible error in %s" file) | |
2848 nil)) | |
2849 (unless gnus-slave ; Slaves shouldn't delete these files. | |
2850 (ignore-errors | |
2851 (delete-file file)))) | |
2852 (setq slave-files (cdr slave-files)))) | |
2853 (gnus-dribble-touch) | |
2854 (gnus-message 7 "Reading slave newsrcs...done")))) | |
2855 | |
2856 | |
2857 ;;; | |
2858 ;;; Group description. | |
2859 ;;; | |
2860 | |
2861 (defun gnus-read-all-descriptions-files () | |
2862 (let ((methods (cons gnus-select-method | |
2863 (nconc | |
2864 (when (gnus-archive-server-wanted-p) | |
2865 (list "archive")) | |
2866 gnus-secondary-select-methods)))) | |
2867 (while methods | |
2868 (gnus-read-descriptions-file (car methods)) | |
2869 (setq methods (cdr methods))) | |
2870 t)) | |
2871 | |
2872 (defun gnus-read-descriptions-file (&optional method) | |
2873 (let ((method (or method gnus-select-method)) | |
2874 group) | |
2875 (when (stringp method) | |
2876 (setq method (gnus-server-to-method method))) | |
2877 ;; We create the hashtable whether we manage to read the desc file | |
2878 ;; to avoid trying to re-read after a failed read. | |
2879 (unless gnus-description-hashtb | |
2880 (setq gnus-description-hashtb | |
2881 (gnus-make-hashtable (length gnus-active-hashtb)))) | |
2882 ;; Mark this method's desc file as read. | |
2883 (gnus-sethash (gnus-group-prefixed-name "" method) "Has read" | |
2884 gnus-description-hashtb) | |
2885 | |
2886 (gnus-message 5 "Reading descriptions file via %s..." (car method)) | |
2887 (cond | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2888 ((null (gnus-get-function method 'request-list-newsgroups t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2889 t) |
17493 | 2890 ((not (gnus-check-server method)) |
2891 (gnus-message 1 "Couldn't open server") | |
2892 nil) | |
2893 ((not (gnus-request-list-newsgroups method)) | |
2894 (gnus-message 1 "Couldn't read newsgroups descriptions") | |
2895 nil) | |
2896 (t | |
2897 (save-excursion | |
2898 (save-restriction | |
2899 (set-buffer nntp-server-buffer) | |
2900 (goto-char (point-min)) | |
2901 (when (or (search-forward "\n.\n" nil t) | |
2902 (goto-char (point-max))) | |
2903 (beginning-of-line) | |
2904 (narrow-to-region (point-min) (point))) | |
2905 ;; If these are groups from a foreign select method, we insert the | |
2906 ;; group prefix in front of the group names. | |
2907 (and method (not (inline | |
2908 (gnus-server-equal | |
2909 (gnus-server-get-method nil method) | |
2910 (gnus-server-get-method | |
2911 nil gnus-select-method)))) | |
2912 (let ((prefix (gnus-group-prefixed-name "" method))) | |
2913 (goto-char (point-min)) | |
2914 (while (and (not (eobp)) | |
2915 (progn (insert prefix) | |
2916 (zerop (forward-line 1))))))) | |
2917 (goto-char (point-min)) | |
2918 (while (not (eobp)) | |
2919 ;; If we get an error, we set group to 0, which is not a | |
2920 ;; symbol... | |
2921 (setq group | |
2922 (condition-case () | |
2923 (let ((obarray gnus-description-hashtb)) | |
2924 ;; Group is set to a symbol interned in this | |
2925 ;; hash table. | |
2926 (read nntp-server-buffer)) | |
2927 (error 0))) | |
2928 (skip-chars-forward " \t") | |
2929 ;; ... which leads to this line being effectively ignored. | |
2930 (when (symbolp group) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2931 (let* ((str (buffer-substring |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2932 (point) (progn (end-of-line) (point)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2933 (name (symbol-name group)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2934 (charset |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2935 (or (gnus-group-name-charset method name) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2936 (gnus-parameter-charset name) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2937 gnus-default-charset))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2938 ;; Fixme: Don't decode in unibyte mode. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2939 (when (and str charset (featurep 'mule)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2940 (setq str (mm-decode-coding-string str charset))) |
20235
518f3a9e5812
(gnus-read-descriptions-file): Decode
Kenichi Handa <handa@m17n.org>
parents:
19969
diff
changeset
|
2941 (set group str))) |
17493 | 2942 (forward-line 1)))) |
2943 (gnus-message 5 "Reading descriptions file...done") | |
2944 t)))) | |
2945 | |
2946 (defun gnus-group-get-description (group) | |
2947 "Get the description of a group by sending XGTITLE to the server." | |
2948 (when (gnus-request-group-description group) | |
2949 (save-excursion | |
2950 (set-buffer nntp-server-buffer) | |
2951 (goto-char (point-min)) | |
2952 (when (looking-at "[^ \t]+[ \t]+\\(.*\\)") | |
2953 (match-string 1))))) | |
2954 | |
2955 ;;;###autoload | |
2956 (defun gnus-declare-backend (name &rest abilities) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2957 "Declare back end NAME with ABILITIES as a Gnus back end." |
17493 | 2958 (setq gnus-valid-select-methods |
2959 (nconc gnus-valid-select-methods | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2960 (list (apply 'list name abilities)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2961 (gnus-redefine-select-method-widget)) |
17493 | 2962 |
2963 (defun gnus-set-default-directory () | |
2964 "Set the default directory in the current buffer to `gnus-default-directory'. | |
2965 If this variable is nil, don't do anything." | |
2966 (setq default-directory | |
2967 (if (and gnus-default-directory | |
2968 (file-exists-p gnus-default-directory)) | |
2969 (file-name-as-directory (expand-file-name gnus-default-directory)) | |
2970 default-directory))) | |
2971 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2972 (eval-and-compile |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2973 (defalias 'gnus-display-time-event-handler |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2974 (if (gnus-boundp 'display-time-timer) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2975 'display-time-event-handler |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2976 (lambda () "Does nothing as `display-time-timer' is not bound. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2977 Would otherwise be an alias for `display-time-event-handler'." nil)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2978 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2979 ;;;###autoload |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2980 (defun gnus-fixup-nnimap-unread-after-getting-new-news () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2981 (let (server group info) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2982 (mapatoms |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2983 (lambda (sym) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2984 (when (and (setq group (symbol-name sym)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2985 (gnus-group-entry group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2986 (setq info (symbol-value sym))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2987 (gnus-sethash group (cons (nth 2 info) (cdr (gnus-group-entry group))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2988 gnus-newsrc-hashtb))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2989 (if (boundp 'nnimap-mailbox-info) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2990 (symbol-value 'nnimap-mailbox-info) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2991 (make-vector 1 0))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2992 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2993 |
17493 | 2994 (provide 'gnus-start) |
2995 | |
52401 | 2996 ;;; arch-tag: f4584a22-b7b7-4853-abfc-a637329af5d2 |
17493 | 2997 ;;; gnus-start.el ends here |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2998 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2999 |