Mercurial > emacs
annotate lisp/gnus/gnus-start.el @ 74478:a4a6a88fed98
(url-retrieve-internal): Bind url-proxy-object to nil.
author | Magnus Henoch <mange@freemail.hu> |
---|---|
date | Fri, 08 Dec 2006 00:39:01 +0000 |
parents | 1bf9e5a9c07a |
children | e3694f1cb928 f1d13e615070 |
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, |
68230
6c7c654eb3c7
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents:
68129
diff
changeset
|
4 ;; 2005, 2006 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 | |
74149
1bf9e5a9c07a
(gnus-options-subscribe, gnus-options-not-subscribe, gnus-subscribe-newsgroup,
Juanma Barranquero <lekktu@gmail.com>
parents:
71884
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17493 | 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 | |
71884 | 316 Gnus will then subscribe all new newsgroups in these hierarchies |
317 with the subscription method in this variable." | |
17493 | 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. | |
74149
1bf9e5a9c07a
(gnus-options-subscribe, gnus-options-not-subscribe, gnus-subscribe-newsgroup,
Juanma Barranquero <lekktu@gmail.com>
parents:
71884
diff
changeset
|
355 Note that this variable deals only with new newsgroups. This variable |
17493 | 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. | |
74149
1bf9e5a9c07a
(gnus-options-subscribe, gnus-options-not-subscribe, gnus-subscribe-newsgroup,
Juanma Barranquero <lekktu@gmail.com>
parents:
71884
diff
changeset
|
367 Note that this variable deals only with new newsgroups. This variable |
17493 | 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. | |
74149
1bf9e5a9c07a
(gnus-options-subscribe, gnus-options-not-subscribe, gnus-subscribe-newsgroup,
Juanma Barranquero <lekktu@gmail.com>
parents:
71884
diff
changeset
|
623 If NEXT is non-nil, it is inserted before NEXT. Otherwise it is made |
17493 | 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. | |
67643
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
720 If ARG is a positive number, Gnus will use that as the startup |
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
721 level. If ARG is nil, Gnus will be started at level 2 |
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
722 \(`gnus-level-default-subscribed' minus one). If ARG is non-nil |
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
723 and not a positive number, Gnus will prompt the user for the name |
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
724 of an NNTP server to use. As opposed to \\[gnus], this command |
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
725 will not connect to the local server." |
17493 | 726 (interactive "P") |
727 (let ((val (or arg (1- gnus-level-default-subscribed)))) | |
728 (gnus val t slave) | |
729 (make-local-variable 'gnus-group-use-permanent-levels) | |
730 (setq gnus-group-use-permanent-levels val))) | |
731 | |
732 (defun gnus-1 (&optional arg dont-connect slave) | |
733 "Read network news. | |
734 If ARG is non-nil and a positive number, Gnus will use that as the | |
74149
1bf9e5a9c07a
(gnus-options-subscribe, gnus-options-not-subscribe, gnus-subscribe-newsgroup,
Juanma Barranquero <lekktu@gmail.com>
parents:
71884
diff
changeset
|
735 startup level. If ARG is non-nil and not a positive number, Gnus will |
17493 | 736 prompt the user for the name of an NNTP server to use." |
737 (interactive "P") | |
738 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
739 (if (gnus-alive-p) |
17493 | 740 (progn |
741 (switch-to-buffer gnus-group-buffer) | |
742 (gnus-group-get-new-news | |
743 (and (numberp arg) | |
744 (> arg 0) | |
745 (max (car gnus-group-list-mode) arg)))) | |
746 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
747 (gnus-clear-system) |
17493 | 748 (gnus-splash) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
749 (gnus-run-hooks 'gnus-before-startup-hook) |
17493 | 750 (nnheader-init-server-buffer) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
751 (setq gnus-slave slave) |
17493 | 752 (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
|
753 (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
|
754 (gnus-agentize)) |
17493 | 755 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
756 (when gnus-simple-splash |
17493 | 757 (setq gnus-simple-splash nil) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
758 (cond |
32939
c8119677d63e
Use (featurep 'xemacs) instead of the `gnus-xemacs' variable, as the
Miles Bader <miles@gnu.org>
parents:
31783
diff
changeset
|
759 ((featurep 'xemacs) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
760 (gnus-xmas-splash)) |
31783
65104da03c90
(gnus-1) <gnus-simple-splash>: Don't test for X
Dave Love <fx@gnu.org>
parents:
31716
diff
changeset
|
761 ((and window-system |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
762 (= (frame-height) (1+ (window-height)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
763 (gnus-x-splash)))) |
17493 | 764 |
765 (let ((level (and (numberp arg) (> arg 0) arg)) | |
766 did-connect) | |
767 (unwind-protect | |
768 (progn | |
769 (unless dont-connect | |
770 (setq did-connect | |
771 (gnus-start-news-server (and arg (not level)))))) | |
772 (if (and (not dont-connect) | |
773 (not did-connect)) | |
774 (gnus-group-quit) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
775 (gnus-run-hooks 'gnus-startup-hook) |
17493 | 776 ;; NNTP server is successfully open. |
777 | |
778 ;; Find the current startup file name. | |
779 (setq gnus-current-startup-file | |
780 (gnus-make-newsrc-file gnus-startup-file)) | |
781 | |
782 ;; Read the dribble file. | |
783 (when (or gnus-slave gnus-use-dribble-file) | |
784 (gnus-dribble-read-file)) | |
785 | |
786 ;; Allow using GroupLens predictions. | |
787 (when gnus-use-grouplens | |
788 (bbb-login) | |
789 (add-hook 'gnus-summary-mode-hook 'gnus-grouplens-mode)) | |
790 | |
791 ;; 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
|
792 (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
|
793 (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
|
794 (gnus-request-create-group "drafts" '(nndraft "")) |
17493 | 795 (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
|
796 (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
|
797 (gnus-start-draft-setup) |
17493 | 798 ;; Generate the group buffer. |
799 (gnus-group-list-groups level) | |
800 (gnus-group-first-unread-group) | |
801 (gnus-configure-windows 'group) | |
802 (gnus-group-set-mode-line) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
803 (gnus-run-hooks 'gnus-started-hook)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
804 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
805 (defun gnus-start-draft-setup () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
806 "Make sure the draft group exists." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
807 (gnus-request-create-group "drafts" '(nndraft "")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
808 (unless (gnus-gethash "nndraft:drafts" gnus-newsrc-hashtb) |
67643
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
809 (gnus-message 3 "Subscribing drafts group") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
810 (let ((gnus-level-default-subscribed 1)) |
67643
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
811 (gnus-subscribe-group "nndraft:drafts" nil '(nndraft "")))) |
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
812 (unless (equal (gnus-group-get-parameter "nndraft:drafts" 'gnus-dummy t) |
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
813 '((gnus-draft-mode))) |
1c477099d3ac
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-676
Miles Bader <miles@gnu.org>
parents:
67418
diff
changeset
|
814 (gnus-message 3 "Setting up drafts group") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
815 (gnus-group-set-parameter |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
816 "nndraft:drafts" 'gnus-dummy '((gnus-draft-mode))))) |
17493 | 817 |
818 | |
819 ;;; | |
820 ;;; Dribble file | |
821 ;;; | |
822 | |
823 (defvar gnus-dribble-ignore nil) | |
824 (defvar gnus-dribble-eval-file nil) | |
825 | |
826 (defun gnus-dribble-file-name () | |
827 "Return the dribble file for the current .newsrc." | |
828 (concat | |
829 (if gnus-dribble-directory | |
830 (concat (file-name-as-directory gnus-dribble-directory) | |
831 (file-name-nondirectory gnus-current-startup-file)) | |
832 gnus-current-startup-file) | |
833 "-dribble")) | |
834 | |
835 (defun gnus-dribble-enter (string) | |
836 "Enter STRING into the dribble buffer." | |
837 (when (and (not gnus-dribble-ignore) | |
838 gnus-dribble-buffer | |
839 (buffer-name gnus-dribble-buffer)) | |
840 (let ((obuf (current-buffer))) | |
841 (set-buffer gnus-dribble-buffer) | |
842 (goto-char (point-max)) | |
843 (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
|
844 ;; 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
|
845 ;; 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
|
846 ;; 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
|
847 ;; 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
|
848 ;; (set-window-point (get-buffer-window (current-buffer)) (point-max)) |
17493 | 849 (bury-buffer gnus-dribble-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
850 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
851 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
852 (gnus-group-set-mode-line)) |
17493 | 853 (set-buffer obuf)))) |
854 | |
855 (defun gnus-dribble-touch () | |
856 "Touch the dribble buffer." | |
857 (gnus-dribble-enter "")) | |
858 | |
859 (defun gnus-dribble-read-file () | |
860 "Read the dribble file from disk." | |
861 (let ((dribble-file (gnus-dribble-file-name))) | |
862 (save-excursion | |
863 (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
|
864 (gnus-get-buffer-create |
17493 | 865 (file-name-nondirectory dribble-file)))) |
67418
28264c86d408
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents:
65688
diff
changeset
|
866 (set (make-local-variable 'file-precious-flag) t) |
17493 | 867 (erase-buffer) |
868 (setq buffer-file-name dribble-file) | |
869 (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
|
870 (buffer-disable-undo) |
17493 | 871 (bury-buffer (current-buffer)) |
872 (set-buffer-modified-p nil) | |
873 (let ((auto (make-auto-save-file-name)) | |
874 (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
|
875 (purpose nil) |
17493 | 876 modes) |
877 (when (or (file-exists-p auto) (file-exists-p dribble-file)) | |
878 ;; Load whichever file is newest -- the auto save file | |
879 ;; or the "real" file. | |
880 (if (file-newer-than-file-p auto dribble-file) | |
881 (nnheader-insert-file-contents auto) | |
882 (nnheader-insert-file-contents dribble-file)) | |
883 (unless (zerop (buffer-size)) | |
884 (set-buffer-modified-p t)) | |
885 ;; Set the file modes to reflect the .newsrc file modes. | |
886 (save-buffer) | |
887 (when (and (file-exists-p gnus-current-startup-file) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
888 (file-exists-p dribble-file) |
17493 | 889 (setq modes (file-modes gnus-current-startup-file))) |
890 (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
|
891 (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
|
892 (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
|
893 (setq purpose t)) |
17493 | 894 ;; Possibly eval the file later. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
895 (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
|
896 (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
|
897 (if purpose |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
898 "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
|
899 "Gnus auto-save file exists. Do you want to read it? "))) |
17493 | 900 (setq gnus-dribble-eval-file t))))))) |
901 | |
902 (defun gnus-dribble-eval-file () | |
903 (when gnus-dribble-eval-file | |
904 (setq gnus-dribble-eval-file nil) | |
905 (save-excursion | |
906 (let ((gnus-dribble-ignore t)) | |
907 (set-buffer gnus-dribble-buffer) | |
908 (eval-buffer (current-buffer)))))) | |
909 | |
910 (defun gnus-dribble-delete-file () | |
911 (when (file-exists-p (gnus-dribble-file-name)) | |
912 (delete-file (gnus-dribble-file-name))) | |
913 (when gnus-dribble-buffer | |
914 (save-excursion | |
915 (set-buffer gnus-dribble-buffer) | |
916 (let ((auto (make-auto-save-file-name))) | |
917 (when (file-exists-p auto) | |
918 (delete-file auto)) | |
919 (erase-buffer) | |
920 (set-buffer-modified-p nil))))) | |
921 | |
922 (defun gnus-dribble-save () | |
923 (when (and gnus-dribble-buffer | |
924 (buffer-name gnus-dribble-buffer)) | |
925 (save-excursion | |
926 (set-buffer gnus-dribble-buffer) | |
927 (save-buffer)))) | |
928 | |
929 (defun gnus-dribble-clear () | |
930 (when (gnus-buffer-exists-p gnus-dribble-buffer) | |
931 (save-excursion | |
932 (set-buffer gnus-dribble-buffer) | |
933 (erase-buffer) | |
934 (set-buffer-modified-p nil) | |
935 (setq buffer-saved-size (buffer-size))))) | |
936 | |
937 | |
938 ;;; | |
939 ;;; Active & Newsrc File Handling | |
940 ;;; | |
941 | |
942 (defun gnus-setup-news (&optional rawfile level dont-connect) | |
943 "Setup news information. | |
944 If RAWFILE is non-nil, the .newsrc file will also be read. | |
945 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
|
946 (require 'nnmail) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
947 (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
|
948 ;; 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
|
949 ;; 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
|
950 (nnmail-fetched-sources (list t))) |
17493 | 951 |
952 (when init | |
953 ;; Clear some variables to re-initialize news information. | |
954 (setq gnus-newsrc-alist nil | |
955 gnus-active-hashtb nil) | |
956 ;; Read the newsrc file and create `gnus-newsrc-hashtb'. | |
957 (gnus-read-newsrc-file rawfile)) | |
958 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
959 ;; 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
|
960 (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
|
961 (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
|
962 (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
|
963 (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
|
964 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
|
965 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
|
966 ;; 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
|
967 (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
|
968 (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
|
969 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
|
970 (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
|
971 (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
|
972 `("archive" |
ec047d4f2cfc
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
973 nnfolder |
ec047d4f2cfc
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
974 ,method |
ec047d4f2cfc
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
975 (nnfolder-directory |
ec047d4f2cfc
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
976 ,(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
|
977 (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
|
978 ,(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
|
979 (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
|
980 (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
|
981 (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
|
982 (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
|
983 gnus-server-alist)))) |
17493 | 984 |
985 ;; If we don't read the complete active file, we fill in the | |
986 ;; hashtb here. | |
987 (when (or (null gnus-read-active-file) | |
988 (eq gnus-read-active-file 'some)) | |
989 (gnus-update-active-hashtb-from-killed)) | |
990 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
991 ;; 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
|
992 ;; been initialized. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
993 ;; 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
|
994 ;; 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
|
995 ;; 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
|
996 ;; 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
|
997 (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
|
998 (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
|
999 |
17493 | 1000 ;; Read the active file and create `gnus-active-hashtb'. |
1001 ;; If `gnus-read-active-file' is nil, then we just create an empty | |
1002 ;; hash table. The partial filling out of the hash table will be | |
1003 ;; done in `gnus-get-unread-articles'. | |
1004 (and gnus-read-active-file | |
1005 (not level) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1006 (gnus-read-active-file nil dont-connect)) |
17493 | 1007 |
1008 (unless gnus-active-hashtb | |
1009 (setq gnus-active-hashtb (gnus-make-hashtable 4096))) | |
1010 | |
1011 ;; Initialize the cache. | |
1012 (when gnus-use-cache | |
1013 (gnus-cache-open)) | |
1014 | |
1015 ;; Possibly eval the dribble file. | |
1016 (and init | |
1017 (or gnus-use-dribble-file gnus-slave) | |
1018 (gnus-dribble-eval-file)) | |
1019 | |
1020 ;; Slave Gnusii should then clear the dribble buffer. | |
1021 (when (and init gnus-slave) | |
1022 (gnus-dribble-clear)) | |
1023 | |
1024 (gnus-update-format-specifications) | |
1025 | |
1026 ;; See whether we need to read the description file. | |
1027 (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
|
1028 (stringp gnus-group-line-format) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1029 (let ((case-fold-search nil)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1030 (string-match "%[-,0-9]*D" gnus-group-line-format)) |
17493 | 1031 (not gnus-description-hashtb) |
1032 (not dont-connect) | |
1033 gnus-read-active-file) | |
1034 (gnus-read-all-descriptions-files)) | |
1035 | |
1036 ;; Find new newsgroups and treat them. | |
1037 (when (and init gnus-check-new-newsgroups (not level) | |
1038 (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
|
1039 (not gnus-slave) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1040 gnus-plugged) |
17493 | 1041 (gnus-find-new-newsgroups)) |
1042 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1043 ;; 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
|
1044 (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
|
1045 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
|
1046 (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
|
1047 (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
|
1048 |
17493 | 1049 ;; We might read in new NoCeM messages here. |
69362
29fe34ec2296
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-147
Miles Bader <miles@gnu.org>
parents:
68230
diff
changeset
|
1050 (when (and (not dont-connect) |
29fe34ec2296
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-147
Miles Bader <miles@gnu.org>
parents:
68230
diff
changeset
|
1051 gnus-use-nocem |
29fe34ec2296
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-147
Miles Bader <miles@gnu.org>
parents:
68230
diff
changeset
|
1052 (or (and (numberp gnus-use-nocem) |
29fe34ec2296
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-147
Miles Bader <miles@gnu.org>
parents:
68230
diff
changeset
|
1053 (numberp level) |
29fe34ec2296
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-147
Miles Bader <miles@gnu.org>
parents:
68230
diff
changeset
|
1054 (>= level gnus-use-nocem)) |
29fe34ec2296
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-147
Miles Bader <miles@gnu.org>
parents:
68230
diff
changeset
|
1055 (not level))) |
17493 | 1056 (gnus-nocem-scan-groups)) |
1057 | |
1058 ;; Read any slave files. | |
1059 (gnus-master-read-slave-newsrc) | |
1060 | |
1061 ;; Find the number of unread articles in each non-dead group. | |
1062 (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
|
1063 (gnus-get-unread-articles level)))) |
17493 | 1064 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1065 (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
|
1066 "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
|
1067 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
|
1068 (unless (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1069 ((functionp method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1070 (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
|
1071 ((listp method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1072 (catch 'found |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1073 (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
|
1074 (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
|
1075 (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
|
1076 nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1077 (t nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1078 (gnus-subscribe-zombies group))) |
17493 | 1079 |
1080 (defun gnus-find-new-newsgroups (&optional arg) | |
1081 "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
|
1082 Each new newsgroup will be treated with `gnus-subscribe-newsgroup-method'. |
17493 | 1083 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
|
1084 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1085 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
|
1086 groups. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1087 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
|
1088 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
|
1089 (interactive "p") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1090 (let* ((gnus-subscribe-newsgroup-method |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1091 gnus-subscribe-newsgroup-method) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1092 (check (cond |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1093 ((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
|
1094 (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
|
1095 (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
|
1096 (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
|
1097 'ask-server) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1098 ((= (or arg 1) 16) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1099 (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
|
1100 'gnus-subscribe-zombies) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1101 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1102 (t gnus-check-new-newsgroups)))) |
17493 | 1103 (unless (gnus-check-first-time-used) |
1104 (if (or (consp check) | |
1105 (eq check 'ask-server)) | |
1106 ;; Ask the server for new groups. | |
1107 (gnus-ask-server-for-new-groups) | |
1108 ;; Go through the active hashtb and look for new groups. | |
1109 (let ((groups 0) | |
1110 group new-newsgroups) | |
1111 (gnus-message 5 "Looking for new newsgroups...") | |
1112 (unless gnus-have-read-active-file | |
1113 (gnus-read-active-file)) | |
38526
98b3bb015deb
(gnus-find-new-newsgroups): Use
Gerd Moellmann <gerd@gnu.org>
parents:
33396
diff
changeset
|
1114 (setq gnus-newsrc-last-checked-date (message-make-date)) |
17493 | 1115 (unless gnus-killed-hashtb |
1116 (gnus-make-hashtable-from-killed)) | |
1117 ;; Go though every newsgroup in `gnus-active-hashtb' and compare | |
1118 ;; with `gnus-newsrc-hashtb' and `gnus-killed-hashtb'. | |
1119 (mapatoms | |
1120 (lambda (sym) | |
1121 (if (or (null (setq group (symbol-name sym))) | |
1122 (not (boundp sym)) | |
1123 (null (symbol-value sym)) | |
1124 (gnus-gethash group gnus-killed-hashtb) | |
1125 (gnus-gethash group gnus-newsrc-hashtb)) | |
1126 () | |
1127 (let ((do-sub (gnus-matches-options-n group))) | |
1128 (cond | |
1129 ((eq do-sub 'subscribe) | |
1130 (setq groups (1+ groups)) | |
1131 (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
|
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-options-newsgroup-method group)) |
17493 | 1134 ((eq do-sub 'ignore) |
1135 nil) | |
1136 (t | |
1137 (setq groups (1+ groups)) | |
1138 (gnus-sethash group group gnus-killed-hashtb) | |
1139 (if gnus-subscribe-hierarchical-interactive | |
1140 (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
|
1141 (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
|
1142 gnus-subscribe-newsgroup-method group))))))) |
17493 | 1143 gnus-active-hashtb) |
1144 (when new-newsgroups | |
1145 (gnus-subscribe-hierarchical-interactive new-newsgroups)) | |
1146 (if (> groups 0) | |
1147 (gnus-message 5 "%d new newsgroup%s arrived." | |
1148 groups (if (> groups 1) "s have" " has")) | |
1149 (gnus-message 5 "No new newsgroups."))))))) | |
1150 | |
1151 (defun gnus-matches-options-n (group) | |
1152 ;; Returns `subscribe' if the group is to be unconditionally | |
1153 ;; subscribed, `ignore' if it is to be ignored, and nil if there is | |
1154 ;; no match for the group. | |
1155 | |
1156 ;; First we check the two user variables. | |
1157 (cond | |
1158 ((and gnus-options-subscribe | |
1159 (string-match gnus-options-subscribe group)) | |
1160 'subscribe) | |
1161 ((and gnus-auto-subscribed-groups | |
1162 (string-match gnus-auto-subscribed-groups group)) | |
1163 'subscribe) | |
1164 ((and gnus-options-not-subscribe | |
1165 (string-match gnus-options-not-subscribe group)) | |
1166 'ignore) | |
1167 ;; Then we go through the list that was retrieved from the .newsrc | |
1168 ;; file. This list has elements on the form | |
1169 ;; `(REGEXP . {ignore,subscribe})'. The first match found (the list | |
1170 ;; is in the reverse order of the options line) is returned. | |
1171 (t | |
1172 (let ((regs gnus-newsrc-options-n)) | |
1173 (while (and regs | |
1174 (not (string-match (caar regs) group))) | |
1175 (setq regs (cdr regs))) | |
1176 (and regs (cdar regs)))))) | |
1177 | |
1178 (defun gnus-ask-server-for-new-groups () | |
38526
98b3bb015deb
(gnus-find-new-newsgroups): Use
Gerd Moellmann <gerd@gnu.org>
parents:
33396
diff
changeset
|
1179 (let* ((new-date (message-make-date)) |
98b3bb015deb
(gnus-find-new-newsgroups): Use
Gerd Moellmann <gerd@gnu.org>
parents:
33396
diff
changeset
|
1180 (date (or gnus-newsrc-last-checked-date new-date)) |
17493 | 1181 (methods (cons gnus-select-method |
1182 (nconc | |
1183 (when (gnus-archive-server-wanted-p) | |
1184 (list "archive")) | |
1185 (append | |
1186 (and (consp gnus-check-new-newsgroups) | |
1187 gnus-check-new-newsgroups) | |
1188 gnus-secondary-select-methods)))) | |
1189 (groups 0) | |
1190 group new-newsgroups got-new method hashtb | |
1191 gnus-override-subscribe-method) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1192 (unless gnus-killed-hashtb |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1193 (gnus-make-hashtable-from-killed)) |
17493 | 1194 ;; Go through both primary and secondary select methods and |
1195 ;; request new newsgroups. | |
1196 (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
|
1197 (setq new-newsgroups nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1198 gnus-override-subscribe-method method) |
17493 | 1199 (when (and (gnus-check-server method) |
1200 (gnus-request-newgroups date method)) | |
1201 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1202 (setq got-new t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
1203 hashtb (gnus-make-hashtable 100)) |
17493 | 1204 (set-buffer nntp-server-buffer) |
1205 ;; Enter all the new groups into a hashtable. | |
1206 (gnus-active-to-gnus-format method hashtb 'ignore)) | |
1207 ;; Now all new groups from `method' are in `hashtb'. | |
1208 (mapatoms | |
1209 (lambda (group-sym) | |
1210 (if (or (null (setq group (symbol-name group-sym))) | |
1211 (not (boundp group-sym)) | |
1212 (null (symbol-value group-sym)) | |
1213 (gnus-gethash group gnus-newsrc-hashtb) | |
1214 (member group gnus-zombie-list) | |
1215 (member group gnus-killed-list)) | |
1216 ;; The group is already known. | |
1217 () | |
1218 ;; Make this group active. | |
1219 (when (symbol-value group-sym) | |
1220 (gnus-set-active group (symbol-value group-sym))) | |
1221 ;; Check whether we want it or not. | |
1222 (let ((do-sub (gnus-matches-options-n group))) | |
1223 (cond | |
1224 ((eq do-sub 'subscribe) | |
1225 (incf groups) | |
1226 (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
|
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-options-newsgroup-method group)) |
17493 | 1229 ((eq do-sub 'ignore) |
1230 nil) | |
1231 (t | |
1232 (incf groups) | |
1233 (gnus-sethash group group gnus-killed-hashtb) | |
1234 (if gnus-subscribe-hierarchical-interactive | |
1235 (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
|
1236 (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
|
1237 gnus-subscribe-newsgroup-method group))))))) |
17493 | 1238 hashtb)) |
1239 (when new-newsgroups | |
1240 (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
|
1241 (if (> groups 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1242 (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
|
1243 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
|
1244 (gnus-message 5 "No new newsgroups")) |
17493 | 1245 (when got-new |
1246 (setq gnus-newsrc-last-checked-date new-date)) | |
1247 got-new)) | |
1248 | |
1249 (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
|
1250 (catch 'ended |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1251 ;; 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
|
1252 ;; 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
|
1253 (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
|
1254 (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
|
1255 (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
|
1256 (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
|
1257 (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
|
1258 (throw 'ended nil))) |
17493 | 1259 (gnus-message 6 "First time user; subscribing you to default groups") |
1260 (unless (gnus-read-active-file-p) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1261 (let ((gnus-read-active-file t)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1262 (gnus-read-active-file))) |
38526
98b3bb015deb
(gnus-find-new-newsgroups): Use
Gerd Moellmann <gerd@gnu.org>
parents:
33396
diff
changeset
|
1263 (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
|
1264 ;; 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
|
1265 (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
|
1266 gnus-backup-default-subscribed-newsgroups)) |
17493 | 1267 group) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1268 (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
|
1269 ;; 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
|
1270 (mapatoms |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1271 (lambda (sym) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1272 (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
|
1273 (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
|
1274 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1275 ((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
|
1276 (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
|
1277 (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
|
1278 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
|
1279 ((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
|
1280 nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1281 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1282 (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
|
1283 gnus-active-hashtb) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1284 (dolist (group groups) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1285 ;; 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
|
1286 (when (gnus-active group) |
17493 | 1287 (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
|
1288 group gnus-level-default-subscribed gnus-level-killed))) |
23103 | 1289 (save-excursion |
1290 (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
|
1291 ;; 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
|
1292 ;; 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
|
1293 (gnus-group-make-help-group t)) |
17493 | 1294 (when gnus-novice-user |
1295 (gnus-message 7 "`A k' to list killed groups")))))) | |
1296 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1297 (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
|
1298 "Subscribe GROUP and put it after PREVIOUS." |
17493 | 1299 (gnus-group-change-level |
1300 (if method | |
1301 (list t group gnus-level-default-subscribed nil nil method) | |
1302 group) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1303 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
|
1304 t) |
17493 | 1305 |
1306 ;; `gnus-group-change-level' is the fundamental function for changing | |
1307 ;; subscription levels of newsgroups. This might mean just changing | |
1308 ;; from level 1 to 2, which is pretty trivial, from 2 to 6 or back | |
1309 ;; again, which subscribes/unsubscribes a group, which is equally | |
1310 ;; trivial. Changing from 1-7 to 8-9 means that you kill a group, and | |
1311 ;; from 8-9 to 1-7 means that you remove the group from the list of | |
1312 ;; killed (or zombie) groups and add them to the (kinda) subscribed | |
1313 ;; groups. And last but not least, moving from 8 to 9 and 9 to 8, | |
1314 ;; which is trivial. | |
1315 ;; ENTRY can either be a string (newsgroup name) or a list (if | |
1316 ;; FROMKILLED is t, it's a list on the format (NUM INFO-LIST), | |
1317 ;; otherwise it's a list in the format of the `gnus-newsrc-hashtb' | |
1318 ;; entries. | |
1319 ;; LEVEL is the new level of the group, OLDLEVEL is the old level and | |
1320 ;; PREVIOUS is the group (in hashtb entry format) to insert this group | |
1321 ;; after. | |
1322 (defun gnus-group-change-level (entry level &optional oldlevel | |
1323 previous fromkilled) | |
1324 (let (group info active num) | |
1325 ;; Glean what info we can from the arguments | |
1326 (if (consp entry) | |
1327 (if fromkilled (setq group (nth 1 entry)) | |
1328 (setq group (car (nth 2 entry)))) | |
1329 (setq group entry)) | |
1330 (when (and (stringp entry) | |
1331 oldlevel | |
1332 (< oldlevel gnus-level-zombie)) | |
1333 (setq entry (gnus-gethash entry gnus-newsrc-hashtb))) | |
1334 (if (and (not oldlevel) | |
1335 (consp entry)) | |
1336 (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
|
1337 (setq oldlevel (or oldlevel gnus-level-killed))) |
17493 | 1338 (when (stringp previous) |
1339 (setq previous (gnus-gethash previous gnus-newsrc-hashtb))) | |
1340 | |
1341 (if (and (>= oldlevel gnus-level-zombie) | |
1342 (gnus-gethash group gnus-newsrc-hashtb)) | |
1343 ;; We are trying to subscribe a group that is already | |
1344 ;; subscribed. | |
1345 () ; Do nothing. | |
1346 | |
1347 (unless (gnus-ephemeral-group-p group) | |
1348 (gnus-dribble-enter | |
1349 (format "(gnus-group-change-level %S %S %S %S %S)" | |
1350 group level oldlevel (car (nth 2 previous)) fromkilled))) | |
1351 | |
1352 ;; Then we remove the newgroup from any old structures, if needed. | |
1353 ;; If the group was killed, we remove it from the killed or zombie | |
1354 ;; list. If not, and it is in fact going to be killed, we remove | |
1355 ;; it from the newsrc hash table and assoc. | |
1356 (cond | |
1357 ((>= 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
|
1358 ;; 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
|
1359 (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
|
1360 (setq gnus-killed-list (delete group gnus-killed-list))) |
17493 | 1361 (t |
1362 (when (and (>= level gnus-level-zombie) | |
1363 entry) | |
1364 (gnus-sethash (car (nth 2 entry)) nil gnus-newsrc-hashtb) | |
1365 (when (nth 3 entry) | |
1366 (setcdr (gnus-gethash (car (nth 3 entry)) | |
1367 gnus-newsrc-hashtb) | |
1368 (cdr entry))) | |
1369 (setcdr (cdr entry) (cdddr entry))))) | |
1370 | |
1371 ;; Finally we enter (if needed) the list where it is supposed to | |
1372 ;; go, and change the subscription level. If it is to be killed, | |
1373 ;; we enter it into the killed or zombie list. | |
1374 (cond | |
1375 ((>= level gnus-level-zombie) | |
1376 ;; Remove from the hash table. | |
1377 (gnus-sethash group nil gnus-newsrc-hashtb) | |
1378 ;; We do not enter foreign groups into the list of dead | |
1379 ;; groups. | |
1380 (unless (gnus-group-foreign-p group) | |
1381 (if (= level gnus-level-zombie) | |
1382 (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
|
1383 (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
|
1384 ;; 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
|
1385 (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
|
1386 ;; 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
|
1387 (push group gnus-killed-list))))) |
17493 | 1388 (t |
1389 ;; If the list is to be entered into the newsrc assoc, and | |
1390 ;; it was killed, we have to create an entry in the newsrc | |
1391 ;; hashtb format and fix the pointers in the newsrc assoc. | |
1392 (if (< oldlevel gnus-level-zombie) | |
1393 ;; It was alive, and it is going to stay alive, so we | |
1394 ;; just change the level and don't change any pointers or | |
1395 ;; hash table entries. | |
1396 (setcar (cdaddr entry) level) | |
1397 (if (listp entry) | |
1398 (setq info (cdr entry) | |
1399 num (car entry)) | |
1400 (setq active (gnus-active group)) | |
1401 (setq num | |
1402 (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
|
1403 ;; 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
|
1404 ;; 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
|
1405 (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
|
1406 (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
|
1407 (gnus-group-method group))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1408 (if method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1409 (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
|
1410 (setq info (list group level nil))))) |
17493 | 1411 (unless previous |
1412 (setq previous | |
1413 (let ((p gnus-newsrc-alist)) | |
1414 (while (cddr p) | |
1415 (setq p (cdr p))) | |
1416 p))) | |
1417 (setq entry (cons info (cddr previous))) | |
1418 (if (cdr previous) | |
1419 (progn | |
1420 (setcdr (cdr previous) entry) | |
1421 (gnus-sethash group (cons num (cdr previous)) | |
1422 gnus-newsrc-hashtb)) | |
1423 (setcdr previous entry) | |
1424 (gnus-sethash group (cons num previous) | |
1425 gnus-newsrc-hashtb)) | |
1426 (when (cdr entry) | |
1427 (setcdr (gnus-gethash (caadr entry) gnus-newsrc-hashtb) entry)) | |
1428 (gnus-dribble-enter | |
1429 (format | |
1430 "(gnus-group-set-info '%S)" info))))) | |
1431 (when gnus-group-change-level-function | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1432 (funcall gnus-group-change-level-function |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1433 group level oldlevel previous))))) |
17493 | 1434 |
1435 (defun gnus-kill-newsgroup (newsgroup) | |
1436 "Obsolete function. Kills a newsgroup." | |
1437 (gnus-group-change-level | |
1438 (gnus-gethash newsgroup gnus-newsrc-hashtb) gnus-level-killed)) | |
1439 | |
1440 (defun gnus-check-bogus-newsgroups (&optional confirm) | |
1441 "Remove bogus newsgroups. | |
1442 If CONFIRM is non-nil, the user has to confirm the deletion of every | |
1443 newsgroup." | |
1444 (let ((newsrc (cdr gnus-newsrc-alist)) | |
1445 bogus group entry info) | |
1446 (gnus-message 5 "Checking bogus newsgroups...") | |
1447 (unless (gnus-read-active-file-p) | |
1448 (gnus-read-active-file t)) | |
1449 (when (gnus-read-active-file-p) | |
1450 ;; Find all bogus newsgroup that are subscribed. | |
1451 (while newsrc | |
1452 (setq info (pop newsrc) | |
1453 group (gnus-info-group info)) | |
1454 (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
|
1455 (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
|
1456 (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
|
1457 (gnus-info-method info))))) ; Foreign |
17493 | 1458 ;; Found a bogus newsgroup. |
1459 (push group bogus))) | |
1460 (if confirm | |
1461 (map-y-or-n-p | |
1462 "Remove bogus group %s? " | |
1463 (lambda (group) | |
1464 ;; Remove all bogus subscribed groups by first killing them, and | |
1465 ;; then removing them from the list of killed groups. | |
1466 (when (setq entry (gnus-gethash group gnus-newsrc-hashtb)) | |
1467 (gnus-group-change-level entry gnus-level-killed) | |
1468 (setq gnus-killed-list (delete group gnus-killed-list)))) | |
1469 bogus '("group" "groups" "remove")) | |
1470 (while (setq group (pop bogus)) | |
1471 ;; Remove all bogus subscribed groups by first killing them, and | |
1472 ;; then removing them from the list of killed groups. | |
1473 (when (setq entry (gnus-gethash group gnus-newsrc-hashtb)) | |
1474 (gnus-group-change-level entry gnus-level-killed) | |
1475 (setq gnus-killed-list (delete group gnus-killed-list))))) | |
1476 ;; Then we remove all bogus groups from the list of killed and | |
1477 ;; zombie groups. They are removed without confirmation. | |
1478 (let ((dead-lists '(gnus-killed-list gnus-zombie-list)) | |
1479 killed) | |
1480 (while dead-lists | |
1481 (setq killed (symbol-value (car dead-lists))) | |
1482 (while killed | |
1483 (unless (gnus-active (setq group (pop killed))) | |
1484 ;; The group is bogus. | |
1485 ;; !!!Slow as hell. | |
1486 (set (car dead-lists) | |
1487 (delete group (symbol-value (car dead-lists)))))) | |
1488 (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
|
1489 (gnus-run-hooks 'gnus-check-bogus-groups-hook) |
17493 | 1490 (gnus-message 5 "Checking bogus newsgroups...done")))) |
1491 | |
1492 (defun gnus-check-duplicate-killed-groups () | |
1493 "Remove duplicates from the list of killed groups." | |
1494 (interactive) | |
1495 (let ((killed gnus-killed-list)) | |
1496 (while killed | |
1497 (gnus-message 9 "%d" (length killed)) | |
1498 (setcdr killed (delete (car killed) (cdr killed))) | |
1499 (setq killed (cdr killed))))) | |
1500 | |
1501 ;; We want to inline a function from gnus-cache, so we cheat here: | |
1502 (eval-when-compile | |
1503 (defvar gnus-cache-active-hashtb) | |
1504 (defun gnus-cache-possibly-alter-active (group active) | |
1505 "Alter the ACTIVE info for GROUP to reflect the articles in the cache." | |
1506 (when gnus-cache-active-hashtb | |
1507 (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
|
1508 (when cache-active |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1509 (when (< (car cache-active) (car active)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1510 (setcar active (car cache-active))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1511 (when (> (cdr cache-active) (cdr active)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1512 (setcdr active (cdr cache-active)))))))) |
17493 | 1513 |
1514 (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
|
1515 "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
|
1516 If SCAN, request a scan of that group as well." |
17493 | 1517 (let ((method (or method (inline (gnus-find-method-for-group group)))) |
1518 active) | |
1519 (and (inline (gnus-check-server method)) | |
1520 ;; We escape all bugs and quit here to make it possible to | |
1521 ;; continue if a group is so out-there that it reports bugs | |
1522 ;; and stuff. | |
1523 (progn | |
1524 (and scan | |
1525 (gnus-check-backend-function 'request-scan (car method)) | |
1526 (gnus-request-scan group method)) | |
1527 t) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1528 (if (or debug-on-error debug-on-quit) |
17493 | 1529 (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
|
1530 (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
|
1531 (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
|
1532 ;;(error nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1533 (quit |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1534 (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
|
1535 nil))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1536 (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
|
1537 (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
|
1538 ;; 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
|
1539 ;; 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
|
1540 ;; 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
|
1541 ;; 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
|
1542 (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
|
1543 (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
|
1544 (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
|
1545 (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
|
1546 |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1547 ;; 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
|
1548 (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
|
1549 (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
|
1550 group active))) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1551 |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1552 ;; 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
|
1553 (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
|
1554 (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
|
1555 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1556 (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
|
1557 ;; 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
|
1558 active))))) |
17493 | 1559 |
1560 (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
|
1561 (when (and info active) |
17493 | 1562 ;; Allow the backend to update the info in the group. |
1563 (when (and update | |
1564 (gnus-request-update-info | |
1565 info (inline (gnus-find-method-for-group | |
1566 (gnus-info-group info))))) | |
1567 (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
|
1568 |
17493 | 1569 (let* ((range (gnus-info-read info)) |
1570 (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
|
1571 |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1572 ;; 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
|
1573 ;; 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
|
1574 |
17493 | 1575 ;; If a cache is present, we may have to alter the active info. |
1576 (when (and gnus-use-cache info) | |
1577 (inline (gnus-cache-possibly-alter-active | |
1578 (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
|
1579 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1580 ;; 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
|
1581 (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
|
1582 (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
|
1583 |
17493 | 1584 ;; Modify the list of read articles according to what articles |
1585 ;; are available; then tally the unread articles and add the | |
1586 ;; number to the group hash table entry. | |
1587 (cond | |
1588 ((zerop (cdr active)) | |
1589 (setq num 0)) | |
1590 ((not range) | |
1591 (setq num (- (1+ (cdr active)) (car active)))) | |
1592 ((not (listp (cdr range))) | |
1593 ;; Fix a single (num . num) range according to the | |
1594 ;; active hash table. | |
1595 ;; Fix by Carsten Bormann <cabo@Informatik.Uni-Bremen.DE>. | |
1596 (and (< (cdr range) (car active)) (setcdr range (1- (car active)))) | |
1597 (and (> (cdr range) (cdr active)) (setcdr range (cdr active))) | |
1598 ;; Compute number of unread articles. | |
1599 (setq num (max 0 (- (cdr active) (- (1+ (cdr range)) (car range)))))) | |
1600 (t | |
1601 ;; The read list is a list of ranges. Fix them according to | |
1602 ;; the active hash table. | |
1603 ;; First peel off any elements that are below the lower | |
1604 ;; active limit. | |
1605 (while (and (cdr range) | |
1606 (>= (car active) | |
1607 (or (and (atom (cadr range)) (cadr range)) | |
1608 (caadr range)))) | |
1609 (if (numberp (car range)) | |
1610 (setcar range | |
1611 (cons (car range) | |
1612 (or (and (numberp (cadr range)) | |
1613 (cadr range)) | |
1614 (cdadr range)))) | |
1615 (setcdr (car range) | |
1616 (or (and (numberp (nth 1 range)) (nth 1 range)) | |
1617 (cdadr range)))) | |
1618 (setcdr range (cddr range))) | |
1619 ;; Adjust the first element to be the same as the lower limit. | |
1620 (when (and (not (atom (car range))) | |
1621 (< (cdar range) (car active))) | |
1622 (setcdr (car range) (1- (car active)))) | |
1623 ;; Then we want to peel off any elements that are higher | |
1624 ;; than the upper active limit. | |
1625 (let ((srange range)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1626 ;; Go past all valid elements. |
17493 | 1627 (while (and (cdr srange) |
1628 (<= (or (and (atom (cadr srange)) | |
1629 (cadr srange)) | |
1630 (caadr srange)) | |
1631 (cdr active))) | |
1632 (setq srange (cdr srange))) | |
1633 (when (cdr srange) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1634 ;; Nuke all remaining invalid elements. |
17493 | 1635 (setcdr srange nil)) |
1636 | |
1637 ;; Adjust the final element. | |
1638 (when (and (not (atom (car srange))) | |
1639 (> (cdar srange) (cdr active))) | |
1640 (setcdr (car srange) (cdr active)))) | |
1641 ;; Compute the number of unread articles. | |
1642 (while range | |
1643 (setq num (+ num (- (1+ (or (and (atom (car range)) (car range)) | |
1644 (cdar range))) | |
1645 (or (and (atom (car range)) (car range)) | |
1646 (caar range))))) | |
1647 (setq range (cdr range))) | |
1648 (setq num (max 0 (- (cdr active) num))))) | |
1649 ;; 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
|
1650 (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
|
1651 (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb)) |
17493 | 1652 (setcar (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb) num)) |
1653 num))) | |
1654 | |
1655 ;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb' | |
1656 ;; and compute how many unread articles there are in each group. | |
1657 (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
|
1658 (setq gnus-server-method-cache nil) |
17493 | 1659 (let* ((newsrc (cdr gnus-newsrc-alist)) |
1660 (level (or level gnus-activate-level (1+ gnus-level-subscribed))) | |
1661 (foreign-level | |
1662 (min | |
1663 (cond ((and gnus-activate-foreign-newsgroups | |
1664 (not (numberp gnus-activate-foreign-newsgroups))) | |
1665 (1+ gnus-level-subscribed)) | |
1666 ((numberp gnus-activate-foreign-newsgroups) | |
1667 gnus-activate-foreign-newsgroups) | |
1668 (t 0)) | |
1669 level)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1670 (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
|
1671 (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
|
1672 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
|
1673 method-type) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1674 (gnus-message 6 "Checking new news...") |
17493 | 1675 |
1676 (while newsrc | |
1677 (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
|
1678 (setq info (pop newsrc)))))) |
17493 | 1679 |
1680 ;; Check newsgroups. If the user doesn't want to check them, or | |
1681 ;; they can't be checked (for instance, if the news server can't | |
1682 ;; be reached) we just set the number of unread articles in this | |
1683 ;; newsgroup to t. This means that Gnus thinks that there are | |
1684 ;; 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
|
1685 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1686 ;; To be more explicit: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1687 ;; >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
|
1688 ;; 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
|
1689 ;; 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
|
1690 ;; 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
|
1691 ;; 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
|
1692 (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
|
1693 (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
|
1694 (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
|
1695 (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
|
1696 (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
|
1697 (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
|
1698 (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
|
1699 (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
|
1700 (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
|
1701 (cond |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1702 ((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
|
1703 'secondary) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1704 ((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
|
1705 'primary) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1706 (t |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1707 'foreign))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1708 (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
|
1709 |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1710 (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
|
1711 ;; 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
|
1712 (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
|
1713 (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
|
1714 ;; 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
|
1715 (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
|
1716 (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
|
1717 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
|
1718 (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
|
1719 (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
|
1720 (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
|
1721 "-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
|
1722 (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
|
1723 ;; 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
|
1724 ((> (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
|
1725 ;; 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
|
1726 (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
|
1727 ;; Activate groups. |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1728 ((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
|
1729 (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
|
1730 ;; 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
|
1731 ;; 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
|
1732 (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
|
1733 (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
|
1734 (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
|
1735 (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
|
1736 ;; 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
|
1737 ;; 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
|
1738 ;; 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
|
1739 ;; 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
|
1740 ;; 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
|
1741 ;; not required. |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1742 (if (and |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1743 (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
|
1744 (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
|
1745 (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
|
1746 (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
|
1747 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
|
1748 (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
|
1749 (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
|
1750 (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
|
1751 (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
|
1752 (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
|
1753 (when active |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
1754 (gnus-close-group group))))) |
17493 | 1755 |
1756 ;; 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
|
1757 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1758 ((eq active 'ignore) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1759 ;; Don't do anything. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1760 ) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1761 (active |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1762 (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
|
1763 (t |
17493 | 1764 ;; The group couldn't be reached, so we nix out the number of |
1765 ;; unread articles and stuff. | |
1766 (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
|
1767 (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
|
1768 (when tmp |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1769 (setcar tmp t)))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1770 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1771 ;; 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
|
1772 ;; 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
|
1773 (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
|
1774 (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
|
1775 (groups (cdr rg))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1776 (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
|
1777 ;; 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
|
1778 (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
|
1779 (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
|
1780 (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
|
1781 (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
|
1782 method) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1783 (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
|
1784 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1785 ((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
|
1786 (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
|
1787 (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
|
1788 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1789 ;; 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
|
1790 ;; 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
|
1791 (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
|
1792 (setcar (gnus-gethash group gnus-newsrc-hashtb) t))))))) |
17493 | 1793 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1794 (gnus-message 6 "Checking new news...done"))) |
17493 | 1795 |
1796 ;; Create a hash table out of the newsrc alist. The `car's of the | |
1797 ;; alist elements are used as keys. | |
1798 (defun gnus-make-hashtable-from-newsrc-alist () | |
1799 (let ((alist gnus-newsrc-alist) | |
1800 (ohashtb gnus-newsrc-hashtb) | |
1801 prev) | |
1802 (setq gnus-newsrc-hashtb (gnus-make-hashtable (length alist))) | |
1803 (setq alist | |
1804 (setq prev (setq gnus-newsrc-alist | |
1805 (if (equal (caar gnus-newsrc-alist) | |
1806 "dummy.group") | |
1807 gnus-newsrc-alist | |
1808 (cons (list "dummy.group" 0 nil) alist))))) | |
1809 (while alist | |
1810 (gnus-sethash | |
1811 (caar alist) | |
1812 ;; Preserve number of unread articles in groups. | |
1813 (cons (and ohashtb (car (gnus-gethash (caar alist) ohashtb))) | |
1814 prev) | |
1815 gnus-newsrc-hashtb) | |
1816 (setq prev alist | |
1817 alist (cdr alist))))) | |
1818 | |
1819 (defun gnus-make-hashtable-from-killed () | |
1820 "Create a hash table from the killed and zombie lists." | |
1821 (let ((lists '(gnus-killed-list gnus-zombie-list)) | |
1822 list) | |
1823 (setq gnus-killed-hashtb | |
1824 (gnus-make-hashtable | |
1825 (+ (length gnus-killed-list) (length gnus-zombie-list)))) | |
1826 (while lists | |
1827 (setq list (symbol-value (pop lists))) | |
1828 (while list | |
1829 (gnus-sethash (car list) (pop list) gnus-killed-hashtb))))) | |
1830 | |
1831 (defun gnus-parse-active () | |
1832 "Parse active info in the nntp server buffer." | |
1833 (save-excursion | |
1834 (set-buffer nntp-server-buffer) | |
1835 (goto-char (point-min)) | |
1836 ;; Parse the result we got from `gnus-request-group'. | |
1837 (when (looking-at "[0-9]+ [0-9]+ \\([0-9]+\\) [0-9]+") | |
1838 (goto-char (match-beginning 1)) | |
1839 (cons (read (current-buffer)) | |
1840 (read (current-buffer)))))) | |
1841 | |
1842 (defun gnus-make-articles-unread (group articles) | |
1843 "Mark ARTICLES in GROUP as unread." | |
1844 (let* ((info (nth 2 (or (gnus-gethash group gnus-newsrc-hashtb) | |
1845 (gnus-gethash (gnus-group-real-name group) | |
1846 gnus-newsrc-hashtb)))) | |
1847 (ranges (gnus-info-read info)) | |
1848 news article) | |
1849 (while articles | |
1850 (when (gnus-member-of-range | |
1851 (setq article (pop articles)) ranges) | |
1852 (push article news))) | |
1853 (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
|
1854 ;; Enter this list into the group info. |
17493 | 1855 (gnus-info-set-read |
1856 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
|
1857 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1858 ;; 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
|
1859 (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
|
1860 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1861 ;; 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
|
1862 (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
|
1863 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1864 (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
|
1865 "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
|
1866 (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
|
1867 (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
|
1868 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
|
1869 (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
|
1870 (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
|
1871 (r ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1872 modified) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1873 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1874 (while articles |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1875 (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
|
1876 (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
|
1877 (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
|
1878 (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
|
1879 ;; 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
|
1880 ;; 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
|
1881 (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
|
1882 ((< range article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1883 ;; 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
|
1884 (pop ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1885 ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1886 ((= range article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1887 ;; 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
|
1888 ;; 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
|
1889 (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
|
1890 (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
|
1891 (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
|
1892 nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1893 (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
|
1894 (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
|
1895 ;; 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
|
1896 (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
|
1897 (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
|
1898 (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
|
1899 (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
|
1900 ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1901 ((= min max) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1902 ;; 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
|
1903 (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
|
1904 ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1905 ((< max article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1906 ;; 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
|
1907 (pop ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1908 ranges) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1909 ((< article min) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1910 ;; 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
|
1911 ;; next article |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1912 nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1913 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1914 ;; 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
|
1915 (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
|
1916 (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
|
1917 (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
|
1918 ranges)))))))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58959
diff
changeset
|
1919 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1920 (when modified |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1921 (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
|
1922 (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
|
1923 ;; 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
|
1924 (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
|
1925 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1926 ;; 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
|
1927 (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
|
1928 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1929 ;; Insert the change into the group buffer and the dribble file. |
17493 | 1930 (gnus-group-update-group group t)))) |
1931 | |
1932 ;; Enter all dead groups into the hashtb. | |
1933 (defun gnus-update-active-hashtb-from-killed () | |
1934 (let ((hashtb (setq gnus-active-hashtb (gnus-make-hashtable 4096))) | |
1935 (lists (list gnus-killed-list gnus-zombie-list)) | |
1936 killed) | |
1937 (while lists | |
1938 (setq killed (car lists)) | |
1939 (while killed | |
1940 (gnus-sethash (car killed) nil hashtb) | |
1941 (setq killed (cdr killed))) | |
1942 (setq lists (cdr lists))))) | |
1943 | |
1944 (defun gnus-get-killed-groups () | |
1945 "Go through the active hashtb and mark all unknown groups as killed." | |
1946 ;; First make sure active file has been read. | |
1947 (unless (gnus-read-active-file-p) | |
1948 (let ((gnus-read-active-file t)) | |
1949 (gnus-read-active-file))) | |
1950 (unless gnus-killed-hashtb | |
1951 (gnus-make-hashtable-from-killed)) | |
1952 ;; Go through all newsgroups that are known to Gnus - enlarge kill list. | |
1953 (mapatoms | |
1954 (lambda (sym) | |
1955 (let ((groups 0) | |
1956 (group (symbol-name sym))) | |
1957 (if (or (null group) | |
1958 (gnus-gethash group gnus-killed-hashtb) | |
1959 (gnus-gethash group gnus-newsrc-hashtb)) | |
1960 () | |
1961 (let ((do-sub (gnus-matches-options-n group))) | |
1962 (if (or (eq do-sub 'subscribe) (eq do-sub 'ignore)) | |
1963 () | |
1964 (setq groups (1+ groups)) | |
1965 (push group gnus-killed-list) | |
1966 (gnus-sethash group group gnus-killed-hashtb)))))) | |
1967 gnus-active-hashtb) | |
1968 (gnus-dribble-touch)) | |
1969 | |
1970 ;; Get the active file(s) from the backend(s). | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
1971 (defun gnus-read-active-file (&optional force not-native) |
17493 | 1972 (gnus-group-set-mode-line) |
1973 (let ((methods | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1974 (mapcar |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1975 (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
|
1976 (append |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1977 (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
|
1978 (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
|
1979 ;; 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
|
1980 (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
|
1981 ;; 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
|
1982 ;; secondary ones. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1983 gnus-secondary-select-methods) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1984 ;; 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
|
1985 (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
|
1986 (list "archive"))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1987 method) |
17493 | 1988 (setq gnus-have-read-active-file nil) |
1989 (save-excursion | |
1990 (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
|
1991 (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
|
1992 ;; 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
|
1993 ;; 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
|
1994 (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
|
1995 (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
|
1996 (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
|
1997 (condition-case () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1998 (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
|
1999 ;; 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
|
2000 ;; 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
|
2001 (quit |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2002 (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
|
2003 nil)))))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2004 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2005 (defun gnus-read-active-file-1 (method force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2006 (let (where mesg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2007 (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
|
2008 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
|
2009 (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
|
2010 (concat " from " where) "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2011 (car method))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2012 (gnus-message 5 mesg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2013 (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
|
2014 ;; 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
|
2015 (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
|
2016 (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
|
2017 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2018 ((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
|
2019 (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
|
2020 (not force)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2021 (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
|
2022 (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
|
2023 groups info) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2024 (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
|
2025 (when (inline |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2026 (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
|
2027 (inline |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2028 (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
|
2029 (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
|
2030 gmethod)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2031 (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
|
2032 groups))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2033 (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
|
2034 ((null method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2035 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2036 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2037 (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
|
2038 (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
|
2039 (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
|
2040 (car method))) |
17493 | 2041 (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
|
2042 (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
|
2043 ;; 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
|
2044 (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
|
2045 (gnus-message 5 "%sdone" mesg))))))) |
17493 | 2046 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2047 (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
|
2048 "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
|
2049 (when groups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2050 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2051 (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
|
2052 (gnus-check-server method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2053 (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
|
2054 (cond ((not list-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2055 (gnus-error |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2056 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
|
2057 (car method))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2058 ((eq list-type 'active) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2059 (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
|
2060 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2061 (gnus-groups-to-gnus-format method gnus-active-hashtb t))))))) |
17493 | 2062 |
2063 ;; 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
|
2064 (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
|
2065 real-active) |
17493 | 2066 (unless method |
2067 (setq method gnus-select-method)) | |
2068 (let ((cur (current-buffer)) | |
2069 (hashtb (or hashtb | |
2070 (if (and gnus-active-hashtb | |
2071 (not (equal method gnus-select-method))) | |
2072 gnus-active-hashtb | |
2073 (setq gnus-active-hashtb | |
2074 (if (equal method gnus-select-method) | |
2075 (gnus-make-hashtable | |
2076 (count-lines (point-min) (point-max))) | |
2077 (gnus-make-hashtable 4096))))))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2078 ;; Delete unnecessary lines. |
17493 | 2079 (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
|
2080 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2081 ((string= gnus-ignored-newsgroups "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2082 (delete-matching-lines "^to\\.")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2083 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2084 (delete-matching-lines (concat "^to\\.\\|" gnus-ignored-newsgroups)))) |
17493 | 2085 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2086 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2087 (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
|
2088 ;; 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
|
2089 ;; contain special characters. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2090 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2091 (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
|
2092 (insert ?\\))) |
17493 | 2093 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2094 ;; 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
|
2095 (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
|
2096 (gnus-agent-save-active method)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2097 |
17493 | 2098 ;; If these are groups from a foreign select method, we insert the |
2099 ;; group prefix in front of the group names. | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2100 (when (not (gnus-server-equal |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2101 (gnus-server-get-method nil method) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2102 (gnus-server-get-method nil gnus-select-method))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2103 (let ((prefix (gnus-group-prefixed-name "" method))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2104 (goto-char (point-min)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19910
diff
changeset
|
2105 (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
|
2106 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2107 (when (= (following-char) ?\") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2108 (forward-char 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2109 (insert prefix) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2110 (zerop (forward-line 1))))))) |
17493 | 2111 ;; Store the active file in a hash table. |
2112 (goto-char (point-min)) | |
2113 (let (group max min) | |
2114 (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
|
2115 (condition-case () |
17493 | 2116 (progn |
2117 (narrow-to-region (point) (gnus-point-at-eol)) | |
2118 ;; group gets set to a symbol interned in the hash table | |
2119 ;; (what a hack!!) - jwz | |
2120 (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
|
2121 ;; ### 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
|
2122 ;; 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
|
2123 (when (stringp group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2124 (setq group (intern group hashtb))) |
17493 | 2125 (if (and (numberp (setq max (read cur))) |
2126 (numberp (setq min (read cur))) | |
2127 (progn | |
2128 (skip-chars-forward " \t") | |
2129 (not | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2130 (or (eq (char-after) ?=) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2131 (eq (char-after) ?x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2132 (eq (char-after) ?j))))) |
17493 | 2133 (progn |
2134 (set group (cons min max)) | |
2135 ;; 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
|
2136 (when (eq (char-after) ?m) |
17493 | 2137 (unless gnus-moderated-hashtb |
2138 (setq gnus-moderated-hashtb (gnus-make-hashtable))) | |
2139 (gnus-sethash (symbol-name group) t | |
2140 gnus-moderated-hashtb))) | |
2141 (set group nil))) | |
2142 (error | |
2143 (and group | |
2144 (symbolp group) | |
2145 (set group nil)) | |
2146 (unless ignore-errors | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2147 (gnus-message 3 "Warning - invalid active: %s" |
17493 | 2148 (buffer-substring |
2149 (gnus-point-at-bol) (gnus-point-at-eol)))))) | |
2150 (widen) | |
2151 (forward-line 1))))) | |
2152 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2153 (defun gnus-groups-to-gnus-format (method &optional hashtb real-active) |
17493 | 2154 ;; Parse a "groups" active file. |
2155 (let ((cur (current-buffer)) | |
2156 (hashtb (or hashtb | |
2157 (if (and method gnus-active-hashtb) | |
2158 gnus-active-hashtb | |
2159 (setq gnus-active-hashtb | |
2160 (gnus-make-hashtable | |
2161 (count-lines (point-min) (point-max))))))) | |
2162 (prefix (and method | |
2163 (not (gnus-server-equal | |
2164 (gnus-server-get-method nil method) | |
2165 (gnus-server-get-method nil gnus-select-method))) | |
2166 (gnus-group-prefixed-name "" method)))) | |
2167 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2168 ;; 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
|
2169 (if (and gnus-agent |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2170 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
|
2171 (gnus-online method) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2172 (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
|
2173 (progn |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2174 (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
|
2175 (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
|
2176 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2177 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2178 ;; 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
|
2179 ;; 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
|
2180 (if prefix |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2181 (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
|
2182 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2183 (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2184 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2185 (read cur) (read cur) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2186 (setq min (read cur) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2187 max (read cur) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2188 opoint (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2189 (skip-chars-forward " \t") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2190 (insert prefix) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2191 (goto-char opoint) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2192 (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
|
2193 (cons min max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2194 (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
|
2195 (forward-line 1))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2196 (let (min max group) |
17493 | 2197 (while (not (eobp)) |
2198 (condition-case () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2199 (when (eq (char-after) ?2) |
17493 | 2200 (read cur) (read cur) |
2201 (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
|
2202 max (read cur)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2203 (set (setq group (let ((obarray hashtb)) (read cur))) |
17493 | 2204 (cons min max))) |
2205 (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
|
2206 (forward-line 1))))))) |
17493 | 2207 |
2208 (defun gnus-read-newsrc-file (&optional force) | |
2209 "Read startup file. | |
2210 If FORCE is non-nil, the .newsrc file is read." | |
2211 ;; 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
|
2212 (let ((variables (remove 'gnus-format-specs gnus-variable-list))) |
17493 | 2213 (while variables |
2214 (set (car variables) nil) | |
2215 (setq variables (cdr variables)))) | |
2216 (let* ((newsrc-file gnus-current-startup-file) | |
2217 (quick-file (concat newsrc-file ".el"))) | |
2218 (save-excursion | |
2219 ;; We always load the .newsrc.eld file. If always contains | |
2220 ;; much information that can not be gotten from the .newsrc | |
2221 ;; file (ticked articles, killed groups, foreign methods, etc.) | |
2222 (gnus-read-newsrc-el-file quick-file) | |
2223 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2224 (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
|
2225 (file-exists-p gnus-current-startup-file) |
17493 | 2226 (or force |
2227 (and (file-newer-than-file-p newsrc-file quick-file) | |
2228 (file-newer-than-file-p newsrc-file | |
2229 (concat quick-file "d"))) | |
2230 (not gnus-newsrc-alist))) | |
2231 ;; We read the .newsrc file. Note that if there if a | |
2232 ;; .newsrc.eld file exists, it has already been read, and | |
2233 ;; the `gnus-newsrc-hashtb' has been created. While reading | |
2234 ;; the .newsrc file, Gnus will only use the information it | |
2235 ;; can find there for changing the data already read - | |
2236 ;; i. e., reading the .newsrc file will not trash the data | |
2237 ;; already read (except for read articles). | |
2238 (save-excursion | |
2239 (gnus-message 5 "Reading %s..." newsrc-file) | |
2240 (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
|
2241 (buffer-disable-undo) |
17493 | 2242 (gnus-newsrc-to-gnus-format) |
2243 (kill-buffer (current-buffer)) | |
2244 (gnus-message 5 "Reading %s...done" newsrc-file))) | |
2245 | |
2246 ;; Convert old to new. | |
2247 (gnus-convert-old-newsrc)))) | |
2248 | |
2249 (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
|
2250 "Convert old newsrc formats into the current format, if needed." |
17493 | 2251 (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
|
2252 (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
|
2253 (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
|
2254 (when fcv |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2255 ;; 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
|
2256 (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
|
2257 (converters |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2258 (sort |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2259 (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
|
2260 (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
|
2261 date-func)) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2262 ;; 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
|
2263 ;; 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
|
2264 ;; 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
|
2265 ;; 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
|
2266 ;; 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
|
2267 ;; 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
|
2268 ;; 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
|
2269 ;; 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
|
2270 ;; previous version into the current version. |
58221
410d0a597e9d
(gnus-convert-old-newsrc): Assign
Reiner Steib <Reiner.Steib@gmx.de>
parents:
57856
diff
changeset
|
2271 '(("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
|
2272 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
|
2273 ("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
|
2274 gnus-agent-convert-to-compressed-agentview) |
58221
410d0a597e9d
(gnus-convert-old-newsrc): Assign
Reiner Steib <Reiner.Steib@gmx.de>
parents:
57856
diff
changeset
|
2275 ("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
|
2276 gnus-agent-unlist-expire-days) |
58221
410d0a597e9d
(gnus-convert-old-newsrc): Assign
Reiner Steib <Reiner.Steib@gmx.de>
parents:
57856
diff
changeset
|
2277 ("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
|
2278 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
|
2279 #'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
|
2280 ;; 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
|
2281 (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
|
2282 (pop converters)) |
17493 | 2283 |
57617
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2284 ;; 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
|
2285 (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
|
2286 (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
|
2287 (<= (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
|
2288 (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
|
2289 (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
|
2290 (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
|
2291 (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
|
2292 (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
|
2293 (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
|
2294 (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
|
2295 (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
|
2296 (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
|
2297 (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
|
2298 (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
|
2299 (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
|
2300 (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
|
2301 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
|
2302 (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
|
2303 |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2304 (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
|
2305 (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
|
2306 ((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
|
2307 (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
|
2308 nil) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2309 ((eq c ?\?) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2310 (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
|
2311 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
|
2312 (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
|
2313 t) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2314 (t |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2315 (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
|
2316 (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
|
2317 t))))) |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2318 |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2319 (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
|
2320 (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
|
2321 (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
|
2322 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
|
2323 |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2324 (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
|
2325 "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
|
2326 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
|
2327 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
|
2328 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
|
2329 (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
|
2330 |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2331 (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
|
2332 (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
|
2333 (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
|
2334 no-prompt |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2335 (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
|
2336 |
7fdc1df35f39
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Miles Bader <miles@gnu.org>
parents:
57581
diff
changeset
|
2337 (defun gnus-convert-old-ticks (converting-to) |
17493 | 2338 (let ((newsrc (cdr gnus-newsrc-alist)) |
2339 marks info dormant ticked) | |
2340 (while (setq info (pop newsrc)) | |
2341 (when (setq marks (gnus-info-marks info)) | |
2342 (setq dormant (cdr (assq 'dormant marks)) | |
2343 ticked (cdr (assq 'tick marks))) | |
2344 (when (or dormant ticked) | |
2345 (gnus-info-set-read | |
2346 info | |
2347 (gnus-add-to-range | |
2348 (gnus-info-read info) | |
2349 (nconc (gnus-uncompress-range dormant) | |
2350 (gnus-uncompress-range ticked))))))))) | |
2351 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2352 (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
|
2353 "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
|
2354 (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
|
2355 (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
|
2356 (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
|
2357 (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
|
2358 (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
|
2359 (eval form)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2360 (error |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2361 (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
|
2362 (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
|
2363 (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
|
2364 (ding) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2365 (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
|
2366 (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
|
2367 |
17493 | 2368 (defun gnus-read-newsrc-el-file (file) |
2369 (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
|
2370 (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
|
2371 ;; 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
|
2372 (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
|
2373 (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
|
2374 (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
|
2375 (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
|
2376 ;; 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
|
2377 ;; 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
|
2378 (let ((version |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2379 (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
|
2380 (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
|
2381 (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
|
2382 (< 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
|
2383 (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
|
2384 (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
|
2385 (setq gnus-newsrc-alist gnus-newsrc-assoc)))) |
17493 | 2386 (gnus-make-hashtable-from-newsrc-alist) |
2387 (when (file-newer-than-file-p file ding-file) | |
2388 ;; Old format quick file | |
2389 (gnus-message 5 "Reading %s..." file) | |
2390 ;; The .el file is newer than the .eld file, so we read that one | |
2391 ;; 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
|
2392 (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
|
2393 (gnus-run-hooks 'gnus-read-newsrc-el-hook)) |
17493 | 2394 |
2395 ;; Parse the old-style quick startup file | |
2396 (defun gnus-read-old-newsrc-el-file (file) | |
2397 (let (newsrc killed marked group m info) | |
2398 (prog1 | |
2399 (let ((gnus-killed-assoc nil) | |
2400 gnus-marked-assoc gnus-newsrc-alist gnus-newsrc-assoc) | |
2401 (prog1 | |
2402 (ignore-errors | |
2403 (load file t t t)) | |
2404 (setq newsrc gnus-newsrc-assoc | |
2405 killed gnus-killed-assoc | |
2406 marked gnus-marked-assoc))) | |
2407 (setq gnus-newsrc-alist nil) | |
2408 (while (setq group (pop newsrc)) | |
2409 (if (setq info (gnus-get-info (car group))) | |
2410 (progn | |
2411 (gnus-info-set-read info (cddr group)) | |
2412 (gnus-info-set-level | |
2413 info (if (nth 1 group) gnus-level-default-subscribed | |
2414 gnus-level-default-unsubscribed)) | |
2415 (push info gnus-newsrc-alist)) | |
2416 (push (setq info | |
2417 (list (car group) | |
2418 (if (nth 1 group) gnus-level-default-subscribed | |
2419 gnus-level-default-unsubscribed) | |
2420 (cddr group))) | |
2421 gnus-newsrc-alist)) | |
2422 ;; Copy marks into info. | |
2423 (when (setq m (assoc (car group) marked)) | |
2424 (unless (nthcdr 3 info) | |
2425 (nconc info (list nil))) | |
2426 (gnus-info-set-marks | |
2427 info (list (cons 'tick (gnus-compress-sequence | |
2428 (sort (cdr m) '<) t)))))) | |
2429 (setq newsrc killed) | |
2430 (while newsrc | |
2431 (setcar newsrc (caar newsrc)) | |
2432 (setq newsrc (cdr newsrc))) | |
2433 (setq gnus-killed-list killed)) | |
2434 ;; The .el file version of this variable does not begin with | |
2435 ;; "options", while the .eld version does, so we just add it if it | |
2436 ;; isn't there. | |
2437 (when | |
2438 gnus-newsrc-options | |
2439 (when (not (string-match "^ *options" gnus-newsrc-options)) | |
2440 (setq gnus-newsrc-options (concat "options " gnus-newsrc-options))) | |
2441 (when (not (string-match "\n$" gnus-newsrc-options)) | |
2442 (setq gnus-newsrc-options (concat gnus-newsrc-options "\n"))) | |
2443 ;; Finally, if we read some options lines, we parse them. | |
2444 (unless (string= gnus-newsrc-options "") | |
2445 (gnus-newsrc-parse-options gnus-newsrc-options))) | |
2446 | |
2447 (setq gnus-newsrc-alist (nreverse gnus-newsrc-alist)) | |
2448 (gnus-make-hashtable-from-newsrc-alist))) | |
2449 | |
2450 (defun gnus-make-newsrc-file (file) | |
2451 "Make server dependent file name by catenating FILE and server host name." | |
2452 (let* ((file (expand-file-name file nil)) | |
2453 (real-file (concat file "-" (nth 1 gnus-select-method)))) | |
2454 (if (or (file-exists-p real-file) | |
2455 (file-exists-p (concat real-file ".el")) | |
2456 (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
|
2457 real-file |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2458 file))) |
17493 | 2459 |
2460 (defun gnus-newsrc-to-gnus-format () | |
2461 (setq gnus-newsrc-options "") | |
2462 (setq gnus-newsrc-options-n nil) | |
2463 | |
2464 (unless gnus-active-hashtb | |
2465 (setq gnus-active-hashtb (gnus-make-hashtable 4096))) | |
2466 (let ((buf (current-buffer)) | |
2467 (already-read (> (length gnus-newsrc-alist) 1)) | |
2468 group subscribed options-symbol newsrc Options-symbol | |
2469 symbol reads num1) | |
2470 (goto-char (point-min)) | |
2471 ;; We intern the symbol `options' in the active hashtb so that we | |
2472 ;; can `eq' against it later. | |
2473 (set (setq options-symbol (intern "options" gnus-active-hashtb)) nil) | |
2474 (set (setq Options-symbol (intern "Options" gnus-active-hashtb)) nil) | |
2475 | |
2476 (while (not (eobp)) | |
2477 ;; We first read the first word on the line by narrowing and | |
2478 ;; then reading into `gnus-active-hashtb'. Most groups will | |
2479 ;; already exist in that hashtb, so this will save some string | |
2480 ;; space. | |
2481 (narrow-to-region | |
2482 (point) | |
2483 (progn (skip-chars-forward "^ \t!:\n") (point))) | |
2484 (goto-char (point-min)) | |
2485 (setq symbol | |
2486 (and (/= (point-min) (point-max)) | |
2487 (let ((obarray gnus-active-hashtb)) (read buf)))) | |
2488 (widen) | |
2489 ;; Now, the symbol we have read is either `options' or a group | |
2490 ;; name. If it is an options line, we just add it to a string. | |
2491 (cond | |
2492 ((or (eq symbol options-symbol) | |
2493 (eq symbol Options-symbol)) | |
2494 (setq gnus-newsrc-options | |
2495 ;; This concating is quite inefficient, but since our | |
2496 ;; thorough studies show that approx 99.37% of all | |
2497 ;; .newsrc files only contain a single options line, we | |
2498 ;; don't give a damn, frankly, my dear. | |
2499 (concat gnus-newsrc-options | |
2500 (buffer-substring | |
2501 (gnus-point-at-bol) | |
2502 ;; Options may continue on the next line. | |
2503 (or (and (re-search-forward "^[^ \t]" nil 'move) | |
2504 (progn (beginning-of-line) (point))) | |
2505 (point))))) | |
2506 (forward-line -1)) | |
2507 (symbol | |
2508 ;; Group names can be just numbers. | |
2509 (when (numberp symbol) | |
2510 (setq symbol (intern (int-to-string symbol) gnus-active-hashtb))) | |
2511 (unless (boundp symbol) | |
2512 (set symbol nil)) | |
2513 ;; 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
|
2514 (setq subscribed (eq (char-after) ?:) |
17493 | 2515 group (symbol-name symbol) |
2516 reads nil) | |
2517 (if (eolp) | |
2518 ;; 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
|
2519 ;; we put point a the beginning of line and let the cond |
17493 | 2520 ;; below do the error handling. |
2521 (beginning-of-line) | |
2522 ;; We skip to the beginning of the ranges. | |
2523 (skip-chars-forward "!: \t")) | |
2524 ;; We are now at the beginning of the list of read articles. | |
2525 ;; We read them range by range. | |
2526 (while | |
2527 (cond | |
2528 ((looking-at "[0-9]+") | |
2529 ;; 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
|
2530 ;; string-to-number because it's faster. narrow/widen is |
17493 | 2531 ;; faster than save-restriction/narrow, and save-restriction |
2532 ;; produces a garbage object. | |
2533 (setq num1 (progn | |
2534 (narrow-to-region (match-beginning 0) (match-end 0)) | |
2535 (read buf))) | |
2536 (widen) | |
2537 ;; 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
|
2538 (if (eq (char-after) ?-) |
17493 | 2539 (progn |
2540 ;; We read the upper bound of the range. | |
2541 (forward-char 1) | |
2542 (if (not (looking-at "[0-9]+")) | |
2543 ;; This is a buggy line, by we pretend that | |
2544 ;; it's kinda OK. Perhaps the user should be | |
2545 ;; dinged? | |
2546 (push num1 reads) | |
2547 (push | |
2548 (cons num1 | |
2549 (progn | |
2550 (narrow-to-region (match-beginning 0) | |
2551 (match-end 0)) | |
2552 (read buf))) | |
2553 reads) | |
2554 (widen))) | |
2555 ;; It was just a simple number, so we add it to the | |
2556 ;; list of ranges. | |
2557 (push num1 reads)) | |
2558 ;; If the next char in ?\n, then we have reached the end | |
2559 ;; 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
|
2560 (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
|
2561 ((eq (char-after) ?\n) |
17493 | 2562 ;; End of line, so we end. |
2563 nil) | |
2564 (t | |
2565 ;; Not numbers and not eol, so this might be a buggy | |
2566 ;; line... | |
2567 (unless (eobp) | |
2568 ;; If it was eob instead of ?\n, we allow it. | |
2569 ;; The line was buggy. | |
2570 (setq group nil) | |
2571 (gnus-error 3.1 "Mangled line: %s" | |
2572 (buffer-substring (gnus-point-at-bol) | |
2573 (gnus-point-at-eol)))) | |
2574 nil)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2575 ;; Skip past ", ". Spaces are invalid in these ranges, but |
17493 | 2576 ;; we allow them, because it's a common mistake to put a |
2577 ;; space after the comma. | |
2578 (skip-chars-forward ", ")) | |
2579 | |
2580 ;; We have already read .newsrc.eld, so we gently update the | |
2581 ;; data in the hash table with the information we have just | |
2582 ;; read. | |
2583 (when group | |
2584 (let ((info (gnus-get-info group)) | |
2585 level) | |
2586 (if info | |
2587 ;; There is an entry for this file in the alist. | |
2588 (progn | |
2589 (gnus-info-set-read info (nreverse reads)) | |
2590 ;; We update the level very gently. In fact, we | |
2591 ;; only change it if there's been a status change | |
2592 ;; from subscribed to unsubscribed, or vice versa. | |
2593 (setq level (gnus-info-level info)) | |
2594 (cond ((and (<= level gnus-level-subscribed) | |
2595 (not subscribed)) | |
2596 (setq level (if reads | |
2597 gnus-level-default-unsubscribed | |
2598 (1+ gnus-level-default-unsubscribed)))) | |
2599 ((and (> level gnus-level-subscribed) subscribed) | |
2600 (setq level gnus-level-default-subscribed))) | |
2601 (gnus-info-set-level info level)) | |
2602 ;; This is a new group. | |
2603 (setq info (list group | |
2604 (if subscribed | |
2605 gnus-level-default-subscribed | |
2606 (if reads | |
2607 (1+ gnus-level-subscribed) | |
2608 gnus-level-default-unsubscribed)) | |
2609 (nreverse reads)))) | |
2610 (push info newsrc))))) | |
2611 (forward-line 1)) | |
2612 | |
2613 (setq newsrc (nreverse newsrc)) | |
2614 | |
2615 (if (not already-read) | |
2616 () | |
2617 ;; We now have two newsrc lists - `newsrc', which is what we | |
2618 ;; have read from .newsrc, and `gnus-newsrc-alist', which is | |
2619 ;; what we've read from .newsrc.eld. We have to merge these | |
2620 ;; lists. We do this by "attaching" any (foreign) groups in the | |
2621 ;; gnus-newsrc-alist to the (native) group that precedes them. | |
2622 (let ((rc (cdr gnus-newsrc-alist)) | |
2623 (prev gnus-newsrc-alist) | |
2624 entry mentry) | |
2625 (while rc | |
2626 (or (null (nth 4 (car rc))) ; It's a native group. | |
2627 (assoc (caar rc) newsrc) ; It's already in the alist. | |
2628 (if (setq entry (assoc (caar prev) newsrc)) | |
2629 (setcdr (setq mentry (memq entry newsrc)) | |
2630 (cons (car rc) (cdr mentry))) | |
2631 (push (car rc) newsrc))) | |
2632 (setq prev rc | |
2633 rc (cdr rc))))) | |
2634 | |
2635 (setq gnus-newsrc-alist newsrc) | |
2636 ;; We make the newsrc hashtb. | |
2637 (gnus-make-hashtable-from-newsrc-alist) | |
2638 | |
2639 ;; Finally, if we read some options lines, we parse them. | |
2640 (unless (string= gnus-newsrc-options "") | |
2641 (gnus-newsrc-parse-options gnus-newsrc-options)))) | |
2642 | |
2643 ;; Parse options lines to find "options -n !all rec.all" and stuff. | |
2644 ;; The return value will be a list on the form | |
2645 ;; ((regexp1 . ignore) | |
2646 ;; (regexp2 . subscribe)...) | |
2647 ;; When handling new newsgroups, groups that match a `ignore' regexp | |
2648 ;; will be ignored, and groups that match a `subscribe' regexp will be | |
2649 ;; subscribed. A line like | |
2650 ;; options -n !all rec.all | |
2651 ;; will lead to a list that looks like | |
2652 ;; (("^rec\\..+" . subscribe) | |
2653 ;; ("^.+" . ignore)) | |
2654 ;; So all "rec.*" groups will be subscribed, while all the other | |
2655 ;; groups will be ignored. Note that "options -n !all rec.all" is very | |
2656 ;; different from "options -n rec.all !all". | |
2657 (defun gnus-newsrc-parse-options (options) | |
2658 (let (out eol) | |
2659 (save-excursion | |
2660 (gnus-set-work-buffer) | |
2661 (insert (regexp-quote options)) | |
2662 ;; First we treat all continuation lines. | |
2663 (goto-char (point-min)) | |
2664 (while (re-search-forward "\n[ \t]+" nil t) | |
2665 (replace-match " " t t)) | |
2666 ;; Then we transform all "all"s into ".+"s. | |
2667 (goto-char (point-min)) | |
2668 (while (re-search-forward "\\ball\\b" nil t) | |
2669 (replace-match ".+" t t)) | |
2670 (goto-char (point-min)) | |
2671 ;; We remove all other options than the "-n" ones. | |
2672 (while (re-search-forward "[ \t]-[^n][^-]*" nil t) | |
2673 (replace-match " ") | |
2674 (forward-char -1)) | |
2675 (goto-char (point-min)) | |
2676 | |
2677 ;; We are only interested in "options -n" lines - we | |
2678 ;; ignore the other option lines. | |
2679 (while (re-search-forward "[ \t]-n" nil t) | |
2680 (setq eol | |
2681 (or (save-excursion | |
2682 (and (re-search-forward "[ \t]-n" (gnus-point-at-eol) t) | |
2683 (- (point) 2))) | |
2684 (gnus-point-at-eol))) | |
2685 ;; Search for all "words"... | |
2686 (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
|
2687 (if (eq (char-after (match-beginning 0)) ?!) |
17493 | 2688 ;; If the word begins with a bang (!), this is a "not" |
2689 ;; spec. We put this spec (minus the bang) and the | |
2690 ;; symbol `ignore' into the list. | |
2691 (push (cons (concat | |
2692 "^" (buffer-substring | |
2693 (1+ (match-beginning 0)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2694 (match-end 0)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2695 "\\($\\|\\.\\)") |
17493 | 2696 'ignore) |
2697 out) | |
2698 ;; 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
|
2699 (push (cons (concat "^" (match-string 0) "\\($\\|\\.\\)") |
17493 | 2700 'subscribe) |
2701 out)))) | |
2702 | |
2703 (setq gnus-newsrc-options-n out)))) | |
2704 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2705 (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
|
2706 (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
|
2707 (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
|
2708 '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
|
2709 (lambda () t)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2710 |
17493 | 2711 (defun gnus-save-newsrc-file (&optional force) |
2712 "Save .newsrc file." | |
2713 ;; Note: We cannot save .newsrc file if all newsgroups are removed | |
2714 ;; from the variable gnus-newsrc-alist. | |
2715 (when (and (or gnus-newsrc-alist gnus-killed-list) | |
2716 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
|
2717 ;; 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
|
2718 (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
|
2719 (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
|
2720 |
17493 | 2721 (save-excursion |
2722 (if (and (or gnus-use-dribble-file gnus-slave) | |
2723 (not force) | |
2724 (or (not gnus-dribble-buffer) | |
2725 (not (buffer-name gnus-dribble-buffer)) | |
2726 (zerop (save-excursion | |
2727 (set-buffer gnus-dribble-buffer) | |
2728 (buffer-size))))) | |
2729 (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
|
2730 (gnus-run-hooks 'gnus-save-newsrc-hook) |
17493 | 2731 (if gnus-slave |
2732 (gnus-slave-save-newsrc) | |
2733 ;; Save .newsrc. | |
2734 (when gnus-save-newsrc-file | |
2735 (gnus-message 8 "Saving %s..." gnus-current-startup-file) | |
2736 (gnus-gnus-to-newsrc-format) | |
2737 (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
|
2738 |
17493 | 2739 ;; Save .newsrc.eld. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2740 (set-buffer (gnus-get-buffer-create " *Gnus-newsrc*")) |
17493 | 2741 (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
|
2742 (setq version-control gnus-backup-startup-file) |
17493 | 2743 (setq buffer-file-name |
2744 (concat gnus-current-startup-file ".eld")) | |
2745 (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
|
2746 (buffer-disable-undo) |
17493 | 2747 (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
|
2748 (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
|
2749 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2750 (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
|
2751 (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
|
2752 (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
|
2753 (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
|
2754 (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
|
2755 (save-buffer)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2756 (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
|
2757 (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
|
2758 (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
|
2759 (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
|
2760 working-file |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2761 (i -1)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2762 ;; 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
|
2763 (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
|
2764 (format |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2765 (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
|
2766 (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
|
2767 "%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
|
2768 (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
|
2769 "%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
|
2770 "%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
|
2771 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
|
2772 (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
|
2773 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2774 (unwind-protect |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2775 (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2776 (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
|
2777 (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
|
2778 (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
|
2779 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2780 ;; 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
|
2781 ;; 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
|
2782 ;; file. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2783 (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
|
2784 (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
|
2785 (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
|
2786 (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
|
2787 ;; 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
|
2788 (backup-buffer) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2789 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2790 ;; 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
|
2791 (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
|
2792 (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
|
2793 (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
|
2794 (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
|
2795 (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
|
2796 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2797 (gnus-kill-buffer (current-buffer)) |
17493 | 2798 (gnus-message |
2799 5 "Saving %s.eld...done" gnus-current-startup-file)) | |
2800 (gnus-dribble-delete-file) | |
2801 (gnus-group-set-mode-line))))) | |
2802 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2803 (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
|
2804 "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
|
2805 (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
|
2806 (if name |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2807 (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
|
2808 (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
|
2809 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2810 (unless minimal |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2811 (princ "\ |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2812 ;; 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
|
2813 ;; .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
|
2814 (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
|
2815 (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
|
2816 (princ ")\n")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2817 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2818 (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
|
2819 (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
|
2820 (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
|
2821 (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
|
2822 (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
|
2823 (print-level nil) |
68129
6f5da26b0df1
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Miles Bader <miles@gnu.org>
parents:
67643
diff
changeset
|
2824 (print-circle nil) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2825 (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
|
2826 (gnus-killed-list |
17493 | 2827 (if (and gnus-save-killed-list |
2828 (stringp gnus-save-killed-list)) | |
2829 (gnus-strip-killed-list) | |
2830 gnus-killed-list)) | |
2831 (variables | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2832 (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
|
2833 (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
|
2834 ;; 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
|
2835 ;; 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
|
2836 (delq 'gnus-killed-list (copy-sequence gnus-variable-list))))) |
17493 | 2837 ;; Peel off the "dummy" group. |
2838 (gnus-newsrc-alist (cdr gnus-newsrc-alist)) | |
2839 variable) | |
2840 ;; Insert the variables into the file. | |
2841 (while variables | |
2842 (when (and (boundp (setq variable (pop variables))) | |
2843 (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
|
2844 (princ "(setq ") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2845 (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
|
2846 (princ " '") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2847 (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
|
2848 (princ ")\n"))))) |
17493 | 2849 |
2850 (defun gnus-strip-killed-list () | |
2851 "Return the killed list minus the groups that match `gnus-save-killed-list'." | |
2852 (let ((list gnus-killed-list) | |
2853 olist) | |
2854 (while list | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2855 (when (string-match gnus-save-killed-list (car list)) |
17493 | 2856 (push (car list) olist)) |
2857 (pop list)) | |
2858 (nreverse olist))) | |
2859 | |
2860 (defun gnus-gnus-to-newsrc-format () | |
2861 ;; Generate and save the .newsrc file. | |
2862 (save-excursion | |
2863 (set-buffer (create-file-buffer gnus-current-startup-file)) | |
2864 (let ((newsrc (cdr gnus-newsrc-alist)) | |
2865 (standard-output (current-buffer)) | |
2866 info ranges range method) | |
2867 (setq buffer-file-name gnus-current-startup-file) | |
2868 (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
|
2869 (buffer-disable-undo) |
17493 | 2870 (erase-buffer) |
2871 ;; Write options. | |
2872 (when gnus-newsrc-options | |
2873 (insert gnus-newsrc-options)) | |
2874 ;; Write subscribed and unsubscribed. | |
2875 (while (setq info (pop newsrc)) | |
2876 ;; Don't write foreign groups to .newsrc. | |
2877 (when (or (null (setq method (gnus-info-method info))) | |
2878 (equal method "native") | |
2879 (inline (gnus-server-equal method gnus-select-method))) | |
2880 (insert (gnus-info-group info) | |
2881 (if (> (gnus-info-level info) gnus-level-subscribed) | |
2882 "!" ":")) | |
2883 (when (setq ranges (gnus-info-read info)) | |
2884 (insert " ") | |
2885 (if (not (listp (cdr ranges))) | |
2886 (if (= (car ranges) (cdr ranges)) | |
2887 (princ (car ranges)) | |
2888 (princ (car ranges)) | |
2889 (insert "-") | |
2890 (princ (cdr ranges))) | |
2891 (while (setq range (pop ranges)) | |
2892 (if (or (atom range) (= (car range) (cdr range))) | |
2893 (princ (or (and (atom range) range) (car range))) | |
2894 (princ (car range)) | |
2895 (insert "-") | |
2896 (princ (cdr range))) | |
2897 (when ranges | |
2898 (insert ","))))) | |
2899 (insert "\n"))) | |
2900 (make-local-variable 'version-control) | |
2901 (setq version-control 'never) | |
2902 ;; It has been reported that sometime the modtime on the .newsrc | |
2903 ;; file seems to be off. We really do want to overwrite it, so | |
2904 ;; we clear the modtime here before saving. It's a bit odd, | |
2905 ;; though... | |
2906 ;; sometimes the modtime clear isn't sufficient. most brute force: | |
2907 ;; delete the silly thing entirely first. but this fails to provide | |
2908 ;; such niceties as .newsrc~ creation. | |
2909 (if gnus-modtime-botch | |
2910 (delete-file gnus-startup-file) | |
2911 (clear-visited-file-modtime)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2912 (gnus-run-hooks 'gnus-save-standard-newsrc-hook) |
17493 | 2913 (save-buffer) |
2914 (kill-buffer (current-buffer))))) | |
2915 | |
2916 | |
2917 ;;; | |
2918 ;;; Slave functions. | |
2919 ;;; | |
2920 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2921 (defvar gnus-slave-mode nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2922 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2923 (defun gnus-slave-mode () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2924 "Minor mode for slave Gnusae." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2925 (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
|
2926 (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
|
2927 |
17493 | 2928 (defun gnus-slave-save-newsrc () |
2929 (save-excursion | |
2930 (set-buffer gnus-dribble-buffer) | |
2931 (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
|
2932 (mm-make-temp-file (concat gnus-current-startup-file "-slave-"))) |
17493 | 2933 (modes (ignore-errors |
2934 (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
|
2935 (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
|
2936 (gnus-write-buffer slave-name)) |
17493 | 2937 (when modes |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2938 (set-file-modes slave-name modes))))) |
17493 | 2939 |
2940 (defun gnus-master-read-slave-newsrc () | |
2941 (let ((slave-files | |
2942 (directory-files | |
2943 (file-name-directory gnus-current-startup-file) | |
2944 t (concat | |
2945 "^" (regexp-quote | |
2946 (concat | |
2947 (file-name-nondirectory gnus-current-startup-file) | |
2948 "-slave-"))) | |
2949 t)) | |
2950 file) | |
2951 (if (not slave-files) | |
2952 () ; There are no slave files to read. | |
2953 (gnus-message 7 "Reading slave newsrcs...") | |
2954 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23103
diff
changeset
|
2955 (set-buffer (gnus-get-buffer-create " *gnus slave*")) |
17493 | 2956 (setq slave-files |
2957 (sort (mapcar (lambda (file) | |
2958 (list (nth 5 (file-attributes file)) file)) | |
2959 slave-files) | |
2960 (lambda (f1 f2) | |
2961 (or (< (caar f1) (caar f2)) | |
2962 (< (nth 1 (car f1)) (nth 1 (car f2))))))) | |
2963 (while slave-files | |
2964 (erase-buffer) | |
2965 (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
|
2966 (nnheader-insert-file-contents file) |
17493 | 2967 (when (condition-case () |
2968 (progn | |
2969 (eval-buffer (current-buffer)) | |
2970 t) | |
2971 (error | |
2972 (gnus-error 3.2 "Possible error in %s" file) | |
2973 nil)) | |
2974 (unless gnus-slave ; Slaves shouldn't delete these files. | |
2975 (ignore-errors | |
2976 (delete-file file)))) | |
2977 (setq slave-files (cdr slave-files)))) | |
2978 (gnus-dribble-touch) | |
2979 (gnus-message 7 "Reading slave newsrcs...done")))) | |
2980 | |
2981 | |
2982 ;;; | |
2983 ;;; Group description. | |
2984 ;;; | |
2985 | |
2986 (defun gnus-read-all-descriptions-files () | |
2987 (let ((methods (cons gnus-select-method | |
2988 (nconc | |
2989 (when (gnus-archive-server-wanted-p) | |
2990 (list "archive")) | |
2991 gnus-secondary-select-methods)))) | |
2992 (while methods | |
2993 (gnus-read-descriptions-file (car methods)) | |
2994 (setq methods (cdr methods))) | |
2995 t)) | |
2996 | |
2997 (defun gnus-read-descriptions-file (&optional method) | |
2998 (let ((method (or method gnus-select-method)) | |
2999 group) | |
3000 (when (stringp method) | |
3001 (setq method (gnus-server-to-method method))) | |
3002 ;; We create the hashtable whether we manage to read the desc file | |
3003 ;; to avoid trying to re-read after a failed read. | |
3004 (unless gnus-description-hashtb | |
3005 (setq gnus-description-hashtb | |
3006 (gnus-make-hashtable (length gnus-active-hashtb)))) | |
3007 ;; Mark this method's desc file as read. | |
3008 (gnus-sethash (gnus-group-prefixed-name "" method) "Has read" | |
3009 gnus-description-hashtb) | |
3010 | |
3011 (gnus-message 5 "Reading descriptions file via %s..." (car method)) | |
3012 (cond | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
3013 ((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
|
3014 t) |
17493 | 3015 ((not (gnus-check-server method)) |
3016 (gnus-message 1 "Couldn't open server") | |
3017 nil) | |
3018 ((not (gnus-request-list-newsgroups method)) | |
3019 (gnus-message 1 "Couldn't read newsgroups descriptions") | |
3020 nil) | |
3021 (t | |
3022 (save-excursion | |
3023 (save-restriction | |
3024 (set-buffer nntp-server-buffer) | |
3025 (goto-char (point-min)) | |
3026 (when (or (search-forward "\n.\n" nil t) | |
3027 (goto-char (point-max))) | |
3028 (beginning-of-line) | |
3029 (narrow-to-region (point-min) (point))) | |
3030 ;; If these are groups from a foreign select method, we insert the | |
3031 ;; group prefix in front of the group names. | |
3032 (and method (not (inline | |
3033 (gnus-server-equal | |
3034 (gnus-server-get-method nil method) | |
3035 (gnus-server-get-method | |
3036 nil gnus-select-method)))) | |
3037 (let ((prefix (gnus-group-prefixed-name "" method))) | |
3038 (goto-char (point-min)) | |
3039 (while (and (not (eobp)) | |
3040 (progn (insert prefix) | |
3041 (zerop (forward-line 1))))))) | |
3042 (goto-char (point-min)) | |
3043 (while (not (eobp)) | |
3044 ;; If we get an error, we set group to 0, which is not a | |
3045 ;; symbol... | |
3046 (setq group | |
3047 (condition-case () | |
3048 (let ((obarray gnus-description-hashtb)) | |
3049 ;; Group is set to a symbol interned in this | |
3050 ;; hash table. | |
3051 (read nntp-server-buffer)) | |
3052 (error 0))) | |
3053 (skip-chars-forward " \t") | |
3054 ;; ... which leads to this line being effectively ignored. | |
3055 (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
|
3056 (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
|
3057 (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
|
3058 (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
|
3059 (charset |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
3060 (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
|
3061 (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
|
3062 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
|
3063 ;; 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
|
3064 (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
|
3065 (setq str (mm-decode-coding-string str charset))) |
20235
518f3a9e5812
(gnus-read-descriptions-file): Decode
Kenichi Handa <handa@m17n.org>
parents:
19969
diff
changeset
|
3066 (set group str))) |
17493 | 3067 (forward-line 1)))) |
3068 (gnus-message 5 "Reading descriptions file...done") | |
3069 t)))) | |
3070 | |
3071 (defun gnus-group-get-description (group) | |
3072 "Get the description of a group by sending XGTITLE to the server." | |
3073 (when (gnus-request-group-description group) | |
3074 (save-excursion | |
3075 (set-buffer nntp-server-buffer) | |
3076 (goto-char (point-min)) | |
3077 (when (looking-at "[^ \t]+[ \t]+\\(.*\\)") | |
3078 (match-string 1))))) | |
3079 | |
3080 ;;;###autoload | |
3081 (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
|
3082 "Declare back end NAME with ABILITIES as a Gnus back end." |
17493 | 3083 (setq gnus-valid-select-methods |
3084 (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
|
3085 (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
|
3086 (gnus-redefine-select-method-widget)) |
17493 | 3087 |
3088 (defun gnus-set-default-directory () | |
3089 "Set the default directory in the current buffer to `gnus-default-directory'. | |
3090 If this variable is nil, don't do anything." | |
3091 (setq default-directory | |
3092 (if (and gnus-default-directory | |
3093 (file-exists-p gnus-default-directory)) | |
3094 (file-name-as-directory (expand-file-name gnus-default-directory)) | |
3095 default-directory))) | |
3096 | |
60824
58727a5c98c4
(gnus-display-time-event-handler):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59996
diff
changeset
|
3097 (defun gnus-display-time-event-handler () |
58727a5c98c4
(gnus-display-time-event-handler):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59996
diff
changeset
|
3098 (if (and (fboundp 'display-time-event-handler) |
58727a5c98c4
(gnus-display-time-event-handler):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59996
diff
changeset
|
3099 (gnus-boundp 'display-time-timer)) |
58727a5c98c4
(gnus-display-time-event-handler):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59996
diff
changeset
|
3100 (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
|
3101 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
3102 ;;;###autoload |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
3103 (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
|
3104 (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
|
3105 (mapatoms |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
3106 (lambda (sym) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
3107 (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
|
3108 (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
|
3109 (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
|
3110 (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
|
3111 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
|
3112 (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
|
3113 (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
|
3114 (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
|
3115 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
3116 |
17493 | 3117 (provide 'gnus-start) |
3118 | |
60824
58727a5c98c4
(gnus-display-time-event-handler):
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
59996
diff
changeset
|
3119 ;; arch-tag: f4584a22-b7b7-4853-abfc-a637329af5d2 |
17493 | 3120 ;;; 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
|
3121 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
3122 |