Synch with Oort Gnus.
[elisp/gnus.git-] / lisp / gnus.el
1 ;;; gnus.el --- a newsreader for GNU Emacs
2
3 ;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996, 1997,
4 ;; 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
5
6 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
7 ;;      Lars Magne Ingebrigtsen <larsi@gnus.org>
8 ;;      Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
9 ;;      Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp>
10 ;; Keywords: news, mail
11
12 ;; This file is part of GNU Emacs.
13
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; any later version.
18
19 ;; GNU Emacs is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 ;; GNU General Public License for more details.
23
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27 ;; Boston, MA 02111-1307, USA.
28
29 ;;; Commentary:
30
31 ;;; Code:
32
33 (eval '(run-hooks 'gnus-load-hook))
34
35 (eval-when-compile (require 'cl))
36 (eval-when-compile (require 'static))
37
38 (require 'wid-edit)
39 (require 'nnheader)
40
41 (require 'gnus-vers)
42
43 (defgroup gnus nil
44   "The coffee-brewing, all singing, all dancing, kitchen sink newsreader."
45   :group 'news
46   :group 'mail)
47
48 (defgroup gnus-format nil
49   "Dealing with formatting issues."
50   :group 'news
51   :group 'mail)
52
53 (defgroup gnus-charset nil
54   "Group character set issues."
55   :link '(custom-manual "(gnus)Charsets")
56   :version "21.1"
57   :group 'gnus)
58
59 (defgroup gnus-cache nil
60   "Cache interface."
61   :group 'gnus)
62
63 (defgroup gnus-start nil
64   "Starting your favorite newsreader."
65   :group 'gnus)
66
67 (defgroup gnus-start-server nil
68   "Server options at startup."
69   :group 'gnus-start)
70
71 ;; These belong to gnus-group.el.
72 (defgroup gnus-group nil
73   "Group buffers."
74   :link '(custom-manual "(gnus)The Group Buffer")
75   :group 'gnus)
76
77 (defgroup gnus-group-foreign nil
78   "Foreign groups."
79   :link '(custom-manual "(gnus)Foreign Groups")
80   :group 'gnus-group)
81
82 (defgroup gnus-group-new nil
83   "Automatic subscription of new groups."
84   :group 'gnus-group)
85
86 (defgroup gnus-group-levels nil
87   "Group levels."
88   :link '(custom-manual "(gnus)Group Levels")
89   :group 'gnus-group)
90
91 (defgroup gnus-group-select nil
92   "Selecting a Group."
93   :link '(custom-manual "(gnus)Selecting a Group")
94   :group 'gnus-group)
95
96 (defgroup gnus-group-listing nil
97   "Showing slices of the group list."
98   :link '(custom-manual "(gnus)Listing Groups")
99   :group 'gnus-group)
100
101 (defgroup gnus-group-visual nil
102   "Sorting the group buffer."
103   :link '(custom-manual "(gnus)Group Buffer Format")
104   :group 'gnus-group
105   :group 'gnus-visual)
106
107 (defgroup gnus-group-various nil
108   "Various group options."
109   :link '(custom-manual "(gnus)Scanning New Messages")
110   :group 'gnus-group)
111
112 ;; These belong to gnus-sum.el.
113 (defgroup gnus-summary nil
114   "Summary buffers."
115   :link '(custom-manual "(gnus)The Summary Buffer")
116   :group 'gnus)
117
118 (defgroup gnus-summary-exit nil
119   "Leaving summary buffers."
120   :link '(custom-manual "(gnus)Exiting the Summary Buffer")
121   :group 'gnus-summary)
122
123 (defgroup gnus-summary-marks nil
124   "Marks used in summary buffers."
125   :link '(custom-manual "(gnus)Marking Articles")
126   :group 'gnus-summary)
127
128 (defgroup gnus-thread nil
129   "Ordering articles according to replies."
130   :link '(custom-manual "(gnus)Threading")
131   :group 'gnus-summary)
132
133 (defgroup gnus-summary-format nil
134   "Formatting of the summary buffer."
135   :link '(custom-manual "(gnus)Summary Buffer Format")
136   :group 'gnus-summary)
137
138 (defgroup gnus-summary-choose nil
139   "Choosing Articles."
140   :link '(custom-manual "(gnus)Choosing Articles")
141   :group 'gnus-summary)
142
143 (defgroup gnus-summary-maneuvering nil
144   "Summary movement commands."
145   :link '(custom-manual "(gnus)Summary Maneuvering")
146   :group 'gnus-summary)
147
148 (defgroup gnus-picon nil
149   "Show pictures of people, domains, and newsgroups."
150   :group 'gnus-visual)
151
152 (defgroup gnus-summary-mail nil
153   "Mail group commands."
154   :link '(custom-manual "(gnus)Mail Group Commands")
155   :group 'gnus-summary)
156
157 (defgroup gnus-summary-sort nil
158   "Sorting the summary buffer."
159   :link '(custom-manual "(gnus)Sorting")
160   :group 'gnus-summary)
161
162 (defgroup gnus-summary-visual nil
163   "Highlighting and menus in the summary buffer."
164   :link '(custom-manual "(gnus)Summary Highlighting")
165   :group 'gnus-visual
166   :group 'gnus-summary)
167
168 (defgroup gnus-summary-various nil
169   "Various summary buffer options."
170   :link '(custom-manual "(gnus)Various Summary Stuff")
171   :group 'gnus-summary)
172
173 (defgroup gnus-summary-pick nil
174   "Pick mode in the summary buffer."
175   :link '(custom-manual "(gnus)Pick and Read")
176   :prefix "gnus-pick-"
177   :group 'gnus-summary)
178
179 (defgroup gnus-summary-tree nil
180   "Tree display of threads in the summary buffer."
181   :link '(custom-manual "(gnus)Tree Display")
182   :prefix "gnus-tree-"
183   :group 'gnus-summary)
184
185 ;; Belongs to gnus-uu.el
186 (defgroup gnus-extract-view nil
187   "Viewing extracted files."
188   :link '(custom-manual "(gnus)Viewing Files")
189   :group 'gnus-extract)
190
191 ;; Belongs to gnus-score.el
192 (defgroup gnus-score nil
193   "Score and kill file handling."
194   :group 'gnus)
195
196 (defgroup gnus-score-kill nil
197   "Kill files."
198   :group 'gnus-score)
199
200 (defgroup gnus-score-adapt nil
201   "Adaptive score files."
202   :group 'gnus-score)
203
204 (defgroup gnus-score-default nil
205   "Default values for score files."
206   :group 'gnus-score)
207
208 (defgroup gnus-score-expire nil
209   "Expiring score rules."
210   :group 'gnus-score)
211
212 (defgroup gnus-score-decay nil
213   "Decaying score rules."
214   :group 'gnus-score)
215
216 (defgroup gnus-score-files nil
217   "Score and kill file names."
218   :group 'gnus-score
219   :group 'gnus-files)
220
221 (defgroup gnus-score-various nil
222   "Various scoring and killing options."
223   :group 'gnus-score)
224
225 ;; Other
226 (defgroup gnus-visual nil
227   "Options controlling the visual fluff."
228   :group 'gnus
229   :group 'faces)
230
231 (defgroup gnus-agent nil
232   "Offline support for Gnus."
233   :group 'gnus)
234
235 (defgroup gnus-files nil
236   "Files used by Gnus."
237   :group 'gnus)
238
239 (defgroup gnus-dribble-file nil
240   "Auto save file."
241   :link '(custom-manual "(gnus)Auto Save")
242   :group 'gnus-files)
243
244 (defgroup gnus-newsrc nil
245   "Storing Gnus state."
246   :group 'gnus-files)
247
248 (defgroup gnus-server nil
249   "Options related to newsservers and other servers used by Gnus."
250   :group 'gnus)
251
252 (defgroup gnus-server-visual nil
253   "Highlighting and menus in the server buffer."
254   :group 'gnus-visual
255   :group 'gnus-server)
256
257 (defgroup gnus-message '((message custom-group))
258   "Composing replies and followups in Gnus."
259   :group 'gnus)
260
261 (defgroup gnus-meta nil
262   "Meta variables controlling major portions of Gnus.
263 In general, modifying these variables does not take affect until Gnus
264 is restarted, and sometimes reloaded."
265   :group 'gnus)
266
267 (defgroup gnus-various nil
268   "Other Gnus options."
269   :link '(custom-manual "(gnus)Various Various")
270   :group 'gnus)
271
272 (defgroup gnus-mime nil
273   "Variables for controlling the Gnus MIME interface."
274   :group 'gnus)
275
276 (defgroup gnus-exit nil
277   "Exiting gnus."
278   :link '(custom-manual "(gnus)Exiting Gnus")
279   :group 'gnus)
280
281 (defgroup gnus-fun nil
282   "Frivolous Gnus extensions."
283   :link '(custom-manual "(gnus)Exiting Gnus")
284   :group 'gnus)
285
286 (defcustom gnus-inhibit-startup-message nil
287   "If non-nil, the startup message will not be displayed.
288 This variable is used before `.gnus.el' is loaded, so it should
289 be set in `.emacs' instead."
290   :group 'gnus-start
291   :type 'boolean)
292
293 (defcustom gnus-play-startup-jingle nil
294   "If non-nil, play the Gnus jingle at startup."
295   :group 'gnus-start
296   :type 'boolean)
297
298 (unless (fboundp 'gnus-group-remove-excess-properties)
299   (defalias 'gnus-group-remove-excess-properties 'ignore))
300
301 (unless (fboundp 'gnus-set-text-properties)
302   (defalias 'gnus-set-text-properties 'set-text-properties))
303
304 (unless (featurep 'gnus-xmas)
305   (defalias 'gnus-make-overlay 'make-overlay)
306   (defalias 'gnus-delete-overlay 'delete-overlay)
307   (defalias 'gnus-overlay-put 'overlay-put)
308   (defalias 'gnus-move-overlay 'move-overlay)
309   (defalias 'gnus-overlay-buffer 'overlay-buffer)
310   (defalias 'gnus-overlay-start 'overlay-start)
311   (defalias 'gnus-overlay-end 'overlay-end)
312   (defalias 'gnus-extent-detached-p 'ignore)
313   (defalias 'gnus-extent-start-open 'ignore)
314   (defalias 'gnus-appt-select-lowest-window 'appt-select-lowest-window)
315   (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
316   (defalias 'gnus-character-to-event 'identity)
317   (defalias 'gnus-add-text-properties 'add-text-properties)
318   (defalias 'gnus-put-text-property 'put-text-property)
319   (defvar gnus-mode-line-image-cache t)
320   (if (fboundp 'find-image)
321       (defun gnus-mode-line-buffer-identification (line)
322         (let ((str (car-safe line)))
323           (if (and (stringp str)
324                    (string-match "^Gnus:" str))
325               (progn (add-text-properties
326                       0 5
327                       (list 'display
328                             (if (eq t gnus-mode-line-image-cache)
329                                 (setq gnus-mode-line-image-cache
330                                       (find-image
331                                        '((:type xpm :file "gnus-pointer.xpm"
332                                                 :ascent center)
333                                          (:type xbm :file "gnus-pointer.xbm"
334                                                 :ascent center))))
335                               gnus-mode-line-image-cache)
336                             'help-echo "This is Gnus")
337                       str)
338                      (list str))
339             line)))
340     (defalias 'gnus-mode-line-buffer-identification 'identity))
341   (defalias 'gnus-characterp 'numberp)
342   (defalias 'gnus-deactivate-mark 'deactivate-mark)
343   (defalias 'gnus-window-edges 'window-edges)
344   (defalias 'gnus-key-press-event-p 'numberp)
345   ;;(defalias 'gnus-decode-rfc1522 'ignore)
346   )
347
348 ;; We define these group faces here to avoid the display
349 ;; update forced when creating new faces.
350
351 (defface gnus-group-news-1-face
352   '((((class color)
353       (background dark))
354      (:foreground "PaleTurquoise" :bold t))
355     (((class color)
356       (background light))
357      (:foreground "ForestGreen" :bold t))
358     (t
359      ()))
360   "Level 1 newsgroup face.")
361
362 (defface gnus-group-news-1-empty-face
363   '((((class color)
364       (background dark))
365      (:foreground "PaleTurquoise"))
366     (((class color)
367       (background light))
368      (:foreground "ForestGreen"))
369     (t
370      ()))
371   "Level 1 empty newsgroup face.")
372
373 (defface gnus-group-news-2-face
374   '((((class color)
375       (background dark))
376      (:foreground "turquoise" :bold t))
377     (((class color)
378       (background light))
379      (:foreground "CadetBlue4" :bold t))
380     (t
381      ()))
382   "Level 2 newsgroup face.")
383
384 (defface gnus-group-news-2-empty-face
385   '((((class color)
386       (background dark))
387      (:foreground "turquoise"))
388     (((class color)
389       (background light))
390      (:foreground "CadetBlue4"))
391     (t
392      ()))
393   "Level 2 empty newsgroup face.")
394
395 (defface gnus-group-news-3-face
396   '((((class color)
397       (background dark))
398      (:bold t))
399     (((class color)
400       (background light))
401      (:bold t))
402     (t
403      ()))
404   "Level 3 newsgroup face.")
405
406 (defface gnus-group-news-3-empty-face
407   '((((class color)
408       (background dark))
409      ())
410     (((class color)
411       (background light))
412      ())
413     (t
414      ()))
415   "Level 3 empty newsgroup face.")
416
417 (defface gnus-group-news-4-face
418   '((((class color)
419       (background dark))
420      (:bold t))
421     (((class color)
422       (background light))
423      (:bold t))
424     (t
425      ()))
426   "Level 4 newsgroup face.")
427
428 (defface gnus-group-news-4-empty-face
429   '((((class color)
430       (background dark))
431      ())
432     (((class color)
433       (background light))
434      ())
435     (t
436      ()))
437   "Level 4 empty newsgroup face.")
438
439 (defface gnus-group-news-5-face
440   '((((class color)
441       (background dark))
442      (:bold t))
443     (((class color)
444       (background light))
445      (:bold t))
446     (t
447      ()))
448   "Level 5 newsgroup face.")
449
450 (defface gnus-group-news-5-empty-face
451   '((((class color)
452       (background dark))
453      ())
454     (((class color)
455       (background light))
456      ())
457     (t
458      ()))
459   "Level 5 empty newsgroup face.")
460
461 (defface gnus-group-news-6-face
462   '((((class color)
463       (background dark))
464      (:bold t))
465     (((class color)
466       (background light))
467      (:bold t))
468     (t
469      ()))
470   "Level 6 newsgroup face.")
471
472 (defface gnus-group-news-6-empty-face
473   '((((class color)
474       (background dark))
475      ())
476     (((class color)
477       (background light))
478      ())
479     (t
480      ()))
481   "Level 6 empty newsgroup face.")
482
483 (defface gnus-group-news-low-face
484   '((((class color)
485       (background dark))
486      (:foreground "DarkTurquoise" :bold t))
487     (((class color)
488       (background light))
489      (:foreground "DarkGreen" :bold t))
490     (t
491      ()))
492   "Low level newsgroup face.")
493
494 (defface gnus-group-news-low-empty-face
495   '((((class color)
496       (background dark))
497      (:foreground "DarkTurquoise"))
498     (((class color)
499       (background light))
500      (:foreground "DarkGreen"))
501     (t
502      ()))
503   "Low level empty newsgroup face.")
504
505 (defface gnus-group-mail-1-face
506   '((((class color)
507       (background dark))
508      (:foreground "aquamarine1" :bold t))
509     (((class color)
510       (background light))
511      (:foreground "DeepPink3" :bold t))
512     (t
513      (:bold t)))
514   "Level 1 mailgroup face.")
515
516 (defface gnus-group-mail-1-empty-face
517   '((((class color)
518       (background dark))
519      (:foreground "aquamarine1"))
520     (((class color)
521       (background light))
522      (:foreground "DeepPink3"))
523     (t
524      (:italic t :bold t)))
525   "Level 1 empty mailgroup face.")
526
527 (defface gnus-group-mail-2-face
528   '((((class color)
529       (background dark))
530      (:foreground "aquamarine2" :bold t))
531     (((class color)
532       (background light))
533      (:foreground "HotPink3" :bold t))
534     (t
535      (:bold t)))
536   "Level 2 mailgroup face.")
537
538 (defface gnus-group-mail-2-empty-face
539   '((((class color)
540       (background dark))
541      (:foreground "aquamarine2"))
542     (((class color)
543       (background light))
544      (:foreground "HotPink3"))
545     (t
546      (:bold t)))
547   "Level 2 empty mailgroup face.")
548
549 (defface gnus-group-mail-3-face
550   '((((class color)
551       (background dark))
552      (:foreground "aquamarine3" :bold t))
553     (((class color)
554       (background light))
555      (:foreground "magenta4" :bold t))
556     (t
557      (:bold t)))
558   "Level 3 mailgroup face.")
559
560 (defface gnus-group-mail-3-empty-face
561   '((((class color)
562       (background dark))
563      (:foreground "aquamarine3"))
564     (((class color)
565       (background light))
566      (:foreground "magenta4"))
567     (t
568      ()))
569   "Level 3 empty mailgroup face.")
570
571 (defface gnus-group-mail-low-face
572   '((((class color)
573       (background dark))
574      (:foreground "aquamarine4" :bold t))
575     (((class color)
576       (background light))
577      (:foreground "DeepPink4" :bold t))
578     (t
579      (:bold t)))
580   "Low level mailgroup face.")
581
582 (defface gnus-group-mail-low-empty-face
583   '((((class color)
584       (background dark))
585      (:foreground "aquamarine4"))
586     (((class color)
587       (background light))
588      (:foreground "DeepPink4"))
589     (t
590      (:bold t)))
591   "Low level empty mailgroup face.")
592
593 ;; Summary mode faces.
594
595 (defface gnus-summary-selected-face '((t
596                                        (:underline t)))
597   "Face used for selected articles.")
598
599 (defface gnus-summary-cancelled-face
600   '((((class color))
601      (:foreground "yellow" :background "black")))
602   "Face used for cancelled articles.")
603
604 (defface gnus-summary-high-ticked-face
605   '((((class color)
606       (background dark))
607      (:foreground "pink" :bold t))
608     (((class color)
609       (background light))
610      (:foreground "firebrick" :bold t))
611     (t
612      (:bold t)))
613   "Face used for high interest ticked articles.")
614
615 (defface gnus-summary-low-ticked-face
616   '((((class color)
617       (background dark))
618      (:foreground "pink" :italic t))
619     (((class color)
620       (background light))
621      (:foreground "firebrick" :italic t))
622     (t
623      (:italic t)))
624   "Face used for low interest ticked articles.")
625
626 (defface gnus-summary-normal-ticked-face
627   '((((class color)
628       (background dark))
629      (:foreground "pink"))
630     (((class color)
631       (background light))
632      (:foreground "firebrick"))
633     (t
634      ()))
635   "Face used for normal interest ticked articles.")
636
637 (defface gnus-summary-high-ancient-face
638   '((((class color)
639       (background dark))
640      (:foreground "SkyBlue" :bold t))
641     (((class color)
642       (background light))
643      (:foreground "RoyalBlue" :bold t))
644     (t
645      (:bold t)))
646   "Face used for high interest ancient articles.")
647
648 (defface gnus-summary-low-ancient-face
649   '((((class color)
650       (background dark))
651      (:foreground "SkyBlue" :italic t))
652     (((class color)
653       (background light))
654      (:foreground "RoyalBlue" :italic t))
655     (t
656      (:italic t)))
657   "Face used for low interest ancient articles.")
658
659 (defface gnus-summary-normal-ancient-face
660   '((((class color)
661       (background dark))
662      (:foreground "SkyBlue"))
663     (((class color)
664       (background light))
665      (:foreground "RoyalBlue"))
666     (t
667      ()))
668   "Face used for normal interest ancient articles.")
669
670 (defface gnus-summary-high-undownloaded-face
671    '((((class color)
672        (background light))
673       (:bold t :foreground "cyan4" :bold nil))
674      (((class color) (background dark))
675       (:bold t :foreground "LightGray" :bold nil))
676      (t (:inverse-video t :bold t)))
677   "Face used for high interest uncached articles.")
678
679 (defface gnus-summary-low-undownloaded-face
680    '((((class color)
681        (background light))
682       (:italic t :foreground "cyan4" :bold nil))
683      (((class color) (background dark))
684       (:italic t :foreground "LightGray" :bold nil))
685      (t (:inverse-video t :italic t)))
686   "Face used for low interest uncached articles.")
687
688 (defface gnus-summary-normal-undownloaded-face
689    '((((class color)
690        (background light))
691       (:foreground "cyan4" :bold nil))
692      (((class color) (background dark))
693       (:foreground "LightGray" :bold nil))
694      (t (:inverse-video t)))
695   "Face used for normal interest uncached articles.")
696
697 (defface gnus-summary-high-unread-face
698   '((t
699      (:bold t)))
700   "Face used for high interest unread articles.")
701
702 (defface gnus-summary-low-unread-face
703   '((t
704      (:italic t)))
705   "Face used for low interest unread articles.")
706
707 (defface gnus-summary-normal-unread-face
708   '((t
709      ()))
710   "Face used for normal interest unread articles.")
711
712 (defface gnus-summary-incorporated-face
713   '((t
714      ()))
715   "Face used for incorporated articles.")
716
717 (defface gnus-summary-high-read-face
718   '((((class color)
719       (background dark))
720      (:foreground "PaleGreen"
721                   :bold t))
722     (((class color)
723       (background light))
724      (:foreground "DarkGreen"
725                   :bold t))
726     (t
727      (:bold t)))
728   "Face used for high interest read articles.")
729
730 (defface gnus-summary-low-read-face
731   '((((class color)
732       (background dark))
733      (:foreground "PaleGreen"
734                   :italic t))
735     (((class color)
736       (background light))
737      (:foreground "DarkGreen"
738                   :italic t))
739     (t
740      (:italic t)))
741   "Face used for low interest read articles.")
742
743 (defface gnus-summary-normal-read-face
744   '((((class color)
745       (background dark))
746      (:foreground "PaleGreen"))
747     (((class color)
748       (background light))
749      (:foreground "DarkGreen"))
750     (t
751      ()))
752   "Face used for normal interest read articles.")
753
754
755 ;;;
756 ;;; Gnus buffers
757 ;;;
758
759 (defvar gnus-buffers nil)
760
761 (defun gnus-get-buffer-create (name)
762   "Do the same as `get-buffer-create', but store the created buffer."
763   (or (get-buffer name)
764       (car (push (get-buffer-create name) gnus-buffers))))
765
766 (defun gnus-add-buffer ()
767   "Add the current buffer to the list of Gnus buffers."
768   (push (current-buffer) gnus-buffers))
769
770 (defun gnus-buffers ()
771   "Return a list of live Gnus buffers."
772   (while (and gnus-buffers
773               (not (buffer-name (car gnus-buffers))))
774     (pop gnus-buffers))
775   (let ((buffers gnus-buffers))
776     (while (cdr buffers)
777       (if (buffer-name (cadr buffers))
778           (pop buffers)
779         (setcdr buffers (cddr buffers)))))
780   gnus-buffers)
781
782 ;;; Splash screen.
783
784 (defvar gnus-group-buffer "*Group*")
785
786 (eval-and-compile
787   (autoload 'gnus-play-jingle "gnus-audio"))
788
789 (defface gnus-splash-face
790   '((((class color)
791       (background dark))
792      (:foreground "#888888"))
793     (((class color)
794       (background light))
795      (:foreground "#888888"))
796     (t
797      ()))
798   "Face for the splash screen.")
799
800 (defun gnus-splash ()
801   (save-excursion
802     (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer))
803     (let ((buffer-read-only nil))
804       (erase-buffer)
805       (unless gnus-inhibit-startup-message
806         (gnus-group-startup-message)
807         (sit-for 0)
808         (when gnus-play-startup-jingle
809           (gnus-play-jingle))))))
810
811 (defun gnus-indent-rigidly (start end arg)
812   "Indent rigidly using only spaces and no tabs."
813   (save-excursion
814     (save-restriction
815       (narrow-to-region start end)
816       (let ((tab-width 8))
817         (indent-rigidly start end arg)
818         ;; We translate tabs into spaces -- not everybody uses
819         ;; an 8-character tab.
820         (goto-char (point-min))
821         (while (search-forward "\t" nil t)
822           (replace-match "        " t t))))))
823
824 (defvar gnus-simple-splash nil)
825
826 ;;(format "%02x%02x%02x" 114 66 20) "724214"
827
828 (defvar gnus-logo-color-alist
829   '((flame "#cc3300" "#ff2200")
830     (pine "#c0cc93" "#f8ffb8")
831     (moss "#a1cc93" "#d2ffb8")
832     (irish "#04cc90" "#05ff97")
833     (sky "#049acc" "#05deff")
834     (tin "#6886cc" "#82b6ff")
835     (velvet "#7c68cc" "#8c82ff")
836     (grape "#b264cc" "#cf7df")
837     (labia "#cc64c2" "#fd7dff")
838     (berry "#cc6485" "#ff7db5")
839     (dino "#724214" "#1e3f03")
840     (oort "#cccccc" "#888888")
841     (storm "#666699" "#99ccff")
842     (pdino "#9999cc" "#99ccff")
843     (purp "#9999cc" "#666699")
844     (neutral "#b4b4b4" "#878787")
845     (september "#bf9900" "#ffcc00"))
846   "Color alist used for the Gnus logo.")
847
848 (defcustom gnus-logo-color-style 'oort
849   "*Color styles used for the Gnus logo."
850   :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem)))
851                            gnus-logo-color-alist))
852   :group 'gnus-xmas)
853
854 (defvar gnus-logo-colors
855   (cdr (assq gnus-logo-color-style gnus-logo-color-alist))
856   "Colors used for the Gnus logo.")
857
858 (defun gnus-group-startup-message (&optional x y)
859   "Insert startup message in current buffer."
860   ;; Insert the message.
861   (erase-buffer)
862   (cond
863    ((and (fboundp 'find-image)
864          (display-graphic-p)
865          (let* ((bg (face-background 'default))
866                 (fg (face-foreground 'gnus-splash-face))
867                 (data-directory (nnheader-find-etc-directory "gnus"))
868                 (image (find-image
869                         `((:type xpm :file "gnus.xpm"
870                                  :color-symbols
871                                  (("thing" . ,(car gnus-logo-colors))
872                                   ("shadow" . ,(cadr gnus-logo-colors))
873                                   ("oort" . "#eeeeee")
874                                   ("background" . ,bg)))
875                           (:type pbm :file "gnus.pbm"
876                                  ;; Account for the pbm's blackground.
877                                  :background ,bg :foreground ,fg)
878                           (:type xbm :file "gnus.xbm"
879                                  ;; Account for the xbm's blackground.
880                                  :background ,bg :foreground ,fg)))))
881            (when image
882              (insert
883               (propertize
884                (concat gnus-product-name " " gnus-version-number
885                        (if (zerop (string-to-number gnus-revision-number))
886                            ""
887                          (concat " (r" gnus-revision-number ")"))
888                        " based on " gnus-original-product-name " v"
889                        gnus-original-version-number)
890                'face `(variable-pitch :background ,bg :foreground ,fg)))
891              (let ((fill-column (window-width)))
892                (center-region (point-min) (point)))
893              (let ((size (image-size image)))
894                (insert-char ?\n (max 1 (round (- (window-height)
895                                                  (or y (cdr size))) 2)))
896                (insert
897                 (propertize " " 'display
898                             `(space :align-to
899                                     ,(max 0 (round (- (window-width)
900                                                       (or x (car size))) 2)))))
901                (insert-image image))
902              (setq gnus-simple-splash nil)
903              t))))
904    (t
905     (insert "
906           _    ___ _             _
907           _ ___ __ ___  __    _ ___
908           __   _     ___    __  ___
909               _           ___     _
910              _  _ __             _
911              ___   __            _
912                    __           _
913                     _      _   _
914                    _      _    _
915                       _  _    _
916                   __  ___
917                  _   _ _     _
918                 _   _
919               _    _
920              _    _
921             _
922           __
923
924 "
925             )
926     (goto-char (point-min))
927     (insert gnus-product-name " " gnus-version-number
928             (if (zerop (string-to-number gnus-revision-number))
929                 ""
930               (concat " (r" gnus-revision-number ")"))
931             " based on " gnus-original-product-name " v"
932             gnus-original-version-number)
933     (insert-char ?\  (prog1
934                          (max 0 (/ (- (window-width) (point)) 2))
935                        (goto-char (point-min))))
936     (forward-line 1)
937     ;; And then hack it.
938     (gnus-indent-rigidly (point) (point-max)
939                          (/ (max (- (window-width) (or x 46)) 0) 2))
940     (goto-char (point-min))
941     (forward-line 1)
942     (let* ((pheight (count-lines (point-min) (point-max)))
943            (wheight (window-height))
944            (rest (- wheight pheight)))
945       (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n)))
946     ;; Fontify some.
947     (put-text-property (point-min) (point-max) 'face 'gnus-splash-face)
948     (setq gnus-simple-splash t)))
949   (goto-char (point-min))
950   (setq mode-line-buffer-identification (concat " " gnus-version))
951   (set-buffer-modified-p t))
952
953 (eval-when (load)
954   (let ((command (format "%s" this-command)))
955     (if (and (string-match "gnus" command)
956              (not (string-match "gnus-other-frame" command)))
957         (gnus-splash)
958       (gnus-get-buffer-create gnus-group-buffer))))
959
960 ;;; Do the rest.
961
962 (require 'gnus-util)
963 (require 'nnheader)
964
965 (defcustom gnus-parameters nil
966   "Alist of group parameters.
967
968 For example:
969    ((\"mail\\\\..*\"  (gnus-show-threads nil)
970                   (gnus-use-scoring nil)
971                   (gnus-summary-line-format
972                         \"%U%R%z%I%(%[%d:%ub%-23,23f%]%) %s\\n\")
973                   (gcc-self . t)
974                   (display . all))
975      (\"mail\\\\.me\" (gnus-use-scoring  t))
976      (\"list\\\\..*\" (total-expire . t)
977                   (broken-reply-to . t)))"
978   :group 'gnus-group-various
979   :type '(repeat (cons regexp
980                        (repeat sexp))))
981
982 (defvar gnus-group-parameters-more nil)
983
984 (defvar gnus-colon-keywords
985   (eval-when-compile
986     (when (boundp 'dgnushack-colon-keywords)
987       (symbol-value 'dgnushack-colon-keywords)))
988   "List of the colon keywords should be bound at run-time.  This variable
989 defaults to a proper value only if this file is byte-compiled by make.")
990
991 (dolist (keyword gnus-colon-keywords)
992   (set keyword keyword))
993
994 (defmacro gnus-define-group-parameter (param &rest rest)
995   "Define a group parameter PARAM.
996 REST is a plist of following:
997 :type               One of `bool', `list' or `nil'.
998 :function           The name of the function.
999 :function-document  The documentation of the function.
1000 :parameter-type     The type for customizing the parameter.
1001 :parameter-document The documentation for the parameter.
1002 :variable           The name of the variable.
1003 :variable-document  The documentation for the variable.
1004 :variable-group     The group for customizing the variable.
1005 :variable-type      The type for customizing the variable.
1006 :variable-default   The default value of the variable."
1007   (let* ((type (plist-get rest :type))
1008          (parameter-type (plist-get rest :parameter-type))
1009          (parameter-document (plist-get rest :parameter-document))
1010          (function (or (plist-get rest :function)
1011                        (intern (format "gnus-parameter-%s" param))))
1012          (function-document (or (plist-get rest :function-document) ""))
1013          (variable (or (plist-get rest :variable)
1014                        (intern (format "gnus-parameter-%s-alist" param))))
1015          (variable-document (or (plist-get rest :variable-document) ""))
1016          (variable-group (plist-get rest :variable-group))
1017          (variable-type (or (plist-get rest :variable-type)
1018                             `(quote (repeat
1019                                      (list (regexp :tag "Group")
1020                                            ,(car (cdr parameter-type)))))))
1021          (variable-default (plist-get rest :variable-default)))
1022     (list
1023      'progn
1024      `(defcustom ,variable ,variable-default
1025         ,variable-document
1026         :group 'gnus-group-parameter
1027         :group ',variable-group
1028         :type ,variable-type)
1029      `(setq gnus-group-parameters-more
1030             (delq (assq ',param gnus-group-parameters-more)
1031                   gnus-group-parameters-more))
1032      `(add-to-list 'gnus-group-parameters-more
1033                    (list ',param
1034                          ,parameter-type
1035                          ,parameter-document))
1036      (if (eq type 'bool)
1037          `(defun ,function (name)
1038             ,function-document
1039             (let ((params (gnus-group-find-parameter name))
1040                   val)
1041               (cond
1042                ((memq ',param params)
1043                 t)
1044                ((setq val (assq ',param params))
1045                 (cdr val))
1046                ((stringp ,variable)
1047                 (string-match ,variable name))
1048                (,variable
1049                 (let ((alist ,variable)
1050                       elem value)
1051                   (while (setq elem (pop alist))
1052                     (when (and name
1053                                (string-match (car elem) name))
1054                       (setq alist nil
1055                             value (cdr elem))))
1056                   (if (consp value) (car value) value))))))
1057        `(defun ,function (name)
1058           ,function-document
1059           (and name
1060                (or (gnus-group-find-parameter name ',param ,(and type t))
1061                    (let ((alist ,variable)
1062                          elem value)
1063                      (while (setq elem (pop alist))
1064                        (when (and name
1065                                   (string-match (car elem) name))
1066                          (setq alist nil
1067                                value (cdr elem))))
1068                      ,(if type
1069                           'value
1070                         '(if (consp value) (car value) value))))))))))
1071
1072 (defcustom gnus-home-directory "~/"
1073   "Directory variable that specifies the \"home\" directory.
1074 All other Gnus path variables are initialized from this variable."
1075   :group 'gnus-files
1076   :type 'directory)
1077
1078 (defcustom gnus-directory (or (getenv "SAVEDIR")
1079                               (nnheader-concat gnus-home-directory "News/"))
1080   "*Directory variable from which all other Gnus file variables are derived.
1081
1082 Note that Gnus is mostly loaded when the `.gnus.el' file is read.
1083 This means that other directory variables that are initialized from
1084 this variable won't be set properly if you set this variable in `.gnus.el'.
1085 Set this variable in `.emacs' instead."
1086   :group 'gnus-files
1087   :type 'directory)
1088
1089 (defcustom gnus-default-directory nil
1090   "*Default directory for all Gnus buffers."
1091   :group 'gnus-files
1092   :type '(choice (const :tag "current" nil)
1093                  directory))
1094
1095 ;; Site dependent variables.  These variables should be defined in
1096 ;; paths.el.
1097
1098 (defvar gnus-default-nntp-server nil
1099   "Specify a default NNTP server.
1100 This variable should be defined in paths.el, and should never be set
1101 by the user.
1102 If you want to change servers, you should use `gnus-select-method'.
1103 See the documentation to that variable.")
1104
1105 ;; Don't touch this variable.
1106 (defvar gnus-nntp-service "nntp"
1107   "NNTP service name (\"nntp\" or 119).
1108 This is an obsolete variable, which is scarcely used.  If you use an
1109 nntp server for your newsgroup and want to change the port number
1110 used to 899, you would say something along these lines:
1111
1112  (setq gnus-select-method '(nntp \"my.nntp.server\" (nntp-port-number 899)))")
1113
1114 (defcustom gnus-nntpserver-file "/etc/nntpserver"
1115   "A file with only the name of the nntp server in it."
1116   :group 'gnus-files
1117   :group 'gnus-server
1118   :type 'file)
1119
1120 ;; This function is used to check both the environment variable
1121 ;; NNTPSERVER and the /etc/nntpserver file to see whether one can find
1122 ;; an nntp server name default.
1123 (defun gnus-getenv-nntpserver ()
1124   (or (getenv "NNTPSERVER")
1125       (and (file-readable-p gnus-nntpserver-file)
1126            (save-excursion
1127              (set-buffer (gnus-get-buffer-create " *gnus nntp*"))
1128              (insert-file-contents gnus-nntpserver-file)
1129              (let ((name (buffer-string)))
1130                (prog1
1131                    (if (string-match "\\'[ \t\n]*$" name)
1132                        nil
1133                      name)
1134                  (kill-buffer (current-buffer))))))))
1135
1136 (defcustom gnus-select-method
1137   (condition-case nil
1138       (nconc
1139        (list 'nntp (or (condition-case nil
1140                            (gnus-getenv-nntpserver)
1141                          (error nil))
1142                        (when (and gnus-default-nntp-server
1143                                   (not (string= gnus-default-nntp-server "")))
1144                          gnus-default-nntp-server)
1145                        "news"))
1146        (if (or (null gnus-nntp-service)
1147                (equal gnus-nntp-service "nntp"))
1148            nil
1149          (list gnus-nntp-service)))
1150     (error nil))
1151   "Default method for selecting a newsgroup.
1152 This variable should be a list, where the first element is how the
1153 news is to be fetched, the second is the address.
1154
1155 For instance, if you want to get your news via \"flab.flab.edu\" using
1156 NNTP, you could say:
1157
1158 \(setq gnus-select-method '(nntp \"flab.flab.edu\"))
1159
1160 If you want to use your local spool, say:
1161
1162 \(setq gnus-select-method (list 'nnspool (system-name)))
1163
1164 If you use this variable, you must set `gnus-nntp-server' to nil.
1165
1166 There is a lot more to know about select methods and virtual servers -
1167 see the manual for details."
1168   :group 'gnus-server
1169   :type 'gnus-select-method)
1170
1171 (defcustom gnus-message-archive-method "archive"
1172   "*Method used for archiving messages you've sent.
1173 This should be a mail method."
1174   :group 'gnus-server
1175   :group 'gnus-message
1176   :type 'gnus-select-method)
1177
1178 (defcustom gnus-message-archive-group nil
1179   "*Name of the group in which to save the messages you've written.
1180 This can either be a string; a list of strings; or an alist
1181 of regexps/functions/forms to be evaluated to return a string (or a list
1182 of strings).  The functions are called with the name of the current
1183 group (or nil) as a parameter.
1184
1185 If you want to save your mail in one group and the news articles you
1186 write in another group, you could say something like:
1187
1188  \(setq gnus-message-archive-group
1189         '((if (message-news-p)
1190               \"misc-news\"
1191             \"misc-mail\")))
1192
1193 Normally the group names returned by this variable should be
1194 unprefixed -- which implicitly means \"store on the archive server\".
1195 However, you may wish to store the message on some other server.  In
1196 that case, just return a fully prefixed name of the group --
1197 \"nnml+private:mail.misc\", for instance."
1198   :group 'gnus-message
1199   :type '(choice (const :tag "none" nil)
1200                  function
1201                  sexp
1202                  string))
1203
1204 (defcustom gnus-secondary-servers nil
1205   "List of NNTP servers that the user can choose between interactively.
1206 To make Gnus query you for a server, you have to give `gnus' a
1207 non-numeric prefix - `C-u M-x gnus', in short."
1208   :group 'gnus-server
1209   :type '(repeat string))
1210
1211 (defcustom gnus-nntp-server nil
1212   "*The name of the host running the NNTP server.
1213 This variable is semi-obsolete.  Use the `gnus-select-method'
1214 variable instead."
1215   :group 'gnus-server
1216   :type '(choice (const :tag "disable" nil)
1217                  string))
1218
1219 (defcustom gnus-secondary-select-methods nil
1220   "A list of secondary methods that will be used for reading news.
1221 This is a list where each element is a complete select method (see
1222 `gnus-select-method').
1223
1224 If, for instance, you want to read your mail with the nnml back end,
1225 you could set this variable:
1226
1227 \(setq gnus-secondary-select-methods '((nnml \"\")))"
1228   :group 'gnus-server
1229   :type '(repeat gnus-select-method))
1230
1231 (defvar gnus-backup-default-subscribed-newsgroups
1232   '("news.announce.newusers" "news.groups.questions" "gnu.emacs.gnus")
1233   "Default default new newsgroups the first time Gnus is run.
1234 Should be set in paths.el, and shouldn't be touched by the user.")
1235
1236 (defcustom gnus-local-domain nil
1237   "Local domain name without a host name.
1238 The DOMAINNAME environment variable is used instead if it is defined.
1239 If the function `system-name' returns the full Internet name, there is
1240 no need to set this variable."
1241   :group 'gnus-message
1242   :type '(choice (const :tag "default" nil)
1243                  string))
1244
1245 (defvar gnus-local-organization nil
1246   "String with a description of what organization (if any) the user belongs to.
1247 Obsolete variable; use `message-user-organization' instead.")
1248
1249 ;; Customization variables
1250
1251 (defcustom gnus-refer-article-method nil
1252   "Preferred method for fetching an article by Message-ID.
1253 If you are reading news from the local spool (with nnspool), fetching
1254 articles by Message-ID is painfully slow.  By setting this method to an
1255 nntp method, you might get acceptable results.
1256
1257 The value of this variable must be a valid select method as discussed
1258 in the documentation of `gnus-select-method'.
1259
1260 It can also be a list of select methods, as well as the special symbol
1261 `current', which means to use the current select method.  If it is a
1262 list, Gnus will try all the methods in the list until it finds a match."
1263   :group 'gnus-server
1264   :type '(choice (const :tag "default" nil)
1265                  (const :tag "Google" (nnweb "refer" (nnweb-type google)))
1266                  gnus-select-method
1267                  (repeat :menu-tag "Try multiple"
1268                          :tag "Multiple"
1269                          :value (current (nnweb "refer" (nnweb-type google)))
1270                          (choice :tag "Method"
1271                                  (const current)
1272                                  (const :tag "Google"
1273                                         (nnweb "refer" (nnweb-type google)))
1274                                  gnus-select-method))))
1275
1276 (defcustom gnus-group-faq-directory
1277   '("/ftp@mirrors.aol.com:/pub/rtfm/usenet/"
1278     "/ftp@sunsite.doc.ic.ac.uk:/pub/usenet/news-faqs/"
1279     "/ftp@src.doc.ic.ac.uk:/usenet/news-FAQS/"
1280     "/ftp@ftp.seas.gwu.edu:/pub/rtfm/"
1281     "/ftp@ftp.pasteur.fr:/pub/FAQ/"
1282     "/ftp@rtfm.mit.edu:/pub/usenet/"
1283     "/ftp@ftp.uni-paderborn.de:/pub/FAQ/"
1284     "/ftp@ftp.sunet.se:/pub/usenet/"
1285     "/ftp@nctuccca.edu.tw:/USENET/FAQ/"
1286     "/ftp@hwarang.postech.ac.kr:/pub/usenet/"
1287     "/ftp@ftp.hk.super.net:/mirror/faqs/")
1288   "*Directory where the group FAQs are stored.
1289 This will most commonly be on a remote machine, and the file will be
1290 fetched by ange-ftp.
1291
1292 This variable can also be a list of directories.  In that case, the
1293 first element in the list will be used by default.  The others can
1294 be used when being prompted for a site.
1295
1296 Note that Gnus uses an aol machine as the default directory.  If this
1297 feels fundamentally unclean, just think of it as a way to finally get
1298 something of value back from them.
1299
1300 If the default site is too slow, try one of these:
1301
1302    North America: mirrors.aol.com                /pub/rtfm/usenet
1303                   ftp.seas.gwu.edu               /pub/rtfm
1304                   rtfm.mit.edu                   /pub/usenet
1305    Europe:        ftp.uni-paderborn.de           /pub/FAQ
1306                   src.doc.ic.ac.uk               /usenet/news-FAQS
1307                   ftp.sunet.se                   /pub/usenet
1308                   ftp.pasteur.fr                 /pub/FAQ
1309    Asia:          nctuccca.edu.tw                /USENET/FAQ
1310                   hwarang.postech.ac.kr          /pub/usenet
1311                   ftp.hk.super.net               /mirror/faqs"
1312   :group 'gnus-group-various
1313   :type '(choice directory
1314                  (repeat directory)))
1315
1316 (defcustom gnus-group-charter-alist
1317   '(("no" . (concat "http://no.news-admin.org/charter/" name ".txt"))
1318     ("de" . (concat "http://purl.net/charta/" name ".html"))
1319     ("dk" . (concat "http://www.usenet.dk/grupper.pl?get=" name))
1320     ("england" . (concat "http://england.news-admin.org/charters/" name))
1321     ("fr" . (concat "http://www.usenet-fr.net/fur/chartes/" name ".html"))
1322     ("europa" . (concat "http://www.europa.usenet.eu.org/chartas/charta-en-" 
1323                         (gnus-replace-in-string name "europa\\." "") ".html"))
1324     ("nl" . (concat "http://www.xs4all.nl/~sister/usenet/charters/" name))
1325     ("aus" . (concat "http://aus.news-admin.org/groupinfo.php/" name))
1326     ("pl" . (concat "http://www.usenet.pl/opisy/" name))
1327     ("ch" . (concat "http://www.use-net.ch/Usenet/charter.html#" name))
1328     ("at" . (concat "http://www.usenet.at/chartas/" name "/charta"))
1329     ("uk" . (concat "http://www.usenet.org.uk/" name ".html"))
1330     ("wales" . (concat "http://www.wales-usenet.org/english/groups/" name ".html"))
1331     ("dfw" . (concat "http://www.cirr.com/dfw/charters/" name ".html"))
1332     ("se" . (concat "http://www.usenet-se.net/Reglementen/" 
1333                     (gnus-replace-in-string name "\\." "_") ".html"))
1334     ("milw" . (concat "http://usenet.mil.wi.us/" 
1335                       (gnus-replace-in-string name "milw\\." "") "-charter"))
1336     ("ca" . (concat "http://www.sbay.org/ca/charter-" name ".html"))
1337     ("netins" . (concat "http://www.netins.net/usenet/charter/" 
1338                         (gnus-replace-in-string name "\\." "-") "-charter.html")))
1339   "*An alist of (HIERARCHY . FORM) pairs used to construct the URL of a charter.
1340   When FORM is evaluated `name' is bound to the name of the group."
1341   :group 'gnus-group-various
1342   :type '(repeat (cons (string :tag "Hierarchy") (sexp :tag "Form"))))
1343
1344 (defcustom gnus-group-fetch-control-use-browse-url nil
1345   "*Non-nil means that control messages are displayed using `browse-url'.
1346 Otherwise they are fetched with ange-ftp and displayed in an ephemeral
1347 group."
1348   :group 'gnus-group-various
1349   :type 'boolean)
1350
1351 (defcustom gnus-use-cross-reference t
1352   "*Non-nil means that cross referenced articles will be marked as read.
1353 If nil, ignore cross references.  If t, mark articles as read in
1354 subscribed newsgroups.  If neither t nor nil, mark as read in all
1355 newsgroups."
1356   :group 'gnus-server
1357   :type '(choice (const :tag "off" nil)
1358                  (const :tag "subscribed" t)
1359                  (sexp :format "all"
1360                        :value always)))
1361
1362 (defcustom gnus-process-mark ?#
1363   "*Process mark."
1364   :group 'gnus-group-visual
1365   :group 'gnus-summary-marks
1366   :type 'character)
1367
1368 (defcustom gnus-large-newsgroup 200
1369   "*The number of articles which indicates a large newsgroup.
1370 If the number of articles in a newsgroup is greater than this value,
1371 confirmation is required for selecting the newsgroup.
1372 If it is `nil', no confirmation is required."
1373   :group 'gnus-group-select
1374   :type '(choice (const :tag "No limit" nil)
1375                  integer))
1376
1377 (defcustom gnus-use-long-file-name (not (memq system-type '(usg-unix-v xenix)))
1378   "*Non-nil means that the default name of a file to save articles in is the group name.
1379 If it's nil, the directory form of the group name is used instead.
1380
1381 If this variable is a list, and the list contains the element
1382 `not-score', long file names will not be used for score files; if it
1383 contains the element `not-save', long file names will not be used for
1384 saving; and if it contains the element `not-kill', long file names
1385 will not be used for kill files.
1386
1387 Note that the default for this variable varies according to what system
1388 type you're using.  On `usg-unix-v' and `xenix' this variable defaults
1389 to nil while on all other systems it defaults to t."
1390   :group 'gnus-start
1391   :type 'boolean)
1392
1393 (defcustom gnus-kill-files-directory gnus-directory
1394   "*Name of the directory where kill files will be stored (default \"~/News\")."
1395   :group 'gnus-score-files
1396   :group 'gnus-score-kill
1397   :type 'directory)
1398
1399 (defcustom gnus-save-score nil
1400   "*If non-nil, save group scoring info."
1401   :group 'gnus-score-various
1402   :group 'gnus-start
1403   :type 'boolean)
1404
1405 (defcustom gnus-use-undo t
1406   "*If non-nil, allow undoing in Gnus group mode buffers."
1407   :group 'gnus-meta
1408   :type 'boolean)
1409
1410 (defcustom gnus-use-adaptive-scoring nil
1411   "*If non-nil, use some adaptive scoring scheme.
1412 If a list, then the values `word' and `line' are meaningful.  The
1413 former will perform adaption on individual words in the subject
1414 header while `line' will perform adaption on several headers."
1415   :group 'gnus-meta
1416   :group 'gnus-score-adapt
1417   :type '(set (const word) (const line)))
1418
1419 (defcustom gnus-use-cache 'passive
1420   "*If nil, Gnus will ignore the article cache.
1421 If `passive', it will allow entering (and reading) articles
1422 explicitly entered into the cache.  If anything else, use the
1423 cache to the full extent of the law."
1424   :group 'gnus-meta
1425   :group 'gnus-cache
1426   :type '(choice (const :tag "off" nil)
1427                  (const :tag "passive" passive)
1428                  (const :tag "active" t)))
1429
1430 (defcustom gnus-use-trees nil
1431   "*If non-nil, display a thread tree buffer."
1432   :group 'gnus-meta
1433   :type 'boolean)
1434
1435 (defcustom gnus-use-grouplens nil
1436   "*If non-nil, use GroupLens ratings."
1437   :group 'gnus-meta
1438   :type 'boolean)
1439
1440 (defcustom gnus-keep-backlog 20
1441   "*If non-nil, Gnus will keep read articles for later re-retrieval.
1442 If it is a number N, then Gnus will only keep the last N articles
1443 read.  If it is neither nil nor a number, Gnus will keep all read
1444 articles.  This is not a good idea."
1445   :group 'gnus-meta
1446   :type '(choice (const :tag "off" nil)
1447                  integer
1448                  (sexp :format "all"
1449                        :value t)))
1450
1451 (defcustom gnus-use-nocem nil
1452   "*If non-nil, Gnus will read NoCeM cancel messages."
1453   :group 'gnus-meta
1454   :type 'boolean)
1455
1456 (defcustom gnus-suppress-duplicates nil
1457   "*If non-nil, Gnus will mark duplicate copies of the same article as read."
1458   :group 'gnus-meta
1459   :type 'boolean)
1460
1461 (defcustom gnus-use-scoring t
1462   "*If non-nil, enable scoring."
1463   :group 'gnus-meta
1464   :type 'boolean)
1465
1466 (defcustom gnus-summary-prepare-exit-hook
1467   '(gnus-summary-expire-articles)
1468   "*A hook called when preparing to exit from the summary buffer.
1469 It calls `gnus-summary-expire-articles' by default."
1470   :group 'gnus-summary-exit
1471   :type 'hook)
1472
1473 (defcustom gnus-novice-user t
1474   "*Non-nil means that you are a usenet novice.
1475 If non-nil, verbose messages may be displayed and confirmations may be
1476 required."
1477   :group 'gnus-meta
1478   :type 'boolean)
1479
1480 (defcustom gnus-expert-user nil
1481   "*Non-nil means that you will never be asked for confirmation about anything.
1482 That doesn't mean *anything* anything; particularly destructive
1483 commands will still require prompting."
1484   :group 'gnus-meta
1485   :type 'boolean)
1486
1487 (defcustom gnus-interactive-catchup t
1488   "*If non-nil, require your confirmation when catching up a group."
1489   :group 'gnus-group-select
1490   :type 'boolean)
1491
1492 (defcustom gnus-interactive-exit t
1493   "*If non-nil, require your confirmation when exiting Gnus."
1494   :group 'gnus-exit
1495   :type 'boolean)
1496
1497 (defcustom gnus-extract-address-components 'gnus-extract-address-components
1498   "Function for extracting address components from a From header.
1499 Three pre-defined functions exist: `gnus-extract-address-components',
1500 which is the default, quite fast, and too simplistic solution,
1501 `mail-extract-address-components', which works much better, but is
1502 slower, and `std11-extract-address-components'."
1503   :group 'gnus-summary-format
1504   :type '(radio (function-item gnus-extract-address-components)
1505                 (function-item mail-extract-address-components)
1506                 (function-item std11-extract-address-components)
1507                 (function :tag "Other")))
1508
1509 (defcustom gnus-carpal nil
1510   "*If non-nil, display clickable icons."
1511   :group 'gnus-meta
1512   :type 'boolean)
1513
1514 (defcustom gnus-shell-command-separator ";"
1515   "String used to separate to shell commands."
1516   :group 'gnus-files
1517   :type 'string)
1518
1519 (defcustom gnus-valid-select-methods
1520   '(("nntp" post address prompt-address physical-address)
1521     ("nnspool" post address)
1522     ("nnvirtual" post-mail virtual prompt-address)
1523     ("nnmbox" mail respool address)
1524     ("nnml" post-mail respool address)
1525     ("nnmh" mail respool address)
1526     ("nndir" post-mail prompt-address physical-address)
1527     ("nneething" none address prompt-address physical-address)
1528     ("nndoc" none address prompt-address)
1529     ("nnbabyl" mail address respool)
1530     ("nnkiboze" post virtual)
1531     ("nnsoup" post-mail address)
1532     ("nndraft" post-mail)
1533     ("nnfolder" mail respool address)
1534     ("nngateway" post-mail address prompt-address physical-address)
1535     ("nnweb" none)
1536     ("nngoogle" post)
1537     ("nnslashdot" post)
1538     ("nnultimate" none)
1539     ("nnrss" none)
1540     ("nnwfm" none)
1541     ("nnwarchive" none)
1542     ("nnlistserv" none)
1543     ("nnagent" post-mail)
1544     ("nnimap" post-mail address prompt-address physical-address)
1545     ("nnmaildir" mail respool address)
1546     ("nnnil" none))
1547   "*An alist of valid select methods.
1548 The first element of each list lists should be a string with the name
1549 of the select method.  The other elements may be the category of
1550 this method (i. e., `post', `mail', `none' or whatever) or other
1551 properties that this method has (like being respoolable).
1552 If you implement a new select method, all you should have to change is
1553 this variable.  I think."
1554   :group 'gnus-server
1555   :type '(repeat (group (string :tag "Name")
1556                         (radio-button-choice (const :format "%v " post)
1557                                              (const :format "%v " mail)
1558                                              (const :format "%v " none)
1559                                              (const post-mail))
1560                         (checklist :inline t
1561                                    (const :format "%v " address)
1562                                    (const :format "%v " prompt-address)
1563                                    (const :format "%v " physical-address)
1564                                    (const :format "%v " virtual)
1565                                    (const respool)))))
1566
1567 (defun gnus-redefine-select-method-widget ()
1568   "Recomputes the select-method widget based on the value of
1569 `gnus-valid-select-methods'."
1570   (define-widget 'gnus-select-method 'list
1571     "Widget for entering a select method."
1572     :value '(nntp "")
1573     :tag "Select Method"
1574     :args `((choice :tag "Method"
1575                     ,@(mapcar (lambda (entry)
1576                                 (list 'const :format "%v\n"
1577                                       (intern (car entry))))
1578                               gnus-valid-select-methods)
1579                     (symbol :tag "other"))
1580             (string :tag "Address")
1581             (repeat :tag "Options"
1582                     :inline t
1583                     (list :format "%v"
1584                           variable
1585                           (sexp :tag "Value"))))))
1586
1587 (gnus-redefine-select-method-widget)
1588
1589 (defcustom gnus-updated-mode-lines '(group article summary tree)
1590   "List of buffers that should update their mode lines.
1591 The list may contain the symbols `group', `article', `tree' and
1592 `summary'.  If the corresponding symbol is present, Gnus will keep
1593 that mode line updated with information that may be pertinent.
1594 If this variable is nil, screen refresh may be quicker."
1595   :group 'gnus-various
1596   :type '(set (const group)
1597               (const article)
1598               (const summary)
1599               (const tree)))
1600
1601 ;; Added by Keinonen Kari <kk85613@cs.tut.fi>.
1602 (defcustom gnus-mode-non-string-length nil
1603   "*Max length of mode-line non-string contents.
1604 If this is nil, Gnus will take space as is needed, leaving the rest
1605 of the modeline intact.  Note that the default of nil is unlikely
1606 to be desirable; see the manual for further details."
1607   :group 'gnus-various
1608   :type '(choice (const nil)
1609                  integer))
1610
1611 ;; There should be special validation for this.
1612 (define-widget 'gnus-email-address 'string
1613   "An email address")
1614
1615 (gnus-define-group-parameter
1616  to-address
1617  :function-document
1618  "Return GROUP's to-address."
1619  :variable-document
1620  "*Alist of group regexps and correspondent to-addresses."
1621  :parameter-type '(gnus-email-address :tag "To Address")
1622  :parameter-document "\
1623 This will be used when doing followups and posts.
1624
1625 This is primarily useful in mail groups that represent closed
1626 mailing lists--mailing lists where it's expected that everybody that
1627 writes to the mailing list is subscribed to it.  Since using this
1628 parameter ensures that the mail only goes to the mailing list itself,
1629 it means that members won't receive two copies of your followups.
1630
1631 Using `to-address' will actually work whether the group is foreign or
1632 not.  Let's say there's a group on the server that is called
1633 `fa.4ad-l'.  This is a real newsgroup, but the server has gotten the
1634 articles from a mail-to-news gateway.  Posting directly to this group
1635 is therefore impossible--you have to send mail to the mailing list
1636 address instead.
1637
1638 The gnus-group-split mail splitting mechanism will behave as if this
1639 address was listed in gnus-group-split Addresses (see below).")
1640
1641 (gnus-define-group-parameter
1642  to-list
1643  :function-document
1644  "Return GROUP's to-list."
1645  :variable-document
1646  "*Alist of group regexps and correspondent to-lists."
1647  :parameter-type '(gnus-email-address :tag "To List")
1648  :parameter-document "\
1649 This address will be used when doing a `a' in the group.
1650
1651 It is totally ignored when doing a followup--except that if it is
1652 present in a news group, you'll get mail group semantics when doing
1653 `f'.
1654
1655 The gnus-group-split mail splitting mechanism will behave as if this
1656 address was listed in gnus-group-split Addresses (see below).")
1657
1658 (gnus-define-group-parameter
1659  subscribed
1660  :type bool
1661  :function-document
1662  "Return GROUP's subscription status."
1663  :variable-document
1664  "*Groups which are automatically considered subscribed."
1665  :parameter-type '(const :tag "Subscribed" t)
1666  :parameter-document "\
1667 Gnus assumed that you are subscribed to the To/List address.
1668
1669 When constructing a list of subscribed groups using
1670 `gnus-find-subscribed-addresses', Gnus includes the To address given
1671 above, or the list address (if the To address has not been set).")
1672
1673 (gnus-define-group-parameter
1674  auto-expire
1675  :type bool
1676  :function gnus-group-auto-expirable-p
1677  :function-document
1678  "Check whether GROUP is auto-expirable or not."
1679  :variable gnus-auto-expirable-newsgroups
1680  :variable-default nil
1681  :variable-document
1682  "*Groups in which to automatically mark read articles as expirable.
1683 If non-nil, this should be a regexp that should match all groups in
1684 which to perform auto-expiry.  This only makes sense for mail groups."
1685  :variable-group nnmail-expire
1686  :variable-type '(choice (const nil)
1687                          regexp)
1688  :parameter-type '(const :tag "Automatic Expire" t)
1689  :parameter-document
1690  "All articles that are read will be marked as expirable.")
1691
1692 (gnus-define-group-parameter
1693  total-expire
1694  :type bool
1695  :function gnus-group-total-expirable-p
1696  :function-document
1697  "Check whether GROUP is total-expirable or not."
1698  :variable gnus-total-expirable-newsgroups
1699  :variable-default nil
1700  :variable-document
1701  "*Groups in which to perform expiry of all read articles.
1702 Use with extreme caution.  All groups that match this regexp will be
1703 expiring - which means that all read articles will be deleted after
1704 \(say) one week.         (This only goes for mail groups and the like, of
1705 course.)"
1706  :variable-group nnmail-expire
1707  :variable-type '(choice (const nil)
1708                          regexp)
1709  :parameter-type '(const :tag "Total Expire" t)
1710  :parameter-document
1711  "All read articles will be put through the expiry process
1712
1713 This happens even if they are not marked as expirable.
1714 Use with caution.")
1715
1716 (gnus-define-group-parameter
1717  charset
1718  :function-document
1719  "Return the default charset of GROUP."
1720  :variable gnus-group-charset-alist
1721  :variable-default
1722  '(("\\(^\\|:\\)hk\\>\\|\\(^\\|:\\)tw\\>\\|\\<big5\\>" cn-big5)
1723    ("\\(^\\|:\\)cn\\>\\|\\<chinese\\>" cn-gb-2312)
1724    ("\\(^\\|:\\)fj\\>\\|\\(^\\|:\\)japan\\>" iso-2022-jp-2)
1725    ("\\(^\\|:\\)tnn\\>\\|\\(^\\|:\\)pin\\>\\|\\(^\\|:\\)sci.lang.japan" iso-2022-7bit)
1726    ("\\(^\\|:\\)relcom\\>" koi8-r)
1727    ("\\(^\\|:\\)fido7\\>" koi8-r)
1728    ("\\(^\\|:\\)\\(cz\\|hun\\|pl\\|sk\\|hr\\)\\>" iso-8859-2)
1729    ("\\(^\\|:\\)israel\\>" iso-8859-1)
1730    ("\\(^\\|:\\)han\\>" euc-kr)
1731    ("\\(^\\|:\\)alt.chinese.text.big5\\>" chinese-big5)
1732    ("\\(^\\|:\\)soc.culture.vietnamese\\>" vietnamese-viqr)
1733    ("\\(^\\|:\\)\\(comp\\|rec\\|alt\\|sci\\|soc\\|news\\|gnu\\|bofh\\)\\>" iso-8859-1))
1734  :variable-document
1735  "Alist of regexps (to match group names) and default charsets to be used when reading."
1736  :variable-group gnus-charset
1737  :variable-type '(repeat (list (regexp :tag "Group")
1738                                (symbol :tag "Charset")))
1739  :parameter-type '(symbol :tag "Charset")
1740  :parameter-document "\
1741 The default charset to use in the group.")
1742
1743 (gnus-define-group-parameter
1744  post-method
1745  :type list
1746  :function-document
1747  "Return a posting method for GROUP."
1748  :variable gnus-post-method-alist
1749  :variable-document
1750  "Alist of regexps (to match group names) and method to be used when
1751 posting an article."
1752  :variable-group gnus-group-foreign
1753  :parameter-type
1754  '(choice :tag "Posting Method"
1755           (const :tag "Use native server" native)
1756           (const :tag "Use current server" current)
1757           (list :convert-widget
1758                 (lambda (widget)
1759                   (list 'sexp :tag "Methods"
1760                         :value gnus-select-method))))
1761  :parameter-document
1762  "Posting method for this group.")
1763
1764 (gnus-define-group-parameter
1765  large-newsgroup-initial
1766  :type integer
1767  :function-document
1768  "Return GROUP's initial input of the number of articles."
1769  :variable-document
1770  "*Alist of group regexps and its initial input of the number of articles."
1771  :parameter-type '(choice :tag "Initial Input for Large Newsgroup"
1772                           (const :tag "All" nil)
1773                           (integer))
1774  :parameter-document "\
1775
1776 This number will be prompted as the initial value of the number of
1777 articles to list when the group is a large newsgroup (see
1778 `gnus-large-newsgroup').  If it is `nil', the default value is the
1779 total number of articles in the group.")
1780
1781 ;; group parameters for spam processing added by Ted Zlatanov <tzz@lifelogs.com>
1782 (defvar gnus-group-spam-classification-spam t
1783   "Spam group classification (requires spam.el).
1784 This group contains spam messages.  On summary entry, unread messages
1785 will be marked as spam.  On summary exit, the specified spam
1786 processors will be invoked on spam-marked messages, then those
1787 messages will be expired, so the spam processor will only see a
1788 spam-marked message once.")
1789
1790 (defvar gnus-group-spam-classification-ham 'ask
1791   "The ham value for the spam group parameter (requires spam.el).
1792 On summary exit, the specified ham processors will be invoked on
1793 ham-marked messages.  Exercise caution, since the ham processor will
1794 see the same message more than once because there is no ham message
1795 registry.")
1796
1797 (gnus-define-group-parameter
1798  spam-contents
1799  :type list
1800  :function-document
1801  "The spam type (spam, ham, or neither) of the group."
1802  :variable gnus-spam-newsgroup-contents
1803  :variable-default nil
1804  :variable-document
1805  "*Groups in which to automatically mark new articles as spam on
1806 summary entry.  If non-nil, this should be a list of group name
1807 regexps that should match all groups in which to do automatic spam
1808 tagging, associated with a classification (spam, ham, or neither).
1809 This only makes sense for mail groups."
1810  :variable-group spam
1811  :variable-type '(repeat 
1812                          (list :tag "Group contents spam/ham classification"
1813                           (regexp :tag "Group")
1814                           (choice
1815                            (variable-item gnus-group-spam-classification-spam)
1816                            (variable-item gnus-group-spam-classification-ham)
1817                            (other :tag "Unclassified" nil))))
1818
1819  :parameter-type '(list :tag "Group contents spam/ham classification"
1820                    (choice :tag "Group contents classification for spam sorting"
1821                            (variable-item gnus-group-spam-classification-spam)
1822                            (variable-item gnus-group-spam-classification-ham)
1823                            (other :tag "Unclassified" nil)))
1824  :parameter-document
1825  "The spam classification (spam, ham, or neither) of this group.
1826 When a spam group is entered, all unread articles are marked as spam.")
1827
1828 (defvar gnus-group-spam-exit-processor-ifile "ifile"
1829   "The ifile summary exit spam processor.
1830 Only applicable to spam groups.")
1831
1832 (defvar gnus-group-spam-exit-processor-bogofilter "bogofilter"
1833   "The Bogofilter summary exit spam processor.
1834 Only applicable to spam groups.")
1835
1836 (defvar gnus-group-spam-exit-processor-blacklist "blacklist"
1837   "The Blacklist summary exit spam processor.
1838 Only applicable to spam groups.")
1839
1840 (defvar gnus-group-ham-exit-processor-ifile "ifile-ham"
1841   "The ifile summary exit ham processor.
1842 Only applicable to non-spam (unclassified and ham) groups.")
1843
1844 (defvar gnus-group-ham-exit-processor-whitelist "whitelist"
1845   "The whitelist summary exit ham processor.
1846 Only applicable to non-spam (unclassified and ham) groups.")
1847
1848 (defvar gnus-group-ham-exit-processor-BBDB "bbdb"
1849   "The BBDB summary exit ham processor.
1850 Only applicable to non-spam (unclassified and ham) groups.")
1851
1852 (gnus-define-group-parameter
1853  spam-process
1854  :type list
1855  :parameter-type '(choice :tag "Spam Summary Exit Processor"
1856                           :value nil
1857                           (list :tag "Spam Summary Exit Processor Choices"
1858                            (set 
1859                             (variable-item gnus-group-spam-exit-processor-ifile)
1860                             (variable-item gnus-group-spam-exit-processor-bogofilter)
1861                             (variable-item gnus-group-spam-exit-processor-blacklist)
1862                             (variable-item gnus-group-ham-exit-processor-ifile)
1863                             (variable-item gnus-group-ham-exit-processor-whitelist)
1864                             (variable-item gnus-group-ham-exit-processor-BBDB))))
1865  :function-document
1866  "Which spam or ham processors will be applied to the GROUP articles at summary exit."
1867  :variable gnus-spam-process-newsgroups
1868  :variable-default nil
1869  :variable-document
1870  "*Groups in which to automatically process spam or ham articles with
1871 a backend on summary exit.  If non-nil, this should be a list of group
1872 name regexps that should match all groups in which to do automatic
1873 spam processing, associated with the appropriate processor.  This only makes sense
1874 for mail groups."
1875  :variable-group spam
1876  :variable-type '(repeat :tag "Spam/Ham Processors" 
1877                          (list :tag "Spam Summary Exit Processor Choices"
1878                           (regexp :tag "Group Regexp") 
1879                           (set :tag "Spam/Ham Summary Exit Processor"
1880                                (variable-item gnus-group-spam-exit-processor-ifile)
1881                                (variable-item gnus-group-spam-exit-processor-bogofilter)
1882                                (variable-item gnus-group-spam-exit-processor-blacklist)
1883                                (variable-item gnus-group-ham-exit-processor-ifile)
1884                                (variable-item gnus-group-ham-exit-processor-whitelist)
1885                                (variable-item gnus-group-ham-exit-processor-BBDB))))
1886  :parameter-document
1887  "Which spam processors will be applied to the spam or ham GROUP articles at summary exit.")
1888
1889 (gnus-define-group-parameter
1890  spam-process-destination
1891  :parameter-type '(choice :tag "Destination for spam-processed articles at summary exit"
1892                           (string :tag "Move to a group")
1893                           (other :tag "Expire" nil))
1894  :function-document
1895  "Where spam-processed articles will go at summary exit."
1896  :variable gnus-spam-process-destinations
1897  :variable-default nil
1898  :variable-document
1899  "*Groups in which to explicitly send spam-processed articles to
1900 another group, or expire them (the default).  If non-nil, this should
1901 be a list of group name regexps that should match all groups in which
1902 to do spam-processed article moving, associated with the destination
1903 group or `nil' for explicit expiration.  This only makes sense for
1904 mail groups."
1905  :variable-group spam
1906  :variable-type '(repeat :tag "Spam-processed articles destination" 
1907                          (list
1908                           (regexp :tag "Group Regexp") 
1909                           (choice :tag "Destination for spam-processed articles at summary exit"
1910                                   (string :tag "Move to a group")
1911                                   (other :tag "Expire" nil))))
1912  :parameter-document
1913  "Where spam-processed articles will go at summary exit.")
1914
1915 (defcustom gnus-group-uncollapsed-levels 1
1916   "Number of group name elements to leave alone when making a short group name."
1917   :group 'gnus-group-visual
1918   :type 'integer)
1919
1920 (defcustom gnus-group-use-permanent-levels nil
1921   "*If non-nil, once you set a level, Gnus will use this level."
1922   :group 'gnus-group-levels
1923   :type 'boolean)
1924
1925 ;; Hooks.
1926
1927 (defcustom gnus-load-hook nil
1928   "A hook run while Gnus is loaded."
1929   :group 'gnus-start
1930   :type 'hook)
1931
1932 (defcustom gnus-apply-kill-hook '(gnus-apply-kill-file)
1933   "A hook called to apply kill files to a group.
1934 This hook is intended to apply a kill file to the selected newsgroup.
1935 The function `gnus-apply-kill-file' is called by default.
1936
1937 Since a general kill file is too heavy to use only for a few
1938 newsgroups, I recommend you to use a lighter hook function.  For
1939 example, if you'd like to apply a kill file to articles which contains
1940 a string `rmgroup' in subject in newsgroup `control', you can use the
1941 following hook:
1942
1943  (setq gnus-apply-kill-hook
1944       (list
1945         (lambda ()
1946           (cond ((string-match \"control\" gnus-newsgroup-name)
1947                  (gnus-kill \"Subject\" \"rmgroup\")
1948                  (gnus-expunge \"X\"))))))"
1949   :group 'gnus-score-kill
1950   :options '(gnus-apply-kill-file)
1951   :type 'hook)
1952
1953 (defcustom gnus-group-change-level-function nil
1954   "Function run when a group level is changed.
1955 It is called with three parameters -- GROUP, LEVEL and OLDLEVEL."
1956   :group 'gnus-group-levels
1957   :type 'function)
1958
1959 ;;; Face thingies.
1960
1961 (defcustom gnus-visual
1962   '(summary-highlight group-highlight article-highlight
1963                       mouse-face
1964                       summary-menu group-menu article-menu
1965                       tree-highlight menu highlight
1966                       browse-menu server-menu
1967                       page-marker tree-menu binary-menu pick-menu
1968                       grouplens-menu)
1969   "*Enable visual features.
1970 If `visual' is disabled, there will be no menus and few faces.  Most of
1971 the visual customization options below will be ignored.  Gnus will use
1972 less space and be faster as a result.
1973
1974 This variable can also be a list of visual elements to switch on.  For
1975 instance, to switch off all visual things except menus, you can say:
1976
1977    (setq gnus-visual '(menu))
1978
1979 Valid elements include `summary-highlight', `group-highlight',
1980 `article-highlight', `mouse-face', `summary-menu', `group-menu',
1981 `article-menu', `tree-highlight', `menu', `highlight', `browse-menu',
1982 `server-menu', `page-marker', `tree-menu', `binary-menu', `pick-menu',
1983 and `grouplens-menu'."
1984   :group 'gnus-meta
1985   :group 'gnus-visual
1986   :type '(set (const summary-highlight)
1987               (const group-highlight)
1988               (const article-highlight)
1989               (const mouse-face)
1990               (const summary-menu)
1991               (const group-menu)
1992               (const article-menu)
1993               (const tree-highlight)
1994               (const menu)
1995               (const highlight)
1996               (const browse-menu)
1997               (const server-menu)
1998               (const page-marker)
1999               (const tree-menu)
2000               (const binary-menu)
2001               (const pick-menu)
2002               (const grouplens-menu)))
2003
2004 ;; Byte-compiler warning.
2005 (defvar gnus-visual)
2006 ;; Find out whether the gnus-visual TYPE is wanted.
2007 (defun gnus-visual-p (&optional type class)
2008   (and gnus-visual                      ; Has to be non-nil, at least.
2009        (if (not type)                   ; We don't care about type.
2010            gnus-visual
2011          (if (listp gnus-visual)        ; It's a list, so we check it.
2012              (or (memq type gnus-visual)
2013                  (memq class gnus-visual))
2014            t))))
2015
2016 (defcustom gnus-mouse-face
2017   (condition-case ()
2018       (if (gnus-visual-p 'mouse-face 'highlight)
2019           (if (boundp 'gnus-mouse-face)
2020               (or gnus-mouse-face 'highlight)
2021             'highlight)
2022         'default)
2023     (error 'highlight))
2024   "*Face used for group or summary buffer mouse highlighting.
2025 The line beneath the mouse pointer will be highlighted with this
2026 face."
2027   :group 'gnus-visual
2028   :type 'face)
2029
2030 (defcustom gnus-article-save-directory gnus-directory
2031   "*Name of the directory articles will be saved in (default \"~/News\")."
2032   :group 'gnus-article-saving
2033   :type 'directory)
2034
2035 (defvar gnus-plugged t
2036   "Whether Gnus is plugged or not.")
2037
2038 (defcustom gnus-agent-cache t
2039   "Whether Gnus use agent cache.
2040 You also need to enable `gnus-agent'."
2041   :version "21.3"
2042   :group 'gnus-agent
2043   :type 'boolean)
2044
2045 (defcustom gnus-default-charset 'iso-8859-1
2046   "Default charset assumed to be used when viewing non-ASCII characters.
2047 This variable is overridden on a group-to-group basis by the
2048 gnus-group-charset-alist variable and is only used on groups not
2049 covered by that variable."
2050   :type 'symbol
2051   :group 'gnus-charset)
2052
2053 (defcustom gnus-agent t
2054   "Whether we want to use the Gnus agent or not.
2055 Putting (gnus-agentize) in ~/.gnus is obsolete by (setq gnus-agent t)."
2056   :version "21.3"
2057   :group 'gnus-agent
2058   :type 'boolean)
2059
2060 (defcustom gnus-other-frame-function 'gnus
2061   "Function called by the command `gnus-other-frame'."
2062   :group 'gnus-start
2063   :type '(choice (function-item gnus)
2064                  (function-item gnus-no-server)
2065                  (function-item gnus-slave)
2066                  (function-item gnus-slave-no-server)))
2067
2068 (defcustom gnus-other-frame-parameters nil
2069   "Frame parameters used by `gnus-other-frame' to create a Gnus frame.
2070 This should be an alist for FSF Emacs, or a plist for XEmacs."
2071   :group 'gnus-start
2072   :type (if (featurep 'xemacs)
2073             '(repeat (list :inline t :format "%v"
2074                            (symbol :tag "Property")
2075                            (sexp :tag "Value")))
2076           '(repeat (cons :format "%v"
2077                          (symbol :tag "Parameter")
2078                          (sexp :tag "Value")))))
2079
2080 \f
2081 ;;; Internal variables
2082
2083 (defvar gnus-agent-gcc-header "X-Gnus-Agent-Gcc")
2084 (defvar gnus-agent-meta-information-header "X-Gnus-Agent-Meta-Information")
2085 (defvar gnus-draft-meta-information-header "X-Draft-From")
2086 (defvar gnus-group-get-parameter-function 'gnus-group-get-parameter)
2087 (defvar gnus-original-article-buffer " *Original Article*")
2088 (defvar gnus-newsgroup-name nil)
2089 (defvar gnus-ephemeral-servers nil)
2090 (defvar gnus-server-method-cache nil)
2091
2092 (defvar gnus-agent-fetching nil
2093   "Whether Gnus agent is in fetching mode.")
2094
2095 (defvar gnus-agent-covered-methods nil)
2096
2097 (defvar gnus-command-method nil
2098   "Dynamically bound variable that says what the current back end is.")
2099
2100 (defvar gnus-current-select-method nil
2101   "The current method for selecting a newsgroup.")
2102
2103 (defvar gnus-tree-buffer "*Tree*"
2104   "Buffer where Gnus thread trees are displayed.")
2105
2106 ;; Dummy variable.
2107 (defvar gnus-use-generic-from nil)
2108
2109 ;; Variable holding the user answers to all method prompts.
2110 (defvar gnus-method-history nil)
2111
2112 ;; Variable holding the user answers to all mail method prompts.
2113 (defvar gnus-mail-method-history nil)
2114
2115 ;; Variable holding the user answers to all group prompts.
2116 (defvar gnus-group-history nil)
2117
2118 (defvar gnus-server-alist nil
2119   "List of available servers.")
2120
2121 (defcustom gnus-cache-directory
2122   (nnheader-concat gnus-directory "cache/")
2123   "*The directory where cached articles will be stored."
2124   :group 'gnus-cache
2125   :type 'directory)
2126
2127 (defvar gnus-predefined-server-alist
2128   `(("cache"
2129      nnspool "cache"
2130      (nnspool-spool-directory ,gnus-cache-directory)
2131      (nnspool-nov-directory ,gnus-cache-directory)
2132      (nnspool-active-file
2133       ,(nnheader-concat gnus-cache-directory "active"))))
2134   "List of predefined (convenience) servers.")
2135
2136 (defvar gnus-topic-indentation "");; Obsolete variable.
2137
2138 (defconst gnus-article-mark-lists
2139   '((marked . tick) (replied . reply)
2140     (expirable . expire) (killed . killed)
2141     (bookmarks . bookmark) (dormant . dormant)
2142     (scored . score) (saved . save)
2143     (cached . cache) (downloadable . download)
2144     (unsendable . unsend) (forwarded . forward)
2145     (recent . recent) (seen . seen)))
2146
2147 (defconst gnus-article-special-mark-lists
2148   '((seen range)
2149     (killed range)
2150     (bookmark tuple)
2151     (score tuple)))
2152
2153 ;; Propagate flags to server, with the following exceptions:
2154 ;; `seen' is private to each gnus installation
2155 ;; `cache' is a internal gnus flag for each gnus installation
2156 ;; `download' is a agent flag private to each gnus installation
2157 ;; `unsend' are for nndraft groups only
2158 ;; `score' is not a proper mark
2159 ;; `bookmark': don't propagated it, or fix the bug in update-mark.
2160 (defconst gnus-article-unpropagated-mark-lists
2161   '(seen cache download unsend score bookmark)
2162   "Marks that shouldn't be propagated to back ends.
2163 Typical marks are those that make no sense in a standalone back end,
2164 such as a mark that says whether an article is stored in the cache
2165 \(which doesn't make sense in a standalone back end).")
2166
2167 (defvar gnus-headers-retrieved-by nil)
2168 (defvar gnus-article-reply nil)
2169 (defvar gnus-override-method nil)
2170 (defvar gnus-article-check-size nil)
2171 (defvar gnus-opened-servers nil)
2172
2173 (defvar gnus-current-kill-article nil)
2174
2175 (defvar gnus-have-read-active-file nil)
2176
2177 (defconst gnus-maintainer
2178   "semi-gnus-ja@meadowy.org (T-gnus Bugfixing Girls + Boys)"
2179   "The mail address of the T-gnus maintainers.")
2180
2181 (defcustom gnus-info-filename nil
2182   "*Controls language of gnus Info.
2183 If nil and current-language-environment is Japanese, go to gnus-ja.
2184 Otherwise go to corresponding Info.
2185 This variable can be nil, gnus or gnus-ja."
2186   :group 'gnus-start
2187   :type '(choice (const nil)
2188                  (const :tag "English" gnus)
2189                  (const :tag "Japanese" gnus-ja)))
2190
2191 (defvar gnus-info-nodes
2192   '((gnus-group-mode "Group Buffer")
2193     (gnus-summary-mode "Summary Buffer")
2194     (gnus-article-mode "Article Buffer")
2195     (gnus-server-mode "Server Buffer")
2196     (gnus-browse-mode "Browse Foreign Server")
2197     (gnus-tree-mode "Tree Display"))
2198   "Alist of major modes and related Info nodes.")
2199
2200 (defvar gnus-group-buffer "*Group*")
2201 (defvar gnus-summary-buffer "*Summary*")
2202 (defvar gnus-article-buffer "*Article*")
2203 (defvar gnus-server-buffer "*Server*")
2204
2205 (defvar gnus-slave nil
2206   "Whether this Gnus is a slave or not.")
2207
2208 (defvar gnus-batch-mode nil
2209   "Whether this Gnus is running in batch mode or not.")
2210
2211 (defvar gnus-variable-list
2212   '(gnus-newsrc-options gnus-newsrc-options-n
2213                         gnus-newsrc-last-checked-date
2214                         gnus-newsrc-alist gnus-server-alist
2215                         gnus-killed-list gnus-zombie-list
2216                         gnus-topic-topology gnus-topic-alist
2217                         gnus-agent-covered-methods)
2218   "Gnus variables saved in the quick startup file.")
2219
2220 (defvar gnus-product-variable-file-list
2221   (let ((version (product-version (product-find 'gnus-vers)))
2222         (codesys (static-if (boundp 'MULE) '*ctext* 'ctext)))
2223     `(("strict-cache"
2224        ((product-version ,version)
2225         (emacs-version)
2226         (correct-string-widths))
2227        binary
2228        gnus-format-specs-compiled)
2229       ("cache"
2230        ((product-version ,version)
2231         (emacs-version)
2232         (correct-string-widths))
2233        ,codesys
2234        gnus-format-specs)))
2235   "Alist of the methods for checking whether the contents of the T-gnus
2236 quick startup files are valid.  One is for the byte-compiled format
2237 specifications, the other is for the source form.  Each element should
2238 be a list which looks like follows:
2239
2240 \(\"FILE_NAME\"
2241  ((VARIABLE EXPECTED_VALUE_or_NIL)
2242   (VARIABLE EXPECTED_VALUE_or_NIL)
2243   ...)
2244  CODING-SYSTEM_FOR_READING_FILE
2245  SYMBOL_OF_FORMAT_SPECS)")
2246
2247 (defcustom gnus-compile-user-specs t
2248   "If non-nil, the user-defined format specs will be byte-compiled
2249 automatically.
2250 It has an effect on the values of `gnus-*-line-format-spec'."
2251   :group 'gnus
2252   :type 'boolean)
2253
2254 (defvar gnus-newsrc-alist nil
2255   "Assoc list of read articles.
2256 gnus-newsrc-hashtb should be kept so that both hold the same information.")
2257
2258 (defvar gnus-newsrc-hashtb nil
2259   "Hashtable of gnus-newsrc-alist.")
2260
2261 (defvar gnus-killed-list nil
2262   "List of killed newsgroups.")
2263
2264 (defvar gnus-killed-hashtb nil
2265   "Hash table equivalent of gnus-killed-list.")
2266
2267 (defvar gnus-zombie-list nil
2268   "List of almost dead newsgroups.")
2269
2270 (defvar gnus-description-hashtb nil
2271   "Descriptions of newsgroups.")
2272
2273 (defvar gnus-list-of-killed-groups nil
2274   "List of newsgroups that have recently been killed by the user.")
2275
2276 (defvar gnus-active-hashtb nil
2277   "Hashtable of active articles.")
2278
2279 (defvar gnus-moderated-hashtb nil
2280   "Hashtable of moderated newsgroups.")
2281
2282 ;; Save window configuration.
2283 (defvar gnus-prev-winconf nil)
2284
2285 (defvar gnus-reffed-article-number nil)
2286
2287 ;;; Let the byte-compiler know that we know about this variable.
2288 (defvar rmail-default-rmail-file)
2289
2290 (defvar gnus-dead-summary nil)
2291
2292 (defvar gnus-invalid-group-regexp "[: `'\"/]\\|^$"
2293   "Regexp matching invalid groups.")
2294
2295 (defvar gnus-other-frame-object nil
2296   "A frame object which will be created by `gnus-other-frame'.")
2297
2298 ;;; End of variables.
2299
2300 ;; Define some autoload functions Gnus might use.
2301 (eval-and-compile
2302
2303   ;; This little mapcar goes through the list below and marks the
2304   ;; symbols in question as autoloaded functions.
2305   (mapcar
2306    (lambda (package)
2307      (let ((interactive (nth 1 (memq ':interactive package))))
2308        (mapcar
2309         (lambda (function)
2310           (let (keymap)
2311             (when (consp function)
2312               (setq keymap (car (memq 'keymap function)))
2313               (setq function (car function)))
2314             (unless (fboundp function)
2315               (autoload function (car package) nil interactive keymap))))
2316         (if (eq (nth 1 package) ':interactive)
2317             (nthcdr 3 package)
2318           (cdr package)))))
2319    '(("info" :interactive t Info-goto-node)
2320      ("pp" pp-to-string)
2321      ("ps-print" ps-print-preprint)
2322      ("message" :interactive t
2323       message-send-and-exit message-yank-original)
2324      ("babel" babel-as-string)
2325      ("nnmail" nnmail-split-fancy nnmail-article-group)
2326      ("nnvirtual" nnvirtual-catchup-group nnvirtual-convert-headers)
2327      ("rmailout" rmail-output rmail-output-to-rmail-file)
2328      ("rmail" rmail-insert-rmail-file-header rmail-count-new-messages
2329       rmail-show-message rmail-summary-exists
2330       rmail-select-summary rmail-update-summary)
2331      ("gnus-audio" :interactive t gnus-audio-play)
2332      ("gnus-xmas" gnus-xmas-splash)
2333      ("gnus-soup" :interactive t
2334       gnus-group-brew-soup gnus-brew-soup gnus-soup-add-article
2335       gnus-soup-send-replies gnus-soup-save-areas gnus-soup-pack-packet)
2336      ("nnsoup" nnsoup-pack-replies)
2337      ("score-mode" :interactive t gnus-score-mode)
2338      ("gnus-mh" gnus-summary-save-article-folder
2339       gnus-Folder-save-name gnus-folder-save-name)
2340      ("gnus-mh" :interactive t gnus-summary-save-in-folder)
2341      ("gnus-demon" gnus-demon-add-nocem gnus-demon-add-scanmail
2342       gnus-demon-add-rescan gnus-demon-add-scan-timestamps
2343       gnus-demon-add-disconnection gnus-demon-add-handler
2344       gnus-demon-remove-handler)
2345      ("gnus-demon" :interactive t
2346       gnus-demon-init gnus-demon-cancel)
2347      ("gnus-fun" gnus-convert-gray-x-face-to-xpm gnus-display-x-face-in-from
2348       gnus-convert-image-to-gray-x-face)
2349      ("gnus-salt" gnus-highlight-selected-tree gnus-possibly-generate-tree
2350       gnus-tree-open gnus-tree-close gnus-carpal-setup-buffer)
2351      ("gnus-nocem" gnus-nocem-scan-groups gnus-nocem-close
2352       gnus-nocem-unwanted-article-p)
2353      ("gnus-srvr" gnus-enter-server-buffer gnus-server-set-info
2354       gnus-server-server-name)
2355      ("gnus-srvr" gnus-browse-foreign-server)
2356      ("gnus-cite" :interactive t
2357       gnus-article-highlight-citation gnus-article-hide-citation-maybe
2358       gnus-article-hide-citation gnus-article-fill-cited-article
2359       gnus-article-hide-citation-in-followups)
2360      ("gnus-kill" gnus-kill gnus-apply-kill-file-internal
2361       gnus-kill-file-edit-file gnus-kill-file-raise-followups-to-author
2362       gnus-execute gnus-expunge gnus-batch-kill gnus-batch-score)
2363      ("gnus-cache" gnus-cache-possibly-enter-article gnus-cache-save-buffers
2364       gnus-cache-possibly-remove-articles gnus-cache-request-article
2365       gnus-cache-retrieve-headers gnus-cache-possibly-alter-active
2366       gnus-cache-enter-remove-article gnus-cached-article-p
2367       gnus-cache-open gnus-cache-close gnus-cache-update-article
2368       gnus-cache-articles-in-group)
2369      ("gnus-cache" :interactive t gnus-jog-cache gnus-cache-enter-article
2370       gnus-cache-remove-article gnus-summary-insert-cached-articles)
2371      ("gnus-score" :interactive t
2372       gnus-summary-increase-score gnus-summary-set-score
2373       gnus-summary-raise-thread gnus-summary-raise-same-subject
2374       gnus-summary-raise-score gnus-summary-raise-same-subject-and-select
2375       gnus-summary-lower-thread gnus-summary-lower-same-subject
2376       gnus-summary-lower-score gnus-summary-lower-same-subject-and-select
2377       gnus-summary-current-score gnus-score-delta-default
2378       gnus-score-flush-cache gnus-score-close
2379       gnus-possibly-score-headers gnus-score-followup-article
2380       gnus-score-followup-thread)
2381      ("gnus-score"
2382       (gnus-summary-score-map keymap) gnus-score-save gnus-score-headers
2383       gnus-current-score-file-nondirectory gnus-score-adaptive
2384       gnus-score-find-trace gnus-score-file-name)
2385      ("gnus-cus" :interactive t gnus-custom-mode gnus-group-customize
2386       gnus-score-customize)
2387      ("gnus-topic" :interactive t gnus-topic-mode)
2388      ("gnus-topic" gnus-topic-remove-group gnus-topic-set-parameters
2389       gnus-subscribe-topics)
2390      ("gnus-salt" :interactive t gnus-pick-mode gnus-binary-mode)
2391      ("gnus-uu" (gnus-uu-extract-map keymap) (gnus-uu-mark-map keymap))
2392      ("gnus-uu" :interactive t
2393       gnus-uu-digest-mail-forward gnus-uu-digest-post-forward
2394       gnus-uu-mark-series gnus-uu-mark-region gnus-uu-mark-buffer
2395       gnus-uu-mark-by-regexp gnus-uu-mark-all
2396       gnus-uu-mark-sparse gnus-uu-mark-thread gnus-uu-decode-uu
2397       gnus-uu-decode-uu-and-save gnus-uu-decode-unshar
2398       gnus-uu-decode-unshar-and-save gnus-uu-decode-save
2399       gnus-uu-decode-binhex gnus-uu-decode-uu-view
2400       gnus-uu-decode-uu-and-save-view gnus-uu-decode-unshar-view
2401       gnus-uu-decode-unshar-and-save-view gnus-uu-decode-save-view
2402       gnus-uu-decode-binhex-view gnus-uu-unmark-thread
2403       gnus-uu-mark-over gnus-uu-post-news)
2404      ("gnus-uu" gnus-uu-delete-work-dir gnus-quote-arg-for-sh-or-csh
2405       gnus-uu-unmark-thread)
2406      ("gnus-msg" (gnus-summary-send-map keymap)
2407       gnus-article-mail gnus-copy-article-buffer gnus-following-method)
2408      ("gnus-msg" :interactive t
2409       gnus-group-post-news gnus-group-mail gnus-group-news
2410       gnus-summary-post-news gnus-summary-news-other-window
2411       gnus-summary-followup gnus-summary-followup-with-original
2412       gnus-summary-cancel-article gnus-summary-supersede-article
2413       gnus-post-news gnus-summary-reply gnus-summary-reply-with-original
2414       gnus-summary-mail-forward gnus-summary-mail-other-window
2415       gnus-summary-resend-message gnus-summary-resend-bounced-mail
2416       gnus-summary-wide-reply gnus-summary-followup-to-mail
2417       gnus-summary-followup-to-mail-with-original gnus-bug
2418       gnus-summary-wide-reply-with-original gnus-summary-post-forward
2419       gnus-summary-digest-mail-forward gnus-summary-digest-post-forward)
2420      ("gnus-picon" :interactive t gnus-treat-from-picon)
2421      ("gnus-gl" bbb-login bbb-logout bbb-grouplens-group-p
2422       gnus-grouplens-mode)
2423      ("smiley" :interactive t smiley-region)
2424      ("gnus-win" gnus-configure-windows gnus-add-configuration)
2425      ("gnus-sum" gnus-summary-insert-line gnus-summary-read-group
2426       gnus-list-of-unread-articles gnus-list-of-read-articles
2427       gnus-offer-save-summaries gnus-make-thread-indent-array
2428       gnus-summary-exit gnus-update-read-articles gnus-summary-last-subject
2429       gnus-summary-skip-intangible gnus-summary-article-number
2430       gnus-data-header gnus-data-find gnus-summary-jump-to-other-group)
2431      ("gnus-group" gnus-group-insert-group-line gnus-group-quit
2432       gnus-group-list-groups gnus-group-first-unread-group
2433       gnus-group-set-mode-line gnus-group-set-info gnus-group-save-newsrc
2434       gnus-group-setup-buffer gnus-group-get-new-news
2435       gnus-group-make-help-group gnus-group-update-group
2436       gnus-group-iterate gnus-group-group-name)
2437      ("gnus-bcklg" gnus-backlog-request-article gnus-backlog-enter-article
2438       gnus-backlog-remove-article)
2439      ("gnus-art" gnus-article-read-summary-keys gnus-article-save
2440       gnus-article-prepare gnus-article-set-window-start
2441       gnus-article-next-page gnus-article-prev-page
2442       gnus-request-article-this-buffer gnus-article-mode
2443       gnus-article-setup-buffer gnus-narrow-to-page
2444       gnus-article-delete-invisible-text gnus-treat-article)
2445      ("gnus-art" :interactive t
2446       gnus-article-hide-headers gnus-article-hide-boring-headers
2447       gnus-article-treat-overstrike
2448       gnus-article-remove-cr gnus-article-remove-trailing-blank-lines
2449       gnus-article-display-x-face
2450       gnus-article-decode-HZ
2451       gnus-article-wash-html
2452       gnus-article-unsplit-urls
2453       gnus-article-hide-pgp
2454       gnus-article-hide-pem gnus-article-hide-signature
2455       gnus-article-strip-leading-blank-lines gnus-article-date-local
2456       gnus-article-date-original gnus-article-date-lapsed
2457       gnus-article-show-all-headers
2458       ;; gnus-article-show-all
2459       gnus-article-edit-mode gnus-article-edit-article
2460       gnus-article-edit-done article-decode-encoded-words
2461       gnus-start-date-timer gnus-stop-date-timer)
2462      ("gnus-int" gnus-request-type)
2463      ("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1
2464       gnus-dribble-enter gnus-read-init-file gnus-dribble-touch)
2465      ("gnus-dup" gnus-dup-suppress-articles gnus-dup-unsuppress-article
2466       gnus-dup-enter-articles)
2467      ("gnus-range" gnus-copy-sequence)
2468      ("gnus-eform" gnus-edit-form)
2469      ("gnus-move" :interactive t
2470       gnus-group-move-group-to-server gnus-change-server)
2471      ("gnus-logic" gnus-score-advanced)
2472      ("gnus-undo" gnus-undo-mode gnus-undo-register)
2473      ("gnus-async" gnus-async-request-fetched-article gnus-async-prefetch-next
2474       gnus-async-prefetch-article gnus-async-prefetch-remove-group
2475       gnus-async-halt-prefetch)
2476      ("gnus-offline"
2477       gnus-offline-setup)
2478      ("gnus-offline" :interactive t
2479       gnus-offline-toggle-plugged
2480       gnus-offline-set-unplugged-state
2481       gnus-offline-toggle-auto-hangup
2482       gnus-offline-toggle-on/off-send-mail
2483       gnus-offline-toggle-articles-to-fetch
2484       gnus-offline-set-interval-time
2485       gnus-offline-agent-expire)
2486      ("miee" :interactive t gnspool-get-news
2487       mail-spool-send news-spool-post)
2488      ("international/mw32misc" define-process-argument-editing
2489       general-process-argument-editing-function)
2490      ("gnus-agent" gnus-open-agent gnus-agent-get-function
2491       gnus-agent-save-groups gnus-agent-save-active gnus-agent-method-p
2492       gnus-agent-get-undownloaded-list gnus-agent-fetch-session
2493       gnus-summary-set-agent-mark gnus-agent-save-group-info
2494       gnus-agent-request-article gnus-agent-retrieve-headers)
2495      ("gnus-agent" :interactive t
2496       gnus-unplugged gnus-agentize gnus-agent-batch)
2497      ("gnus-vm" :interactive t gnus-summary-save-in-vm
2498       gnus-summary-save-article-vm)
2499      ("compface" uncompface)
2500      ("gnus-draft" :interactive t gnus-draft-mode gnus-group-send-queue)
2501      ("gnus-mlspl" gnus-group-split gnus-group-split-fancy)
2502      ("gnus-mlspl" :interactive t gnus-group-split-setup
2503       gnus-group-split-update)
2504      ("gnus-delay" gnus-delay-initialize))))
2505
2506 (eval-and-compile
2507   (unless (featurep 'xemacs)
2508     (if (>= emacs-major-version 21)
2509         (autoload 'x-face-decode-message-header "x-face-e21")
2510       (autoload 'x-face-mule-gnus-article-display-x-face "x-face-mule"))))
2511
2512 (unless (and (fboundp 'base64-encode-string)
2513              (subrp (symbol-function 'base64-encode-string)))
2514   (require 'base64))
2515
2516 ;; To search articles with Namazu.
2517 (autoload 'gnus-namazu-search "gnus-namazu" nil t)
2518 (autoload 'gnus-namazu-create-index "gnus-namazu" nil t)
2519 (autoload 'gnus-namazu-update-index "gnus-namazu" nil t)
2520 (autoload 'gnus-namazu-update-all-indices "gnus-namazu" nil t)
2521
2522 ;; To make nnir groups.
2523 (autoload 'gnus-group-make-nnir-group "nnir" nil t)
2524
2525 ;; To make shimbun groups.
2526 (autoload 'gnus-group-make-shimbun-group "nnshimbun" nil t)
2527
2528 ;; A tool for the developers.
2529 (autoload 'find-cl-run-time-functions "gnus-clfns" nil t)
2530
2531 ;;; gnus-sum.el thingies
2532
2533
2534 (defcustom gnus-summary-line-format "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n"
2535   "*The format specification of the lines in the summary buffer.
2536
2537 It works along the same lines as a normal formatting string,
2538 with some simple extensions.
2539
2540 %N   Article number, left padded with spaces (string)
2541 %S   Subject (string)
2542 %s   Subject if it is at the root of a thread, and \"\" otherwise (string)
2543 %n   Name of the poster (string)
2544 %a   Extracted name of the poster (string)
2545 %A   Extracted address of the poster (string)
2546 %F   Contents of the From: header (string)
2547 %f   Contents of the From: or To: headers (string)
2548 %x   Contents of the Xref: header (string)
2549 %D   Date of the article (string)
2550 %d   Date of the article (string) in DD-MMM format
2551 %o   Date of the article (string) in YYYYMMDD`T'HHMMSS format
2552 %M   Message-id of the article (string)
2553 %r   References of the article (string)
2554 %c   Number of characters in the article (integer)
2555 %k   Pretty-printed version of the above (string)
2556      For example, \"1.2k\" or \"0.4M\".
2557 %L   Number of lines in the article (integer)
2558 %I   Indentation based on thread level (a string of spaces)
2559 %B   A complex trn-style thread tree (string)
2560      The variables `gnus-sum-thread-*' can be used for customization.
2561 %T   A string with two possible values: 80 spaces if the article
2562      is on thread level two or larger and 0 spaces on level one
2563 %R   \"A\" if this article has been replied to, \" \" otherwise (character)
2564 %U   Status of this article (character, \"R\", \"K\", \"-\" or \" \")
2565 %[   Opening bracket (character, \"[\" or \"<\")
2566 %]   Closing bracket (character, \"]\" or \">\")
2567 %>   Spaces of length thread-level (string)
2568 %<   Spaces of length (- 20 thread-level) (string)
2569 %i   Article score (number)
2570 %z   Article zcore (character)
2571 %t   Number of articles under the current thread (number).
2572 %e   Whether the thread is empty or not (character).
2573 %l   GroupLens score (string).
2574 %V   Total thread score (number).
2575 %P   The line number (number).
2576 %O   Download mark (character).
2577 %C   If present, indicates desired cursor position
2578      (instead of after first colon).
2579 %u   User defined specifier.  The next character in the format string should
2580      be a letter.  Gnus will call the function gnus-user-format-function-X,
2581      where X is the letter following %u.  The function will be passed the
2582      current header as argument.  The function should return a string, which
2583      will be inserted into the summary just like information from any other
2584      summary specifier.
2585
2586 The %U (status), %R (replied) and %z (zcore) specs have to be handled
2587 with care.  For reasons of efficiency, Gnus will compute what column
2588 these characters will end up in, and \"hard-code\" that.  This means that
2589 it is invalid to have these specs after a variable-length spec.  Well,
2590 you might not be arrested, but your summary buffer will look strange,
2591 which is bad enough.
2592
2593 The smart choice is to have these specs as far to the left as
2594 possible.
2595
2596 This restriction may disappear in later versions of Gnus.
2597
2598 General format specifiers can also be used.
2599 See Info node `(gnus)Formatting Variables'."
2600   :link '(custom-manual "(gnus)Formatting Variables")
2601   :type 'string
2602   :group 'gnus-summary-format)
2603
2604 ;;;
2605 ;;; Skeleton keymaps
2606 ;;;
2607
2608 (defun gnus-suppress-keymap (keymap)
2609   (suppress-keymap keymap)
2610   (let ((keys `([backspace] [delete] "\177" "\M-u"))) ;gnus-mouse-2
2611     (while keys
2612       (define-key keymap (pop keys) 'undefined))))
2613
2614 (defvar gnus-article-mode-map
2615   (let ((keymap (make-sparse-keymap)))
2616     (gnus-suppress-keymap keymap)
2617     keymap))
2618 (defvar gnus-summary-mode-map
2619   (let ((keymap (make-keymap)))
2620     (gnus-suppress-keymap keymap)
2621     keymap))
2622 (defvar gnus-group-mode-map
2623   (let ((keymap (make-keymap)))
2624     (gnus-suppress-keymap keymap)
2625     keymap))
2626
2627 \f
2628
2629 ;; Fix by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
2630 ;; If you want the cursor to go somewhere else, set these two
2631 ;; functions in some startup hook to whatever you want.
2632 (defalias 'gnus-summary-position-point 'gnus-goto-colon)
2633 (defalias 'gnus-group-position-point 'gnus-goto-colon)
2634
2635 ;;; Various macros and substs.
2636
2637 (defun gnus-header-from (header)
2638   (mail-header-from header))
2639
2640 (defmacro gnus-gethash (string hashtable)
2641   "Get hash value of STRING in HASHTABLE."
2642   `(symbol-value (intern-soft ,string ,hashtable)))
2643
2644 (defmacro gnus-gethash-safe (string hashtable)
2645   "Get hash value of STRING in HASHTABLE.
2646 Return nil if not defined."
2647   `(let ((sym (intern-soft ,string ,hashtable)))
2648      (and (boundp sym) (symbol-value sym))))
2649
2650 (defmacro gnus-sethash (string value hashtable)
2651   "Set hash value.  Arguments are STRING, VALUE, and HASHTABLE."
2652   `(set (intern ,string ,hashtable) ,value))
2653 (put 'gnus-sethash 'edebug-form-spec '(form form form))
2654
2655 (defmacro gnus-group-unread (group)
2656   "Get the currently computed number of unread articles in GROUP."
2657   `(car (gnus-gethash ,group gnus-newsrc-hashtb)))
2658
2659 (defmacro gnus-group-entry (group)
2660   "Get the newsrc entry for GROUP."
2661   `(gnus-gethash ,group gnus-newsrc-hashtb))
2662
2663 (defmacro gnus-active (group)
2664   "Get active info on GROUP."
2665   `(gnus-gethash ,group gnus-active-hashtb))
2666
2667 (defmacro gnus-set-active (group active)
2668   "Set GROUP's active info."
2669   `(gnus-sethash ,group ,active gnus-active-hashtb))
2670
2671 ;; Info access macros.
2672
2673 (defmacro gnus-info-group (info)
2674   `(nth 0 ,info))
2675 (defmacro gnus-info-rank (info)
2676   `(nth 1 ,info))
2677 (defmacro gnus-info-read (info)
2678   `(nth 2 ,info))
2679 (defmacro gnus-info-marks (info)
2680   `(nth 3 ,info))
2681 (defmacro gnus-info-method (info)
2682   `(nth 4 ,info))
2683 (defmacro gnus-info-params (info)
2684   `(nth 5 ,info))
2685
2686 (defmacro gnus-info-level (info)
2687   `(let ((rank (gnus-info-rank ,info)))
2688      (if (consp rank)
2689          (car rank)
2690        rank)))
2691 (defmacro gnus-info-score (info)
2692   `(let ((rank (gnus-info-rank ,info)))
2693      (or (and (consp rank) (cdr rank)) 0)))
2694
2695 (defmacro gnus-info-set-group (info group)
2696   `(setcar ,info ,group))
2697 (defmacro gnus-info-set-rank (info rank)
2698   `(setcar (nthcdr 1 ,info) ,rank))
2699 (defmacro gnus-info-set-read (info read)
2700   `(setcar (nthcdr 2 ,info) ,read))
2701 (defmacro gnus-info-set-marks (info marks &optional extend)
2702   (if extend
2703       `(gnus-info-set-entry ,info ,marks 3)
2704     `(setcar (nthcdr 3 ,info) ,marks)))
2705 (defmacro gnus-info-set-method (info method &optional extend)
2706   (if extend
2707       `(gnus-info-set-entry ,info ,method 4)
2708     `(setcar (nthcdr 4 ,info) ,method)))
2709 (defmacro gnus-info-set-params (info params &optional extend)
2710   (if extend
2711       `(gnus-info-set-entry ,info ,params 5)
2712     `(setcar (nthcdr 5 ,info) ,params)))
2713
2714 (defun gnus-info-set-entry (info entry number)
2715   ;; Extend the info until we have enough elements.
2716   (while (<= (length info) number)
2717     (nconc info (list nil)))
2718   ;; Set the entry.
2719   (setcar (nthcdr number info) entry))
2720
2721 (defmacro gnus-info-set-level (info level)
2722   `(let ((rank (cdr ,info)))
2723      (if (consp (car rank))
2724          (setcar (car rank) ,level)
2725        (setcar rank ,level))))
2726 (defmacro gnus-info-set-score (info score)
2727   `(let ((rank (cdr ,info)))
2728      (if (consp (car rank))
2729          (setcdr (car rank) ,score)
2730        (setcar rank (cons (car rank) ,score)))))
2731
2732 (defmacro gnus-get-info (group)
2733   `(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb)))
2734
2735 ;;; Load the compatibility functions.
2736
2737 (require 'gnus-ems)
2738
2739 \f
2740 ;;;
2741 ;;; Shutdown
2742 ;;;
2743
2744 (defvar gnus-shutdown-alist nil)
2745
2746 (defun gnus-add-shutdown (function &rest symbols)
2747   "Run FUNCTION whenever one of SYMBOLS is shut down."
2748   (push (cons function symbols) gnus-shutdown-alist))
2749
2750 (defun gnus-shutdown (symbol)
2751   "Shut down everything that waits for SYMBOL."
2752   (let ((alist gnus-shutdown-alist)
2753         entry)
2754     (while (setq entry (pop alist))
2755       (when (memq symbol (cdr entry))
2756         (funcall (car entry))))))
2757
2758 \f
2759 ;;;
2760 ;;; Gnus Utility Functions
2761 ;;;
2762
2763 (defun gnus-find-subscribed-addresses ()
2764   "Return a regexp matching the addresses of all subscribed mail groups.
2765 It consists of the `to-address' or `to-list' parameter of all groups
2766 with a `subscribed' parameter."
2767   (let (group address addresses)
2768     (dolist (entry (cdr gnus-newsrc-alist))
2769       (setq group (car entry))
2770       (when (gnus-parameter-subscribed group)
2771         (setq address (mail-strip-quoted-names
2772                        (or (gnus-group-fast-parameter group 'to-address)
2773                            (gnus-group-fast-parameter group 'to-list))))
2774         (when address
2775           (add-to-list 'addresses address))))
2776     (when addresses
2777       (list (mapconcat 'regexp-quote addresses "\\|")))))
2778
2779 (defmacro gnus-string-or (&rest strings)
2780   "Return the first element of STRINGS that is a non-blank string.
2781 STRINGS will be evaluated in normal `or' order."
2782   `(gnus-string-or-1 ',strings))
2783
2784 (defun gnus-string-or-1 (strings)
2785   (let (string)
2786     (while strings
2787       (setq string (eval (pop strings)))
2788       (if (string-match "^[ \t]*$" string)
2789           (setq string nil)
2790         (setq strings nil)))
2791     string))
2792
2793 (defun gnus-info-find-node (&optional nodename)
2794   "Find Info documentation of Gnus."
2795   (interactive)
2796   ;; Enlarge info window if needed.
2797   (let (gnus-info-buffer)
2798     (Info-goto-node
2799      (format "(%s)%s"
2800              (or gnus-info-filename
2801                  (get-language-info current-language-environment 'gnus-info)
2802                  "gnus")
2803              (or nodename
2804                  (cadr (assq major-mode gnus-info-nodes))
2805                  (and (eq (current-buffer) (get-buffer gnus-article-buffer))
2806                       (cadr (assq 'gnus-article-mode gnus-info-nodes))))))
2807     (setq gnus-info-buffer (current-buffer))
2808     (gnus-configure-windows 'info)))
2809
2810 ;;;
2811 ;;; gnus-interactive
2812 ;;;
2813
2814 (defvar gnus-current-prefix-symbol nil
2815   "Current prefix symbol.")
2816
2817 (defvar gnus-current-prefix-symbols nil
2818   "List of current prefix symbols.")
2819
2820 (defun gnus-interactive (string &optional params)
2821   "Return a list that can be fed to `interactive'.
2822 See `interactive' for full documentation.
2823
2824 Adds the following specs:
2825
2826 y -- The current symbolic prefix.
2827 Y -- A list of the current symbolic prefix(es).
2828 A -- Article number.
2829 H -- Article header.
2830 g -- Group name."
2831   (let ((i 0)
2832         out c prompt)
2833     (while (< i (length string))
2834       (string-match ".\\([^\n]*\\)\n?" string i)
2835       (setq c (aref string i))
2836       (when (match-end 1)
2837         (setq prompt (match-string 1 string)))
2838       (setq i (match-end 0))
2839       ;; We basically emulate just about everything that
2840       ;; `interactive' does, but add the specs listed above.
2841       (push
2842        (cond
2843         ((= c ?a)
2844          (completing-read prompt obarray 'fboundp t))
2845         ((= c ?b)
2846          (read-buffer prompt (current-buffer) t))
2847         ((= c ?B)
2848          (read-buffer prompt (other-buffer (current-buffer))))
2849         ((= c ?c)
2850          (read-char))
2851         ((= c ?C)
2852          (completing-read prompt obarray 'commandp t))
2853         ((= c ?d)
2854          (point))
2855         ((= c ?D)
2856          (read-file-name prompt nil default-directory 'lambda))
2857         ((= c ?f)
2858          (read-file-name prompt nil nil 'lambda))
2859         ((= c ?F)
2860          (read-file-name prompt))
2861         ((= c ?k)
2862          (read-key-sequence prompt))
2863         ((= c ?K)
2864          (error "Not implemented spec"))
2865         ((= c ?e)
2866          (error "Not implemented spec"))
2867         ((= c ?m)
2868          (mark))
2869         ((= c ?N)
2870          (error "Not implemented spec"))
2871         ((= c ?n)
2872          (string-to-number (read-from-minibuffer prompt)))
2873         ((= c ?p)
2874          (prefix-numeric-value current-prefix-arg))
2875         ((= c ?P)
2876          current-prefix-arg)
2877         ((= c ?r)
2878          'gnus-prefix-nil)
2879         ((= c ?s)
2880          (read-string prompt))
2881         ((= c ?S)
2882          (intern (read-string prompt)))
2883         ((= c ?v)
2884          (read-variable prompt))
2885         ((= c ?x)
2886          (read-minibuffer prompt))
2887         ((= c ?x)
2888          (eval-minibuffer prompt))
2889         ;; And here the new specs come.
2890         ((= c ?y)
2891          gnus-current-prefix-symbol)
2892         ((= c ?Y)
2893          gnus-current-prefix-symbols)
2894         ((= c ?g)
2895          (gnus-group-group-name))
2896         ((= c ?A)
2897          (gnus-summary-skip-intangible)
2898          (or (get-text-property (point) 'gnus-number)
2899              (gnus-summary-last-subject)))
2900         ((= c ?H)
2901          (gnus-data-header (gnus-data-find (gnus-summary-article-number))))
2902         (t
2903          (error "Non-implemented spec")))
2904        out)
2905       (cond
2906        ((= c ?r)
2907         (push (if (< (point) (mark)) (point) (mark)) out)
2908         (push (if (> (point) (mark)) (point) (mark)) out))))
2909     (setq out (delq 'gnus-prefix-nil out))
2910     (nreverse out)))
2911
2912 (defun gnus-symbolic-argument (&optional arg)
2913   "Read a symbolic argument and a command, and then execute command."
2914   (interactive "P")
2915   (let* ((in-command (this-command-keys))
2916          (command in-command)
2917          gnus-current-prefix-symbols
2918          gnus-current-prefix-symbol
2919          syms)
2920     (while (equal in-command command)
2921       (message "%s-" (key-description (this-command-keys)))
2922       (push (intern (char-to-string (read-char))) syms)
2923       (setq command (read-key-sequence nil t)))
2924     (setq gnus-current-prefix-symbols (nreverse syms)
2925           gnus-current-prefix-symbol (car gnus-current-prefix-symbols))
2926     (call-interactively (key-binding command t))))
2927
2928 ;;; More various functions.
2929
2930 (defsubst gnus-check-backend-function (func group)
2931   "Check whether GROUP supports function FUNC.
2932 GROUP can either be a string (a group name) or a select method."
2933   (ignore-errors
2934     (let ((method (if (stringp group)
2935                       (car (gnus-find-method-for-group group))
2936                     group)))
2937       (unless (featurep method)
2938         (require method))
2939       (fboundp (intern (format "%s-%s" method func))))))
2940
2941 (defun gnus-group-read-only-p (&optional group)
2942   "Check whether GROUP supports editing or not.
2943 If GROUP is nil, `gnus-newsgroup-name' will be checked instead.  Note
2944 that that variable is buffer-local to the summary buffers."
2945   (let ((group (or group gnus-newsgroup-name)))
2946     (not (gnus-check-backend-function 'request-replace-article group))))
2947
2948 (defun gnus-virtual-group-p (group)
2949   "Say whether GROUP is virtual or not."
2950   (memq 'virtual (assoc (symbol-name (car (gnus-find-method-for-group group)))
2951                         gnus-valid-select-methods)))
2952
2953 (defun gnus-news-group-p (group &optional article)
2954   "Return non-nil if GROUP (and ARTICLE) come from a news server."
2955   (cond ((gnus-member-of-valid 'post group) ;Ordinary news group
2956          t)                             ;is news of course.
2957         ((not (gnus-member-of-valid 'post-mail group)) ;Non-combined.
2958          nil)                           ;must be mail then.
2959         ((vectorp article)              ;Has header info.
2960          (eq (gnus-request-type group (mail-header-id article)) 'news))
2961         ((null article)                 ;Hasn't header info
2962          (eq (gnus-request-type group) 'news)) ;(unknown ==> mail)
2963         ((< article 0)                  ;Virtual message
2964          nil)                           ;we don't know, guess mail.
2965         (t                              ;Has positive number
2966          (eq (gnus-request-type group article) 'news)))) ;use it.
2967
2968 ;; Returns a list of writable groups.
2969 (defun gnus-writable-groups ()
2970   (let ((alist gnus-newsrc-alist)
2971         groups group)
2972     (while (setq group (car (pop alist)))
2973       (unless (gnus-group-read-only-p group)
2974         (push group groups)))
2975     (nreverse groups)))
2976
2977 ;; Check whether to use long file names.
2978 (defun gnus-use-long-file-name (symbol)
2979   ;; The variable has to be set...
2980   (and gnus-use-long-file-name
2981        ;; If it isn't a list, then we return t.
2982        (or (not (listp gnus-use-long-file-name))
2983            ;; If it is a list, and the list contains `symbol', we
2984            ;; return nil.
2985            (not (memq symbol gnus-use-long-file-name)))))
2986
2987 ;; Generate a unique new group name.
2988 (defun gnus-generate-new-group-name (leaf)
2989   (let ((name leaf)
2990         (num 0))
2991     (while (gnus-gethash name gnus-newsrc-hashtb)
2992       (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">")))
2993     name))
2994
2995 (defun gnus-ephemeral-group-p (group)
2996   "Say whether GROUP is ephemeral or not."
2997   (gnus-group-get-parameter group 'quit-config t))
2998
2999 (defun gnus-group-quit-config (group)
3000   "Return the quit-config of GROUP."
3001   (gnus-group-get-parameter group 'quit-config t))
3002
3003 (defun gnus-kill-ephemeral-group (group)
3004   "Remove ephemeral GROUP from relevant structures."
3005   (gnus-sethash group nil gnus-newsrc-hashtb))
3006
3007 (defun gnus-simplify-mode-line ()
3008   "Make mode lines a bit simpler."
3009   (setq mode-line-modified (cdr gnus-mode-line-modified))
3010   (when (listp mode-line-format)
3011     (make-local-variable 'mode-line-format)
3012     (setq mode-line-format (copy-sequence mode-line-format))
3013     (when (equal (nth 3 mode-line-format) "   ")
3014       (setcar (nthcdr 3 mode-line-format) " "))))
3015
3016 ;;; Servers and groups.
3017
3018 (defsubst gnus-server-add-address (method)
3019   (let ((method-name (symbol-name (car method))))
3020     (if (and (memq 'address (assoc method-name gnus-valid-select-methods))
3021              (not (assq (intern (concat method-name "-address")) method))
3022              (memq 'physical-address (assq (car method)
3023                                            gnus-valid-select-methods)))
3024         (append method (list (list (intern (concat method-name "-address"))
3025                                    (nth 1 method))))
3026       method)))
3027
3028 (defsubst gnus-server-to-method (server)
3029   "Map virtual server names to select methods."
3030   (or (and server (listp server) server)
3031       (cdr (assoc server gnus-server-method-cache))
3032       (let ((result
3033              (or
3034               ;; Perhaps this is the native server?
3035               (and (equal server "native") gnus-select-method)
3036               ;; It should be in the server alist.
3037               (cdr (assoc server gnus-server-alist))
3038               ;; It could be in the predefined server alist.
3039               (cdr (assoc server gnus-predefined-server-alist))
3040               ;; If not, we look through all the opened server
3041               ;; to see whether we can find it there.
3042               (let ((opened gnus-opened-servers))
3043                 (while (and opened
3044                             (not (equal server (format "%s:%s" (caaar opened)
3045                                                        (cadaar opened)))))
3046                   (pop opened))
3047                 (caar opened))
3048               ;; It could be a named method, search all servers
3049               (let ((servers gnus-secondary-select-methods))
3050                 (while (and servers
3051                             (not (equal server (format "%s:%s" (caar servers)
3052                                                        (cadar servers)))))
3053                   (pop servers))
3054                 (car servers)))))
3055         (push (cons server result) gnus-server-method-cache)
3056         result)))
3057
3058 (defsubst gnus-server-get-method (group method)
3059   ;; Input either a server name, and extended server name, or a
3060   ;; select method, and return a select method.
3061   (cond ((stringp method)
3062          (gnus-server-to-method method))
3063         ((equal method gnus-select-method)
3064          gnus-select-method)
3065         ((and (stringp (car method))
3066               group)
3067          (gnus-server-extend-method group method))
3068         ((and method
3069               (not group)
3070               (equal (cadr method) ""))
3071          method)
3072         (t
3073          (gnus-server-add-address method))))
3074
3075 (defmacro gnus-method-equal (ss1 ss2)
3076   "Say whether two servers are equal."
3077   `(let ((s1 ,ss1)
3078          (s2 ,ss2))
3079      (or (equal s1 s2)
3080          (and (= (length s1) (length s2))
3081               (progn
3082                 (while (and s1 (member (car s1) s2))
3083                   (setq s1 (cdr s1)))
3084                 (null s1))))))
3085
3086 (defun gnus-methods-equal-p (m1 m2)
3087   (let ((m1 (or m1 gnus-select-method))
3088         (m2 (or m2 gnus-select-method)))
3089     (or (equal m1 m2)
3090         (and (eq (car m1) (car m2))
3091              (or (not (memq 'address (assoc (symbol-name (car m1))
3092                                             gnus-valid-select-methods)))
3093                  (equal (nth 1 m1) (nth 1 m2)))))))
3094
3095 (defun gnus-server-equal (m1 m2)
3096   "Say whether two methods are equal."
3097   (let ((m1 (cond ((null m1) gnus-select-method)
3098                   ((stringp m1) (gnus-server-to-method m1))
3099                   (t m1)))
3100         (m2 (cond ((null m2) gnus-select-method)
3101                   ((stringp m2) (gnus-server-to-method m2))
3102                   (t m2))))
3103     (gnus-method-equal m1 m2)))
3104
3105 (defun gnus-servers-using-backend (backend)
3106   "Return a list of known servers using BACKEND."
3107   (let ((opened gnus-opened-servers)
3108         out)
3109     (while opened
3110       (when (eq backend (caaar opened))
3111         (push (caar opened) out))
3112       (pop opened))
3113     out))
3114
3115 (defun gnus-archive-server-wanted-p ()
3116   "Say whether the user wants to use the archive server."
3117   (cond
3118    ((or (not gnus-message-archive-method)
3119         (not gnus-message-archive-group))
3120     nil)
3121    ((and gnus-message-archive-method gnus-message-archive-group)
3122     t)
3123    (t
3124     (let ((active (cadr (assq 'nnfolder-active-file
3125                               gnus-message-archive-method))))
3126       (and active
3127            (file-exists-p active))))))
3128
3129 (defsubst gnus-method-to-server-name (method)
3130   (concat
3131    (format "%s" (car method))
3132    (when (and
3133           (or (assoc (format "%s" (car method))
3134                      (gnus-methods-using 'address))
3135               (gnus-server-equal method gnus-message-archive-method))
3136           (nth 1 method)
3137           (not (string= (nth 1 method) "")))
3138      (concat "+" (nth 1 method)))))
3139
3140 (defsubst gnus-method-to-full-server-name (method)
3141   (format "%s+%s" (car method) (nth 1 method)))
3142
3143 (defun gnus-group-prefixed-name (group method)
3144   "Return the whole name from GROUP and METHOD."
3145   (and (stringp method) (setq method (gnus-server-to-method method)))
3146   (if (or (not method)
3147           (gnus-server-equal method "native")
3148           (string-match ":" group))
3149       group
3150     (concat (gnus-method-to-server-name method) ":" group)))
3151
3152 (defun gnus-group-real-prefix (group)
3153   "Return the prefix of the current group name."
3154   (if (string-match "^[^:]+:" group)
3155       (substring group 0 (match-end 0))
3156     ""))
3157
3158 (defun gnus-group-method (group)
3159   "Return the server or method used for selecting GROUP.
3160 You should probably use `gnus-find-method-for-group' instead."
3161   (let ((prefix (gnus-group-real-prefix group)))
3162     (if (equal prefix "")
3163         gnus-select-method
3164       (let ((servers gnus-opened-servers)
3165             (server "")
3166             backend possible found)
3167         (if (string-match "^[^\\+]+\\+" prefix)
3168             (setq backend (intern (substring prefix 0 (1- (match-end 0))))
3169                   server (substring prefix (match-end 0) (1- (length prefix))))
3170           (setq backend (intern (substring prefix 0 (1- (length prefix))))))
3171         (while servers
3172           (when (eq (caaar servers) backend)
3173             (setq possible (caar servers))
3174             (when (equal (cadaar servers) server)
3175               (setq found (caar servers))))
3176           (pop servers))
3177         (or (car (rassoc found gnus-server-alist))
3178             found
3179             (car (rassoc possible gnus-server-alist))
3180             possible
3181             (list backend server))))))
3182
3183 (defsubst gnus-native-method-p (method)
3184   "Return whether METHOD is the native select method."
3185   (gnus-method-equal method gnus-select-method))
3186
3187 (defsubst gnus-secondary-method-p (method)
3188   "Return whether METHOD is a secondary select method."
3189   (let ((methods gnus-secondary-select-methods)
3190         (gmethod (gnus-server-get-method nil method)))
3191     (while (and methods
3192                 (not (gnus-method-equal
3193                       (gnus-server-get-method nil (car methods))
3194                       gmethod)))
3195       (setq methods (cdr methods)))
3196     methods))
3197
3198 (defun gnus-method-simplify (method)
3199   "Return the shortest uniquely identifying string or method for METHOD."
3200   (cond ((stringp method)
3201          method)
3202         ((gnus-native-method-p method)
3203          nil)
3204         ((gnus-secondary-method-p method)
3205          (format "%s:%s" (nth 0 method) (nth 1 method)))
3206         (t
3207          method)))
3208
3209 (defun gnus-groups-from-server (server)
3210   "Return a list of all groups that are fetched from SERVER."
3211   (let ((alist (cdr gnus-newsrc-alist))
3212         info groups)
3213     (while (setq info (pop alist))
3214       (when (gnus-server-equal (gnus-info-method info) server)
3215         (push (gnus-info-group info) groups)))
3216     (sort groups 'string<)))
3217
3218 (defun gnus-group-foreign-p (group)
3219   "Say whether a group is foreign or not."
3220   (and (not (gnus-group-native-p group))
3221        (not (gnus-group-secondary-p group))))
3222
3223 (defun gnus-group-native-p (group)
3224   "Say whether the group is native or not."
3225   (not (string-match ":" group)))
3226
3227 (defun gnus-group-secondary-p (group)
3228   "Say whether the group is secondary or not."
3229   (gnus-secondary-method-p (gnus-find-method-for-group group)))
3230
3231 (defun gnus-parameters-get-parameter (group)
3232   "Return the group parameters for GROUP from `gnus-parameters'."
3233   (let (params-list)
3234     (dolist (elem gnus-parameters)
3235       (when (string-match (car elem) group)
3236         (setq params-list
3237               (nconc (gnus-expand-group-parameters
3238                       (car elem) (cdr elem) group)
3239                      params-list))))
3240     params-list))
3241
3242 (defun gnus-expand-group-parameter (match value group)
3243   "Use MATCH to expand VALUE in GROUP."
3244   (with-temp-buffer
3245     (insert group)
3246     (goto-char (point-min))
3247     (while (re-search-forward match nil t)
3248       (replace-match value))
3249     (buffer-string)))
3250
3251 (defun gnus-expand-group-parameters (match parameters group)
3252   "Go through PARAMETERS and expand them according to the match data."
3253   (let (new)
3254     (dolist (elem parameters)
3255       (if (and (stringp (cdr elem))
3256                (string-match "\\\\[0-9&]" (cdr elem)))
3257           (push (cons (car elem)
3258                       (gnus-expand-group-parameter match (cdr elem) group))
3259                 new)
3260         (push elem new)))
3261     new))
3262
3263 (defun gnus-group-fast-parameter (group symbol &optional allow-list)
3264   "For GROUP, return the value of SYMBOL.
3265
3266 You should call this in the `gnus-group-buffer' buffer.
3267 The function `gnus-group-find-parameter' will do that for you."
3268   ;; The speed trick:  No cons'ing and quit early.
3269   (let* ((params (funcall gnus-group-get-parameter-function group))
3270          ;; Start easy, check the "real" group parameters.
3271          (simple-results
3272           (gnus-group-parameter-value params symbol allow-list t)))
3273     (if simple-results
3274         ;; Found results; return them.
3275         (car simple-results)
3276       ;; We didn't found it there, try `gnus-parameters'.
3277       (let ((result nil)
3278             (head nil)
3279             (tail gnus-parameters))
3280         ;; A good old-fashioned non-cl loop.
3281         (while tail
3282           (setq head (car tail)
3283                 tail (cdr tail))
3284           ;; The car is regexp matching for matching the group name.
3285           (when (string-match (car head) group)
3286             ;; The cdr is the parameters.
3287             (setq result (gnus-group-parameter-value (cdr head)
3288                                                      symbol allow-list))
3289             (when result
3290               ;; Expand if necessary.
3291               (if (and (stringp result) (string-match "\\\\[0-9&]" result))
3292                   (setq result (gnus-expand-group-parameter (car head)
3293                                                             result group)))
3294               ;; Exit the loop early.
3295               (setq tail nil))))
3296         ;; Done.
3297         result))))
3298
3299 (defun gnus-group-find-parameter (group &optional symbol allow-list)
3300   "Return the group parameters for GROUP.
3301 If SYMBOL, return the value of that symbol in the group parameters.
3302
3303 If you call this function inside a loop, consider using the faster
3304 `gnus-group-fast-parameter' instead."
3305   (save-excursion
3306     (set-buffer gnus-group-buffer)
3307     (if symbol
3308         (gnus-group-fast-parameter group symbol allow-list)
3309       (nconc
3310        (copy-sequence
3311         (funcall gnus-group-get-parameter-function group))
3312        (gnus-parameters-get-parameter group)))))
3313
3314 (defun gnus-group-get-parameter (group &optional symbol allow-list)
3315   "Return the group parameters for GROUP.
3316 If SYMBOL, return the value of that symbol in the group parameters.
3317 Most functions should use `gnus-group-find-parameter', which
3318 also examines the topic parameters."
3319   (let ((params (gnus-info-params (gnus-get-info group))))
3320     (if symbol
3321         (gnus-group-parameter-value params symbol allow-list)
3322       params)))
3323
3324 (defun gnus-group-parameter-value (params symbol &optional
3325                                           allow-list present-p)
3326   "Return the value of SYMBOL in group PARAMS."
3327   ;; We only wish to return group parameters (dotted lists) and
3328   ;; not local variables, which may have the same names.
3329   ;; But first we handle single elements...
3330   (or (car (memq symbol params))
3331       ;; Handle alist.
3332       (let (elem)
3333         (catch 'found
3334           (while (setq elem (pop params))
3335             (when (and (consp elem)
3336                        (eq (car elem) symbol)
3337                        (or allow-list
3338                            (atom (cdr elem))))
3339               (throw 'found (if present-p (list (cdr elem))
3340                               (cdr elem)))))))))
3341
3342 (defun gnus-group-add-parameter (group param)
3343   "Add parameter PARAM to GROUP."
3344   (let ((info (gnus-get-info group)))
3345     (when info
3346       (gnus-group-remove-parameter group (if (consp param) (car param) param))
3347       ;; Cons the new param to the old one and update.
3348       (gnus-group-set-info (cons param (gnus-info-params info))
3349                            group 'params))))
3350
3351 (defun gnus-group-set-parameter (group name value)
3352   "Set parameter NAME to VALUE in GROUP."
3353   (let ((info (gnus-get-info group)))
3354     (when info
3355       (gnus-group-remove-parameter group name)
3356       (let ((old-params (gnus-info-params info))
3357             (new-params (list (cons name value))))
3358         (while old-params
3359           (when (or (not (listp (car old-params)))
3360                     (not (eq (caar old-params) name)))
3361             (setq new-params (append new-params (list (car old-params)))))
3362           (setq old-params (cdr old-params)))
3363         (gnus-group-set-info new-params group 'params)))))
3364
3365 (defun gnus-group-remove-parameter (group name)
3366   "Remove parameter NAME from GROUP."
3367   (let ((info (gnus-get-info group)))
3368     (when info
3369       (let ((params (gnus-info-params info)))
3370         (when params
3371           (setq params (delq name params))
3372           (while (assq name params)
3373             (gnus-pull name params))
3374           (gnus-info-set-params info params))))))
3375
3376 (defun gnus-group-add-score (group &optional score)
3377   "Add SCORE to the GROUP score.
3378 If SCORE is nil, add 1 to the score of GROUP."
3379   (let ((info (gnus-get-info group)))
3380     (when info
3381       (gnus-info-set-score info (+ (gnus-info-score info) (or score 1))))))
3382
3383 (defun gnus-short-group-name (group &optional levels)
3384   "Collapse GROUP name LEVELS.
3385 Select methods are stripped and any remote host name is stripped down to
3386 just the host name."
3387   (let* ((name "")
3388          (foreign "")
3389          (depth 0)
3390          (skip 1)
3391          (levels (or levels
3392                      gnus-group-uncollapsed-levels
3393                      (progn
3394                        (while (string-match "\\." group skip)
3395                          (setq skip (match-end 0)
3396                                depth (+ depth 1)))
3397                        depth))))
3398     ;; Separate foreign select method from group name and collapse.
3399     ;; If method contains a server, collapse to non-domain server name,
3400     ;; otherwise collapse to select method.
3401     (let* ((colon (string-match ":" group))
3402            (server (and colon (substring group 0 colon)))
3403            (plus (and server (string-match "+" server))))
3404       (when server
3405         (if plus
3406             (setq foreign (substring server (+ 1 plus)
3407                                      (string-match "\\." server))
3408                   group (substring group (+ 1 colon)))
3409           (setq foreign server
3410                 group (substring group (+ 1 colon))))
3411         (setq foreign (concat foreign ":")))
3412       ;; Collapse group name leaving LEVELS uncollapsed elements
3413       (let* ((slist (split-string group "/"))
3414              (slen (length slist))
3415              (dlist (split-string group "\\."))
3416              (dlen (length dlist))
3417              glist
3418              glen
3419              gsep
3420              res)
3421         (if (> slen dlen)
3422             (setq glist slist
3423                   glen slen
3424                   gsep "/")
3425           (setq glist dlist
3426                 glen dlen
3427                 gsep "."))
3428         (setq levels (- glen levels))
3429         (dolist (g glist)
3430           (push (if (>= (decf levels) 0)
3431                     (if (zerop (length g))
3432                         ""
3433                       (substring g 0 1))
3434                   g)
3435                 res))
3436         (concat foreign (mapconcat 'identity (nreverse res) gsep))))))
3437
3438 (defun gnus-narrow-to-body ()
3439   "Narrow to the body of an article."
3440   (narrow-to-region
3441    (progn
3442      (goto-char (point-min))
3443      (or (search-forward "\n\n" nil t)
3444          (point-max)))
3445    (point-max)))
3446
3447 \f
3448 ;;;
3449 ;;; Kill file handling.
3450 ;;;
3451
3452 (defun gnus-apply-kill-file ()
3453   "Apply a kill file to the current newsgroup.
3454 Returns the number of articles marked as read."
3455   (if (or (file-exists-p (gnus-newsgroup-kill-file nil))
3456           (file-exists-p (gnus-newsgroup-kill-file gnus-newsgroup-name)))
3457       (gnus-apply-kill-file-internal)
3458     0))
3459
3460 (defun gnus-kill-save-kill-buffer ()
3461   (let ((file (gnus-newsgroup-kill-file gnus-newsgroup-name)))
3462     (when (get-file-buffer file)
3463       (save-excursion
3464         (set-buffer (get-file-buffer file))
3465         (when (buffer-modified-p)
3466           (save-buffer))
3467         (kill-buffer (current-buffer))))))
3468
3469 (defcustom gnus-kill-file-name "KILL"
3470   "Suffix of the kill files."
3471   :group 'gnus-score-kill
3472   :group 'gnus-score-files
3473   :type 'string)
3474
3475 (defun gnus-newsgroup-kill-file (newsgroup)
3476   "Return the name of a kill file name for NEWSGROUP.
3477 If NEWSGROUP is nil, return the global kill file name instead."
3478   (cond
3479    ;; The global KILL file is placed at top of the directory.
3480    ((or (null newsgroup)
3481         (string-equal newsgroup ""))
3482     (expand-file-name gnus-kill-file-name
3483                       gnus-kill-files-directory))
3484    ;; Append ".KILL" to newsgroup name.
3485    ((gnus-use-long-file-name 'not-kill)
3486     (expand-file-name (concat (gnus-newsgroup-savable-name newsgroup)
3487                               "." gnus-kill-file-name)
3488                       gnus-kill-files-directory))
3489    ;; Place "KILL" under the hierarchical directory.
3490    (t
3491     (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
3492                               "/" gnus-kill-file-name)
3493                       gnus-kill-files-directory))))
3494
3495 ;;; Server things.
3496
3497 (defun gnus-member-of-valid (symbol group)
3498   "Find out if GROUP has SYMBOL as part of its \"valid\" spec."
3499   (memq symbol (assoc
3500                 (symbol-name (car (gnus-find-method-for-group group)))
3501                 gnus-valid-select-methods)))
3502
3503 (defun gnus-method-option-p (method option)
3504   "Return non-nil if select METHOD has OPTION as a parameter."
3505   (when (stringp method)
3506     (setq method (gnus-server-to-method method)))
3507   (memq option (assoc (format "%s" (car method))
3508                       gnus-valid-select-methods)))
3509
3510 (defun gnus-similar-server-opened (method)
3511   (let ((opened gnus-opened-servers))
3512     (while (and method opened)
3513       (when (and (equal (cadr method) (cadaar opened))
3514                  (equal (car method) (caaar opened))
3515                  (not (equal method (caar opened))))
3516         (setq method nil))
3517       (pop opened))
3518     (not method)))
3519
3520 (defun gnus-server-extend-method (group method)
3521   ;; This function "extends" a virtual server.  If the server is
3522   ;; "hello", and the select method is ("hello" (my-var "something"))
3523   ;; in the group "alt.alt", this will result in a new virtual server
3524   ;; called "hello+alt.alt".
3525   (if (or (not (inline (gnus-similar-server-opened method)))
3526           (not (cddr method)))
3527       method
3528     `(,(car method) ,(concat (cadr method) "+" group)
3529       (,(intern (format "%s-address" (car method))) ,(cadr method))
3530       ,@(cddr method))))
3531
3532 (defun gnus-server-status (method)
3533   "Return the status of METHOD."
3534   (nth 1 (assoc method gnus-opened-servers)))
3535
3536 (defun gnus-group-name-to-method (group)
3537   "Guess a select method based on GROUP."
3538   (if (string-match ":" group)
3539       (let ((server (substring group 0 (match-beginning 0))))
3540         (if (string-match "\\+" server)
3541             (list (intern (substring server 0 (match-beginning 0)))
3542                   (substring server (match-end 0)))
3543           (list (intern server) "")))
3544     gnus-select-method))
3545
3546 (defun gnus-server-string (server)
3547   "Return a readable string that describes SERVER."
3548   (let* ((server (gnus-server-to-method server))
3549          (address (nth 1 server)))
3550     (if (and address
3551              (not (zerop (length address))))
3552         (format "%s using %s" address (car server))
3553       (format "%s" (car server)))))
3554
3555 (defun gnus-find-method-for-group (group &optional info)
3556   "Find the select method that GROUP uses."
3557   (or gnus-override-method
3558       (and (not group)
3559            gnus-select-method)
3560       (and (not (gnus-group-entry group));; a new group
3561            (gnus-group-name-to-method group))
3562       (let ((info (or info (gnus-get-info group)))
3563             method)
3564         (if (or (not info)
3565                 (not (setq method (gnus-info-method info)))
3566                 (equal method "native"))
3567             gnus-select-method
3568           (setq method
3569                 (cond ((stringp method)
3570                        (inline (gnus-server-to-method method)))
3571                       ((stringp (cadr method))
3572                        (inline (gnus-server-extend-method group method)))
3573                       (t
3574                        method)))
3575           (cond ((equal (cadr method) "")
3576                  method)
3577                 ((null (cadr method))
3578                  (list (car method) ""))
3579                 (t
3580                  (gnus-server-add-address method)))))))
3581
3582 (defun gnus-methods-using (feature)
3583   "Find all methods that have FEATURE."
3584   (let ((valids gnus-valid-select-methods)
3585         outs)
3586     (while valids
3587       (when (memq feature (car valids))
3588         (push (car valids) outs))
3589       (setq valids (cdr valids)))
3590     outs))
3591
3592 (defun gnus-read-group (prompt &optional default)
3593   "Prompt the user for a group name.
3594 Disallow invalid group names."
3595   (let ((prefix "")
3596         group)
3597     (while (not group)
3598       (when (string-match
3599              gnus-invalid-group-regexp
3600              (setq group (read-string (concat prefix prompt)
3601                                       (cons (or default "") 0)
3602                                       'gnus-group-history)))
3603         (setq prefix (format "Invalid group name: \"%s\".  " group)
3604               group nil)))
3605     group))
3606
3607 (defun gnus-read-method (prompt)
3608   "Prompt the user for a method.
3609 Allow completion over sensible values."
3610   (let* ((open-servers
3611           (mapcar (lambda (i) (cons (format "%s:%s" (caar i) (cadar i)) i))
3612                   gnus-opened-servers))
3613          (valid-methods
3614           (let (methods)
3615             (dolist (method gnus-valid-select-methods)
3616               (if (or (memq 'prompt-address method)
3617                       (not (assoc (format "%s:" (car method)) open-servers)))
3618                   (push method methods)))
3619             methods))
3620          (servers
3621           (append valid-methods
3622                   open-servers
3623                   gnus-predefined-server-alist
3624                   gnus-server-alist))
3625          (method
3626           (completing-read
3627            prompt servers
3628            nil t nil 'gnus-method-history)))
3629     (cond
3630      ((equal method "")
3631       (setq method gnus-select-method))
3632      ((assoc method gnus-valid-select-methods)
3633       (let ((address (if (memq 'prompt-address
3634                                (assoc method gnus-valid-select-methods))
3635                          (read-string "Address: ")
3636                        "")))
3637         (or (cadr (assoc (format "%s:%s" method address) open-servers))
3638             (list (intern method) address))))
3639      ((assoc method servers)
3640       method)
3641      (t
3642       (list (intern method) "")))))
3643
3644 ;;; Agent functions
3645
3646 (defun gnus-agent-method-p (method)
3647   "Say whether METHOD is covered by the agent."
3648   (member method gnus-agent-covered-methods))
3649
3650 (defun gnus-online (method)
3651   (not
3652    (if gnus-plugged
3653        (eq (cadr (assoc method gnus-opened-servers)) 'offline)
3654      (gnus-agent-method-p method))))
3655
3656 ;;; User-level commands.
3657
3658 ;;;###autoload
3659 (defun gnus-slave-no-server (&optional arg)
3660   "Read network news as a slave, without connecting to the local server."
3661   (interactive "P")
3662   (gnus-no-server arg t))
3663
3664 ;;;###autoload
3665 (defun gnus-no-server (&optional arg slave)
3666   "Read network news.
3667 If ARG is a positive number, Gnus will use that as the startup
3668 level. If ARG is nil, Gnus will be started at level 2.  If ARG is
3669 non-nil and not a positive number, Gnus will prompt the user for the
3670 name of an NNTP server to use.
3671 As opposed to `gnus', this command will not connect to the local
3672 server."
3673   (interactive "P")
3674   (gnus-no-server-1 arg slave))
3675
3676 ;;;###autoload
3677 (defun gnus-slave (&optional arg)
3678   "Read news as a slave."
3679   (interactive "P")
3680   (gnus arg nil 'slave))
3681
3682 (defcustom gnus-frame-properties nil
3683   "The properties of the frame in which gnus is displayed. Under XEmacs,
3684 the variable `toolbar-news-frame-plist' will be refered instead."
3685   :type '(repeat (cons :format "%v"
3686                        (symbol :tag "Parameter")
3687                        (sexp :tag "Value")))
3688   :group 'gnus)
3689
3690 ;;;###autoload
3691 (defun gnus-other-frame (&optional arg display)
3692   "Pop up a frame to read news.
3693 This will call one of the Gnus commands which is specified by the user
3694 option `gnus-other-frame-function' (default `gnus') with the argument
3695 ARG if Gnus is not running, otherwise just pop up a Gnus frame.  The
3696 optional second argument DISPLAY should be a standard display string
3697 such as \"unix:0\" to specify where to pop up a frame.  If DISPLAY is
3698 omitted or the function `make-frame-on-display' is not available, the
3699 current display is used."
3700   (interactive "P")
3701   (if (fboundp 'make-frame-on-display)
3702       (unless display
3703         (setq display (gnus-frame-or-window-display-name (selected-frame))))
3704     (setq display nil))
3705   (let ((alive (gnus-alive-p)))
3706     (unless (and alive
3707                  (catch 'found
3708                    (walk-windows
3709                     (lambda (window)
3710                       (when (and (or (not display)
3711                                      (equal display
3712                                             (gnus-frame-or-window-display-name
3713                                              window)))
3714                                  (with-current-buffer (window-buffer window)
3715                                    (string-match "\\`gnus-"
3716                                                  (symbol-name major-mode))))
3717                         (gnus-select-frame-set-input-focus
3718                          (setq gnus-other-frame-object (window-frame window)))
3719                         (select-window window)
3720                         (throw 'found t)))
3721                     'ignore t)))
3722       (gnus-select-frame-set-input-focus
3723        (setq gnus-other-frame-object
3724              (if display
3725                  (make-frame-on-display display gnus-other-frame-parameters)
3726                (make-frame gnus-other-frame-parameters))))
3727       (if alive
3728           (switch-to-buffer gnus-group-buffer)
3729         (funcall gnus-other-frame-function arg)
3730         (add-hook 'gnus-exit-gnus-hook
3731                   (lambda nil
3732                     (when (and (frame-live-p gnus-other-frame-object)
3733                                (cdr (frame-list)))
3734                       (delete-frame gnus-other-frame-object))
3735                     (setq gnus-other-frame-object nil)))))))
3736
3737 ;;;###autoload
3738 (defun gnus (&optional arg dont-connect slave)
3739   "Read network news.
3740 If ARG is non-nil and a positive number, Gnus will use that as the
3741 startup level.  If ARG is non-nil and not a positive number, Gnus will
3742 prompt the user for the name of an NNTP server to use."
3743   (interactive "P")
3744   (unless (byte-code-function-p (symbol-function 'gnus))
3745     (message "You should byte-compile Gnus")
3746     (sit-for 2))
3747   (gnus-1 arg dont-connect slave))
3748
3749 ;; Allow redefinition of Gnus functions.
3750
3751 (gnus-ems-redefine)
3752
3753 (product-provide (provide 'gnus) 'gnus-vers)
3754
3755 ;;; gnus.el ends here