comparison lisp/gnus/gnus-start.el @ 100:4be1180a9e89 r20-1b2

Import from CVS: tag r20-1b2
author cvs
date Mon, 13 Aug 2007 09:15:11 +0200
parents 0d2f883870bc
children cf808b4c4290
comparison
equal deleted inserted replaced
99:2d83cbd90d8d 100:4be1180a9e89
67 67
68 (defcustom gnus-use-dribble-file t 68 (defcustom gnus-use-dribble-file t
69 "*Non-nil means that Gnus will use a dribble file to store user updates. 69 "*Non-nil means that Gnus will use a dribble file to store user updates.
70 If Emacs should crash without saving the .newsrc files, complete 70 If Emacs should crash without saving the .newsrc files, complete
71 information can be restored from the dribble file." 71 information can be restored from the dribble file."
72 :group 'gnus-start 72 :group 'gnus-dribble-file
73 :type 'boolean) 73 :type 'boolean)
74 74
75 (defcustom gnus-dribble-directory nil 75 (defcustom gnus-dribble-directory nil
76 "*The directory where dribble files will be saved. 76 "*The directory where dribble files will be saved.
77 If this variable is nil, the directory where the .newsrc files are 77 If this variable is nil, the directory where the .newsrc files are
78 saved will be used." 78 saved will be used."
79 :group 'gnus-start 79 :group 'gnus-dribble-file
80 :type '(choice directory (const nil))) 80 :type '(choice directory (const nil)))
81 81
82 (defcustom gnus-check-new-newsgroups t 82 (defcustom gnus-check-new-newsgroups t
83 "*Non-nil means that Gnus will run gnus-find-new-newsgroups at startup. 83 "*Non-nil means that Gnus will run gnus-find-new-newsgroups at startup.
84 This normally finds new newsgroups by comparing the active groups the 84 This normally finds new newsgroups by comparing the active groups the
118 118
119 (defcustom gnus-check-bogus-newsgroups nil 119 (defcustom gnus-check-bogus-newsgroups nil
120 "*Non-nil means that Gnus will check and remove bogus newsgroup at startup. 120 "*Non-nil means that Gnus will check and remove bogus newsgroup at startup.
121 If this variable is nil, then you have to tell Gnus explicitly to 121 If this variable is nil, then you have to tell Gnus explicitly to
122 check for bogus newsgroups with \\<gnus-group-mode-map>\\[gnus-group-check-bogus-groups]." 122 check for bogus newsgroups with \\<gnus-group-mode-map>\\[gnus-group-check-bogus-groups]."
123 :group 'gnus-start 123 :group 'gnus-start-server
124 :type 'boolean) 124 :type 'boolean)
125 125
126 (defcustom gnus-read-active-file t 126 (defcustom gnus-read-active-file t
127 "*Non-nil means that Gnus will read the entire active file at startup. 127 "*Non-nil means that Gnus will read the entire active file at startup.
128 If this variable is nil, Gnus will only know about the groups in your 128 If this variable is nil, Gnus will only know about the groups in your
135 135
136 If you set this variable to nil or `some', you probably still want to 136 If you set this variable to nil or `some', you probably still want to
137 be told about new newsgroups that arrive. To do that, set 137 be told about new newsgroups that arrive. To do that, set
138 `gnus-check-new-newsgroups' to `ask-server'. This may not work 138 `gnus-check-new-newsgroups' to `ask-server'. This may not work
139 properly with all servers." 139 properly with all servers."
140 :group 'gnus-start 140 :group 'gnus-start-server
141 :type '(choice (const nil) 141 :type '(choice (const nil)
142 (const some) 142 (const some)
143 (const t))) 143 (const t)))
144 144
145 (defcustom gnus-level-subscribed 5 145 (defcustom gnus-level-subscribed 5
146 "*Groups with levels less than or equal to this variable are subscribed." 146 "*Groups with levels less than or equal to this variable are subscribed."
147 :group 'gnus-start 147 :group 'gnus-group-levels
148 :type 'integer) 148 :type 'integer)
149 149
150 (defcustom gnus-level-unsubscribed 7 150 (defcustom gnus-level-unsubscribed 7
151 "*Groups with levels less than or equal to this variable are unsubscribed. 151 "*Groups with levels less than or equal to this variable are unsubscribed.
152 Groups with levels less than `gnus-level-subscribed', which should be 152 Groups with levels less than `gnus-level-subscribed', which should be
153 less than this variable, are subscribed." 153 less than this variable, are subscribed."
154 :group 'gnus-start 154 :group 'gnus-group-levels
155 :type 'integer) 155 :type 'integer)
156 156
157 (defcustom gnus-level-zombie 8 157 (defcustom gnus-level-zombie 8
158 "*Groups with this level are zombie groups." 158 "*Groups with this level are zombie groups."
159 :group 'gnus-start 159 :group 'gnus-group-levels
160 :type 'integer) 160 :type 'integer)
161 161
162 (defcustom gnus-level-killed 9 162 (defcustom gnus-level-killed 9
163 "*Groups with this level are killed." 163 "*Groups with this level are killed."
164 :group 'gnus-start 164 :group 'gnus-group-levels
165 :type 'integer) 165 :type 'integer)
166 166
167 (defcustom gnus-level-default-subscribed 3 167 (defcustom gnus-level-default-subscribed 3
168 "*New subscribed groups will be subscribed at this level." 168 "*New subscribed groups will be subscribed at this level."
169 :group 'gnus-start 169 :group 'gnus-group-levels
170 :type 'integer) 170 :type 'integer)
171 171
172 (defcustom gnus-level-default-unsubscribed 6 172 (defcustom gnus-level-default-unsubscribed 6
173 "*New unsubscribed groups will be unsubscribed at this level." 173 "*New unsubscribed groups will be unsubscribed at this level."
174 :group 'gnus-start 174 :group 'gnus-group-levels
175 :type 'integer) 175 :type 'integer)
176 176
177 (defcustom gnus-activate-level (1+ gnus-level-subscribed) 177 (defcustom gnus-activate-level (1+ gnus-level-subscribed)
178 "*Groups higher than this level won't be activated on startup. 178 "*Groups higher than this level won't be activated on startup.
179 Setting this variable to something low might save lots of time when 179 Setting this variable to something low might save lots of time when
180 you have many groups that you aren't interested in." 180 you have many groups that you aren't interested in."
181 :group 'gnus-start 181 :group 'gnus-group-levels
182 :type 'integer) 182 :type 'integer)
183 183
184 (defcustom gnus-activate-foreign-newsgroups 4 184 (defcustom gnus-activate-foreign-newsgroups 4
185 "*If nil, Gnus will not check foreign newsgroups at startup. 185 "*If nil, Gnus will not check foreign newsgroups at startup.
186 If it is non-nil, it should be a number between one and nine. Foreign 186 If it is non-nil, it should be a number between one and nine. Foreign
191 191
192 If you subscribe to lots of newsgroups from different servers, startup 192 If you subscribe to lots of newsgroups from different servers, startup
193 might take a while. By setting this variable to nil, you'll save time, 193 might take a while. By setting this variable to nil, you'll save time,
194 but you won't be told how many unread articles there are in the 194 but you won't be told how many unread articles there are in the
195 groups." 195 groups."
196 :group 'gnus-start 196 :group 'gnus-group-levels
197 :type 'integer) 197 :type 'integer)
198 198
199 (defcustom gnus-save-newsrc-file t 199 (defcustom gnus-save-newsrc-file t
200 "*Non-nil means that Gnus will save the `.newsrc' file. 200 "*Non-nil means that Gnus will save the `.newsrc' file.
201 Gnus always saves its own startup file, which is called 201 Gnus always saves its own startup file, which is called
202 \".newsrc.eld\". The file called \".newsrc\" is in a format that can 202 \".newsrc.eld\". The file called \".newsrc\" is in a format that can
203 be readily understood by other newsreaders. If you don't plan on 203 be readily understood by other newsreaders. If you don't plan on
204 using other newsreaders, set this variable to nil to save some time on 204 using other newsreaders, set this variable to nil to save some time on
205 exit." 205 exit."
206 :group 'gnus-start 206 :group 'gnus-newsrc
207 :type 'boolean) 207 :type 'boolean)
208 208
209 (defcustom gnus-save-killed-list t 209 (defcustom gnus-save-killed-list t
210 "*If non-nil, save the list of killed groups to the startup file. 210 "*If non-nil, save the list of killed groups to the startup file.
211 If you set this variable to nil, you'll save both time (when starting 211 If you set this variable to nil, you'll save both time (when starting
216 You should always set `gnus-check-new-newsgroups' to `ask-server' or 216 You should always set `gnus-check-new-newsgroups' to `ask-server' or
217 nil if you set this variable to nil. 217 nil if you set this variable to nil.
218 218
219 This variable can also be a regexp. In that case, all groups that do 219 This variable can also be a regexp. In that case, all groups that do
220 not match this regexp will be removed before saving the list." 220 not match this regexp will be removed before saving the list."
221 :group 'gnus-start 221 :group 'gnus-newsrc
222 :type 'boolean) 222 :type 'boolean)
223 223
224 (defcustom gnus-ignored-newsgroups 224 (defcustom gnus-ignored-newsgroups
225 (purecopy (mapconcat 'identity 225 (purecopy (mapconcat 'identity
226 '("^to\\." ; not "real" groups 226 '("^to\\." ; not "real" groups
230 "\\|")) 230 "\\|"))
231 "A regexp to match uninteresting newsgroups in the active file. 231 "A regexp to match uninteresting newsgroups in the active file.
232 Any lines in the active file matching this regular expression are 232 Any lines in the active file matching this regular expression are
233 removed from the newsgroup list before anything else is done to it, 233 removed from the newsgroup list before anything else is done to it,
234 thus making them effectively non-existent." 234 thus making them effectively non-existent."
235 :group 'gnus-start 235 :group 'gnus-group-new
236 :type 'regexp) 236 :type 'regexp)
237 237
238 (defcustom gnus-subscribe-newsgroup-method 'gnus-subscribe-zombies 238 (defcustom gnus-subscribe-newsgroup-method 'gnus-subscribe-zombies
239 "*Function called with a group name when new group is detected. 239 "*Function called with a group name when new group is detected.
240 A few pre-made functions are supplied: `gnus-subscribe-randomly' 240 A few pre-made functions are supplied: `gnus-subscribe-randomly'
242 `gnus-subscribe-alphabetically' inserts new groups in strict 242 `gnus-subscribe-alphabetically' inserts new groups in strict
243 alphabetic order; `gnus-subscribe-hierarchically' inserts new groups 243 alphabetic order; `gnus-subscribe-hierarchically' inserts new groups
244 in hierarchical newsgroup order; `gnus-subscribe-interactively' asks 244 in hierarchical newsgroup order; `gnus-subscribe-interactively' asks
245 for your decision; `gnus-subscribe-killed' kills all new groups; 245 for your decision; `gnus-subscribe-killed' kills all new groups;
246 `gnus-subscribe-zombies' will make all new groups into zombies." 246 `gnus-subscribe-zombies' will make all new groups into zombies."
247 :group 'gnus-start 247 :group 'gnus-group-new
248 :type '(radio (function-item gnus-subscribe-randomly) 248 :type '(radio (function-item gnus-subscribe-randomly)
249 (function-item gnus-subscribe-alphabetically) 249 (function-item gnus-subscribe-alphabetically)
250 (function-item gnus-subscribe-hierarchically) 250 (function-item gnus-subscribe-hierarchically)
251 (function-item gnus-subscribe-interactively) 251 (function-item gnus-subscribe-interactively)
252 (function-item gnus-subscribe-killed) 252 (function-item gnus-subscribe-killed)
264 264
265 options -n no.all alt.all 265 options -n no.all alt.all
266 266
267 Gnus will the subscribe all new newsgroups in these hierarchies with 267 Gnus will the subscribe all new newsgroups in these hierarchies with
268 the subscription method in this variable." 268 the subscription method in this variable."
269 :group 'gnus-start 269 :group 'gnus-group-new
270 :type '(radio (function-item gnus-subscribe-randomly) 270 :type '(radio (function-item gnus-subscribe-randomly)
271 (function-item gnus-subscribe-alphabetically) 271 (function-item gnus-subscribe-alphabetically)
272 (function-item gnus-subscribe-hierarchically) 272 (function-item gnus-subscribe-hierarchically)
273 (function-item gnus-subscribe-interactively) 273 (function-item gnus-subscribe-interactively)
274 (function-item gnus-subscribe-killed) 274 (function-item gnus-subscribe-killed)
282 'alt.binaries': Do you want to subscribe to this hierarchy? ([d]ys): 282 'alt.binaries': Do you want to subscribe to this hierarchy? ([d]ys):
283 283
284 If the user pressed `d', Gnus will descend the hierarchy, `y' will 284 If the user pressed `d', Gnus will descend the hierarchy, `y' will
285 subscribe to all newsgroups in the hierarchy and `s' will skip this 285 subscribe to all newsgroups in the hierarchy and `s' will skip this
286 hierarchy in its entirety." 286 hierarchy in its entirety."
287 :group 'gnus-start 287 :group 'gnus-group-new
288 :type 'boolean) 288 :type 'boolean)
289 289
290 (defcustom gnus-auto-subscribed-groups 290 (defcustom gnus-auto-subscribed-groups
291 "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl" 291 "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl"
292 "*All new groups that match this regexp will be subscribed automatically. 292 "*All new groups that match this regexp will be subscribed automatically.
294 whatsoever on old groups. 294 whatsoever on old groups.
295 295
296 New groups that match this regexp will not be handled by 296 New groups that match this regexp will not be handled by
297 `gnus-subscribe-newsgroup-method'. Instead, they will 297 `gnus-subscribe-newsgroup-method'. Instead, they will
298 be subscribed using `gnus-subscribe-options-newsgroup-method'." 298 be subscribed using `gnus-subscribe-options-newsgroup-method'."
299 :group 'gnus-start 299 :group 'gnus-group-new
300 :type 'regexp) 300 :type 'regexp)
301 301
302 (defcustom gnus-options-subscribe nil 302 (defcustom gnus-options-subscribe nil
303 "*All new groups matching this regexp will be subscribed unconditionally. 303 "*All new groups matching this regexp will be subscribed unconditionally.
304 Note that this variable deals only with new newsgroups. This variable 304 Note that this variable deals only with new newsgroups. This variable
305 does not affect old newsgroups. 305 does not affect old newsgroups.
306 306
307 New groups that match this regexp will not be handled by 307 New groups that match this regexp will not be handled by
308 `gnus-subscribe-newsgroup-method'. Instead, they will 308 `gnus-subscribe-newsgroup-method'. Instead, they will
309 be subscribed using `gnus-subscribe-options-newsgroup-method'." 309 be subscribed using `gnus-subscribe-options-newsgroup-method'."
310 :group 'gnus-start 310 :group 'gnus-group-new
311 :type '(choice regexp 311 :type '(choice regexp
312 (const :tag "none" nil))) 312 (const :tag "none" nil)))
313 313
314 (defcustom gnus-options-not-subscribe nil 314 (defcustom gnus-options-not-subscribe nil
315 "*All new groups matching this regexp will be ignored. 315 "*All new groups matching this regexp will be ignored.
316 Note that this variable deals only with new newsgroups. This variable 316 Note that this variable deals only with new newsgroups. This variable
317 does not affect old (already subscribed) newsgroups." 317 does not affect old (already subscribed) newsgroups."
318 :group 'gnus-start 318 :group 'gnus-group-new
319 :type '(choice regexp 319 :type '(choice regexp
320 (const :tag "none" nil))) 320 (const :tag "none" nil)))
321 321
322 (defcustom gnus-modtime-botch nil 322 (defcustom gnus-modtime-botch nil
323 "*Non-nil means .newsrc should be deleted prior to save. 323 "*Non-nil means .newsrc should be deleted prior to save.
324 Its use is due to the bogus appearance that .newsrc was modified on 324 Its use is due to the bogus appearance that .newsrc was modified on
325 disc." 325 disc."
326 :group 'gnus-start 326 :group 'gnus-newsrc
327 :type 'boolean) 327 :type 'boolean)
328 328
329 (defcustom gnus-check-bogus-groups-hook nil 329 (defcustom gnus-check-bogus-groups-hook nil
330 "A hook run after removing bogus groups." 330 "A hook run after removing bogus groups."
331 :group 'gnus-start 331 :group 'gnus-start-server
332 :type 'hook) 332 :type 'hook)
333 333
334 (defcustom gnus-startup-hook nil 334 (defcustom gnus-startup-hook nil
335 "A hook called at startup. 335 "A hook called at startup.
336 This hook is called after Gnus is connected to the NNTP server." 336 This hook is called after Gnus is connected to the NNTP server."
337 :group 'gnus-start 337 :group 'gnus-start
338 :type 'hook) 338 :type 'hook)
339 339
340 (defcustom gnus-get-new-news-hook nil 340 (defcustom gnus-get-new-news-hook nil
341 "A hook run just before Gnus checks for new news." 341 "A hook run just before Gnus checks for new news."
342 :group 'gnus-start 342 :group 'gnus-group-new
343 :type 'hook) 343 :type 'hook)
344 344
345 (defcustom gnus-after-getting-new-news-hook 345 (defcustom gnus-after-getting-new-news-hook
346 (when (gnus-boundp 'display-time-timer) 346 (when (gnus-boundp 'display-time-timer)
347 '(display-time-event-handler)) 347 '(display-time-event-handler))
348 "A hook run after Gnus checks for new news." 348 "A hook run after Gnus checks for new news."
349 :group 'gnus-start 349 :group 'gnus-group-new
350 :type 'hook) 350 :type 'hook)
351 351
352 (defcustom gnus-save-newsrc-hook nil 352 (defcustom gnus-save-newsrc-hook nil
353 "A hook called before saving any of the newsrc files." 353 "A hook called before saving any of the newsrc files."
354 :group 'gnus-start 354 :group 'gnus-newsrc
355 :type 'hook) 355 :type 'hook)
356 356
357 (defcustom gnus-save-quick-newsrc-hook nil 357 (defcustom gnus-save-quick-newsrc-hook nil
358 "A hook called just before saving the quick newsrc file. 358 "A hook called just before saving the quick newsrc file.
359 Can be used to turn version control on or off." 359 Can be used to turn version control on or off."
360 :group 'gnus-start 360 :group 'gnus-newsrc
361 :type 'hook) 361 :type 'hook)
362 362
363 (defcustom gnus-save-standard-newsrc-hook nil 363 (defcustom gnus-save-standard-newsrc-hook nil
364 "A hook called just before saving the standard newsrc file. 364 "A hook called just before saving the standard newsrc file.
365 Can be used to turn version control on or off." 365 Can be used to turn version control on or off."
366 :group 'gnus-start 366 :group 'gnus-newsrc
367 :type 'hook) 367 :type 'hook)
368 368
369 ;;; Internal variables 369 ;;; Internal variables
370 370
371 (defvar gnus-newsrc-file-version nil) 371 (defvar gnus-newsrc-file-version nil)
755 (when (and (file-exists-p gnus-current-startup-file) 755 (when (and (file-exists-p gnus-current-startup-file)
756 (setq modes (file-modes gnus-current-startup-file))) 756 (setq modes (file-modes gnus-current-startup-file)))
757 (set-file-modes dribble-file modes)) 757 (set-file-modes dribble-file modes))
758 ;; Possibly eval the file later. 758 ;; Possibly eval the file later.
759 (when (gnus-y-or-n-p 759 (when (gnus-y-or-n-p
760 "Auto-save file exists. Do you want to read it? ") 760 "Gnus auto-save file exists. Do you want to read it? ")
761 (setq gnus-dribble-eval-file t))))))) 761 (setq gnus-dribble-eval-file t)))))))
762 762
763 (defun gnus-dribble-eval-file () 763 (defun gnus-dribble-eval-file ()
764 (when gnus-dribble-eval-file 764 (when gnus-dribble-eval-file
765 (setq gnus-dribble-eval-file nil) 765 (setq gnus-dribble-eval-file nil)
1214 newsgroup." 1214 newsgroup."
1215 (let ((newsrc (cdr gnus-newsrc-alist)) 1215 (let ((newsrc (cdr gnus-newsrc-alist))
1216 bogus group entry info) 1216 bogus group entry info)
1217 (gnus-message 5 "Checking bogus newsgroups...") 1217 (gnus-message 5 "Checking bogus newsgroups...")
1218 (unless (gnus-read-active-file-p) 1218 (unless (gnus-read-active-file-p)
1219 (gnus-read-active-file)) 1219 (gnus-read-active-file t))
1220 (when (gnus-read-active-file-p) 1220 (when (gnus-read-active-file-p)
1221 ;; Find all bogus newsgroup that are subscribed. 1221 ;; Find all bogus newsgroup that are subscribed.
1222 (while newsrc 1222 (while newsrc
1223 (setq info (pop newsrc) 1223 (setq info (pop newsrc)
1224 group (gnus-info-group info)) 1224 group (gnus-info-group info))
1539 (gnus-sethash group group gnus-killed-hashtb)))))) 1539 (gnus-sethash group group gnus-killed-hashtb))))))
1540 gnus-active-hashtb) 1540 gnus-active-hashtb)
1541 (gnus-dribble-touch)) 1541 (gnus-dribble-touch))
1542 1542
1543 ;; Get the active file(s) from the backend(s). 1543 ;; Get the active file(s) from the backend(s).
1544 (defun gnus-read-active-file () 1544 (defun gnus-read-active-file (&optional force)
1545 (gnus-group-set-mode-line) 1545 (gnus-group-set-mode-line)
1546 (let ((methods 1546 (let ((methods
1547 (append 1547 (append
1548 (if (gnus-check-server gnus-select-method) 1548 (if (gnus-check-server gnus-select-method)
1549 ;; The native server is available. 1549 ;; The native server is available.
1572 ;; Request that the backend scan its incoming messages. 1572 ;; Request that the backend scan its incoming messages.
1573 (when (gnus-check-backend-function 'request-scan (car method)) 1573 (when (gnus-check-backend-function 'request-scan (car method))
1574 (gnus-request-scan nil method)) 1574 (gnus-request-scan nil method))
1575 (cond 1575 (cond
1576 ((and (eq gnus-read-active-file 'some) 1576 ((and (eq gnus-read-active-file 'some)
1577 (gnus-check-backend-function 'retrieve-groups (car method))) 1577 (gnus-check-backend-function 'retrieve-groups (car method))
1578 (not force))
1578 (let ((newsrc (cdr gnus-newsrc-alist)) 1579 (let ((newsrc (cdr gnus-newsrc-alist))
1579 (gmethod (gnus-server-get-method nil method)) 1580 (gmethod (gnus-server-get-method nil method))
1580 groups info) 1581 groups info)
1581 (while (setq info (pop newsrc)) 1582 (while (setq info (pop newsrc))
1582 (when (gnus-server-equal 1583 (when (gnus-server-equal