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