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