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