1 ;;; gnus.el --- a newsreader for GNU Emacs
3 ;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996, 1997, 1998,
4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
6 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
7 ;; Lars Magne Ingebrigtsen <larsi@gnus.org>
8 ;; Keywords: news, mail
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
31 (eval '(run-hooks 'gnus-load-hook))
33 (eval-when-compile (require 'cl))
38 ;; These are defined afterwards with gnus-define-group-parameter
39 (defvar gnus-ham-process-destinations)
40 (defvar gnus-parameter-ham-marks-alist)
41 (defvar gnus-parameter-spam-marks-alist)
42 (defvar gnus-spam-autodetect)
43 (defvar gnus-spam-autodetect-methods)
44 (defvar gnus-spam-newsgroup-contents)
45 (defvar gnus-spam-process-destinations)
46 (defvar gnus-spam-process-newsgroups)
50 "The coffee-brewing, all singing, all dancing, kitchen sink newsreader."
54 (defgroup gnus-format nil
55 "Dealing with formatting issues."
58 (defgroup gnus-charset nil
59 "Group character set issues."
60 :link '(custom-manual "(gnus)Charsets")
64 (defgroup gnus-cache nil
66 :link '(custom-manual "(gnus)Article Caching")
69 (defgroup gnus-registry nil
73 (defgroup gnus-start nil
74 "Starting your favorite newsreader."
77 (defgroup gnus-start-server nil
78 "Server options at startup."
81 ;; These belong to gnus-group.el.
82 (defgroup gnus-group nil
84 :link '(custom-manual "(gnus)Group Buffer")
87 (defgroup gnus-group-foreign nil
89 :link '(custom-manual "(gnus)Foreign Groups")
92 (defgroup gnus-group-new nil
93 "Automatic subscription of new groups."
96 (defgroup gnus-group-levels nil
98 :link '(custom-manual "(gnus)Group Levels")
101 (defgroup gnus-group-select nil
103 :link '(custom-manual "(gnus)Selecting a Group")
106 (defgroup gnus-group-listing nil
107 "Showing slices of the group list."
108 :link '(custom-manual "(gnus)Listing Groups")
111 (defgroup gnus-group-visual nil
112 "Sorting the group buffer."
113 :link '(custom-manual "(gnus)Group Buffer Format")
117 (defgroup gnus-group-various nil
118 "Various group options."
119 :link '(custom-manual "(gnus)Scanning New Messages")
122 ;; These belong to gnus-sum.el.
123 (defgroup gnus-summary nil
125 :link '(custom-manual "(gnus)Summary Buffer")
128 (defgroup gnus-summary-exit nil
129 "Leaving summary buffers."
130 :link '(custom-manual "(gnus)Exiting the Summary Buffer")
131 :group 'gnus-summary)
133 (defgroup gnus-summary-marks nil
134 "Marks used in summary buffers."
135 :link '(custom-manual "(gnus)Marking Articles")
136 :group 'gnus-summary)
138 (defgroup gnus-thread nil
139 "Ordering articles according to replies."
140 :link '(custom-manual "(gnus)Threading")
141 :group 'gnus-summary)
143 (defgroup gnus-summary-format nil
144 "Formatting of the summary buffer."
145 :link '(custom-manual "(gnus)Summary Buffer Format")
146 :group 'gnus-summary)
148 (defgroup gnus-summary-choose nil
150 :link '(custom-manual "(gnus)Choosing Articles")
151 :group 'gnus-summary)
153 (defgroup gnus-summary-maneuvering nil
154 "Summary movement commands."
155 :link '(custom-manual "(gnus)Summary Maneuvering")
156 :group 'gnus-summary)
158 (defgroup gnus-picon nil
159 "Show pictures of people, domains, and newsgroups."
162 (defgroup gnus-summary-mail nil
163 "Mail group commands."
164 :link '(custom-manual "(gnus)Mail Group Commands")
165 :group 'gnus-summary)
167 (defgroup gnus-summary-sort nil
168 "Sorting the summary buffer."
169 :link '(custom-manual "(gnus)Sorting the Summary Buffer")
170 :group 'gnus-summary)
172 (defgroup gnus-summary-visual nil
173 "Highlighting and menus in the summary buffer."
174 :link '(custom-manual "(gnus)Summary Highlighting")
176 :group 'gnus-summary)
178 (defgroup gnus-summary-various nil
179 "Various summary buffer options."
180 :link '(custom-manual "(gnus)Various Summary Stuff")
181 :group 'gnus-summary)
183 (defgroup gnus-summary-pick nil
184 "Pick mode in the summary buffer."
185 :link '(custom-manual "(gnus)Pick and Read")
187 :group 'gnus-summary)
189 (defgroup gnus-summary-tree nil
190 "Tree display of threads in the summary buffer."
191 :link '(custom-manual "(gnus)Tree Display")
193 :group 'gnus-summary)
195 ;; Belongs to gnus-uu.el
196 (defgroup gnus-extract-view nil
197 "Viewing extracted files."
198 :link '(custom-manual "(gnus)Viewing Files")
199 :group 'gnus-extract)
201 ;; Belongs to gnus-score.el
202 (defgroup gnus-score nil
203 "Score and kill file handling."
206 (defgroup gnus-score-kill nil
210 (defgroup gnus-score-adapt nil
211 "Adaptive score files."
214 (defgroup gnus-score-default nil
215 "Default values for score files."
218 (defgroup gnus-score-expire nil
219 "Expiring score rules."
222 (defgroup gnus-score-decay nil
223 "Decaying score rules."
226 (defgroup gnus-score-files nil
227 "Score and kill file names."
231 (defgroup gnus-score-various nil
232 "Various scoring and killing options."
236 (defgroup gnus-visual nil
237 "Options controlling the visual fluff."
241 (defgroup gnus-agent nil
242 "Offline support for Gnus."
245 (defgroup gnus-files nil
246 "Files used by Gnus."
249 (defgroup gnus-dribble-file nil
251 :link '(custom-manual "(gnus)Auto Save")
254 (defgroup gnus-newsrc nil
255 "Storing Gnus state."
258 (defgroup gnus-server nil
259 "Options related to newsservers and other servers used by Gnus."
262 (defgroup gnus-server-visual nil
263 "Highlighting and menus in the server buffer."
267 (defgroup gnus-message '((message custom-group))
268 "Composing replies and followups in Gnus."
271 (defgroup gnus-meta nil
272 "Meta variables controlling major portions of Gnus.
273 In general, modifying these variables does not take affect until Gnus
274 is restarted, and sometimes reloaded."
277 (defgroup gnus-various nil
278 "Other Gnus options."
279 :link '(custom-manual "(gnus)Various Various")
282 (defgroup gnus-mime nil
283 "Variables for controlling the Gnus MIME interface."
286 (defgroup gnus-exit nil
288 :link '(custom-manual "(gnus)Exiting Gnus")
291 (defgroup gnus-fun nil
292 "Frivolous Gnus extensions."
293 :link '(custom-manual "(gnus)Exiting Gnus")
296 (defconst gnus-version-number "0.4"
297 "Version number for this version of Gnus.")
299 (defconst gnus-version (format "No Gnus v%s" gnus-version-number)
300 "Version string for this version of Gnus.")
302 (defcustom gnus-inhibit-startup-message nil
303 "If non-nil, the startup message will not be displayed.
304 This variable is used before `.gnus.el' is loaded, so it should
305 be set in `.emacs' instead."
309 (defcustom gnus-play-startup-jingle nil
310 "If non-nil, play the Gnus jingle at startup."
314 (unless (fboundp 'gnus-group-remove-excess-properties)
315 (defalias 'gnus-group-remove-excess-properties 'ignore))
317 (unless (featurep 'gnus-xmas)
318 (defalias 'gnus-make-overlay 'make-overlay)
319 (defalias 'gnus-delete-overlay 'delete-overlay)
320 (defalias 'gnus-overlay-put 'overlay-put)
321 (defalias 'gnus-move-overlay 'move-overlay)
322 (defalias 'gnus-overlay-buffer 'overlay-buffer)
323 (defalias 'gnus-overlay-start 'overlay-start)
324 (defalias 'gnus-overlay-end 'overlay-end)
325 (defalias 'gnus-extent-detached-p 'ignore)
326 (defalias 'gnus-extent-start-open 'ignore)
327 (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
328 (defalias 'gnus-character-to-event 'identity)
329 (defalias 'gnus-assq-delete-all 'assq-delete-all)
330 (defalias 'gnus-add-text-properties 'add-text-properties)
331 (defalias 'gnus-put-text-property 'put-text-property)
332 (defvar gnus-mode-line-image-cache t)
333 (if (fboundp 'find-image)
334 (defun gnus-mode-line-buffer-identification (line)
335 (let ((str (car-safe line))
336 (load-path (mm-image-load-path)))
337 (if (and (stringp str)
338 (string-match "^Gnus:" str))
339 (progn (add-text-properties
342 (if (eq t gnus-mode-line-image-cache)
343 (setq gnus-mode-line-image-cache
345 '((:type xpm :file "gnus-pointer.xpm"
347 (:type xbm :file "gnus-pointer.xbm"
349 gnus-mode-line-image-cache)
352 gnus-version (gnus-emacs-version)))
356 (defalias 'gnus-mode-line-buffer-identification 'identity))
357 (defalias 'gnus-characterp 'numberp)
358 (defalias 'gnus-deactivate-mark 'deactivate-mark)
359 (defalias 'gnus-window-edges 'window-edges)
360 (defalias 'gnus-key-press-event-p 'numberp)
361 ;;(defalias 'gnus-decode-rfc1522 'ignore)
364 ;; We define these group faces here to avoid the display
365 ;; update forced when creating new faces.
367 (defface gnus-group-news-1
370 (:foreground "PaleTurquoise" :bold t))
373 (:foreground "ForestGreen" :bold t))
376 "Level 1 newsgroup face."
378 ;; backward-compatibility alias
379 (put 'gnus-group-news-1-face 'face-alias 'gnus-group-news-1)
381 (defface gnus-group-news-1-empty
384 (:foreground "PaleTurquoise"))
387 (:foreground "ForestGreen"))
390 "Level 1 empty newsgroup face."
392 ;; backward-compatibility alias
393 (put 'gnus-group-news-1-empty-face 'face-alias 'gnus-group-news-1-empty)
395 (defface gnus-group-news-2
398 (:foreground "turquoise" :bold t))
401 (:foreground "CadetBlue4" :bold t))
404 "Level 2 newsgroup face."
406 ;; backward-compatibility alias
407 (put 'gnus-group-news-2-face 'face-alias 'gnus-group-news-2)
409 (defface gnus-group-news-2-empty
412 (:foreground "turquoise"))
415 (:foreground "CadetBlue4"))
418 "Level 2 empty newsgroup face."
420 ;; backward-compatibility alias
421 (put 'gnus-group-news-2-empty-face 'face-alias 'gnus-group-news-2-empty)
423 (defface gnus-group-news-3
432 "Level 3 newsgroup face."
434 ;; backward-compatibility alias
435 (put 'gnus-group-news-3-face 'face-alias 'gnus-group-news-3)
437 (defface gnus-group-news-3-empty
446 "Level 3 empty newsgroup face."
448 ;; backward-compatibility alias
449 (put 'gnus-group-news-3-empty-face 'face-alias 'gnus-group-news-3-empty)
451 (defface gnus-group-news-4
460 "Level 4 newsgroup face."
462 ;; backward-compatibility alias
463 (put 'gnus-group-news-4-face 'face-alias 'gnus-group-news-4)
465 (defface gnus-group-news-4-empty
474 "Level 4 empty newsgroup face."
476 ;; backward-compatibility alias
477 (put 'gnus-group-news-4-empty-face 'face-alias 'gnus-group-news-4-empty)
479 (defface gnus-group-news-5
488 "Level 5 newsgroup face."
490 ;; backward-compatibility alias
491 (put 'gnus-group-news-5-face 'face-alias 'gnus-group-news-5)
493 (defface gnus-group-news-5-empty
502 "Level 5 empty newsgroup face."
504 ;; backward-compatibility alias
505 (put 'gnus-group-news-5-empty-face 'face-alias 'gnus-group-news-5-empty)
507 (defface gnus-group-news-6
516 "Level 6 newsgroup face."
518 ;; backward-compatibility alias
519 (put 'gnus-group-news-6-face 'face-alias 'gnus-group-news-6)
521 (defface gnus-group-news-6-empty
530 "Level 6 empty newsgroup face."
532 ;; backward-compatibility alias
533 (put 'gnus-group-news-6-empty-face 'face-alias 'gnus-group-news-6-empty)
535 (defface gnus-group-news-low
538 (:foreground "DarkTurquoise" :bold t))
541 (:foreground "DarkGreen" :bold t))
544 "Low level newsgroup face."
546 ;; backward-compatibility alias
547 (put 'gnus-group-news-low-face 'face-alias 'gnus-group-news-low)
549 (defface gnus-group-news-low-empty
552 (:foreground "DarkTurquoise"))
555 (:foreground "DarkGreen"))
558 "Low level empty newsgroup face."
560 ;; backward-compatibility alias
561 (put 'gnus-group-news-low-empty-face 'face-alias 'gnus-group-news-low-empty)
563 (defface gnus-group-mail-1
566 (:foreground "aquamarine1" :bold t))
569 (:foreground "DeepPink3" :bold t))
572 "Level 1 mailgroup face."
574 ;; backward-compatibility alias
575 (put 'gnus-group-mail-1-face 'face-alias 'gnus-group-mail-1)
577 (defface gnus-group-mail-1-empty
580 (:foreground "aquamarine1"))
583 (:foreground "DeepPink3"))
585 (:italic t :bold t)))
586 "Level 1 empty mailgroup face."
588 ;; backward-compatibility alias
589 (put 'gnus-group-mail-1-empty-face 'face-alias 'gnus-group-mail-1-empty)
591 (defface gnus-group-mail-2
594 (:foreground "aquamarine2" :bold t))
597 (:foreground "HotPink3" :bold t))
600 "Level 2 mailgroup face."
602 ;; backward-compatibility alias
603 (put 'gnus-group-mail-2-face 'face-alias 'gnus-group-mail-2)
605 (defface gnus-group-mail-2-empty
608 (:foreground "aquamarine2"))
611 (:foreground "HotPink3"))
614 "Level 2 empty mailgroup face."
616 ;; backward-compatibility alias
617 (put 'gnus-group-mail-2-empty-face 'face-alias 'gnus-group-mail-2-empty)
619 (defface gnus-group-mail-3
622 (:foreground "aquamarine3" :bold t))
625 (:foreground "magenta4" :bold t))
628 "Level 3 mailgroup face."
630 ;; backward-compatibility alias
631 (put 'gnus-group-mail-3-face 'face-alias 'gnus-group-mail-3)
633 (defface gnus-group-mail-3-empty
636 (:foreground "aquamarine3"))
639 (:foreground "magenta4"))
642 "Level 3 empty mailgroup face."
644 ;; backward-compatibility alias
645 (put 'gnus-group-mail-3-empty-face 'face-alias 'gnus-group-mail-3-empty)
647 (defface gnus-group-mail-low
650 (:foreground "aquamarine4" :bold t))
653 (:foreground "DeepPink4" :bold t))
656 "Low level mailgroup face."
658 ;; backward-compatibility alias
659 (put 'gnus-group-mail-low-face 'face-alias 'gnus-group-mail-low)
661 (defface gnus-group-mail-low-empty
664 (:foreground "aquamarine4"))
667 (:foreground "DeepPink4"))
670 "Low level empty mailgroup face."
672 ;; backward-compatibility alias
673 (put 'gnus-group-mail-low-empty-face 'face-alias 'gnus-group-mail-low-empty)
675 ;; Summary mode faces.
677 (defface gnus-summary-selected '((t (:underline t)))
678 "Face used for selected articles."
679 :group 'gnus-summary)
680 ;; backward-compatibility alias
681 (put 'gnus-summary-selected-face 'face-alias 'gnus-summary-selected)
683 (defface gnus-summary-cancelled
685 (:foreground "yellow" :background "black")))
686 "Face used for cancelled articles."
687 :group 'gnus-summary)
688 ;; backward-compatibility alias
689 (put 'gnus-summary-cancelled-face 'face-alias 'gnus-summary-cancelled)
691 (defface gnus-summary-high-ticked
694 (:foreground "pink" :bold t))
697 (:foreground "firebrick" :bold t))
700 "Face used for high interest ticked articles."
701 :group 'gnus-summary)
702 ;; backward-compatibility alias
703 (put 'gnus-summary-high-ticked-face 'face-alias 'gnus-summary-high-ticked)
705 (defface gnus-summary-low-ticked
708 (:foreground "pink" :italic t))
711 (:foreground "firebrick" :italic t))
714 "Face used for low interest ticked articles."
715 :group 'gnus-summary)
716 ;; backward-compatibility alias
717 (put 'gnus-summary-low-ticked-face 'face-alias 'gnus-summary-low-ticked)
719 (defface gnus-summary-normal-ticked
722 (:foreground "pink"))
725 (:foreground "firebrick"))
728 "Face used for normal interest ticked articles."
729 :group 'gnus-summary)
730 ;; backward-compatibility alias
731 (put 'gnus-summary-normal-ticked-face 'face-alias 'gnus-summary-normal-ticked)
733 (defface gnus-summary-high-ancient
736 (:foreground "SkyBlue" :bold t))
739 (:foreground "RoyalBlue" :bold t))
742 "Face used for high interest ancient articles."
743 :group 'gnus-summary)
744 ;; backward-compatibility alias
745 (put 'gnus-summary-high-ancient-face 'face-alias 'gnus-summary-high-ancient)
747 (defface gnus-summary-low-ancient
750 (:foreground "SkyBlue" :italic t))
753 (:foreground "RoyalBlue" :italic t))
756 "Face used for low interest ancient articles."
757 :group 'gnus-summary)
758 ;; backward-compatibility alias
759 (put 'gnus-summary-low-ancient-face 'face-alias 'gnus-summary-low-ancient)
761 (defface gnus-summary-normal-ancient
764 (:foreground "SkyBlue"))
767 (:foreground "RoyalBlue"))
770 "Face used for normal interest ancient articles."
771 :group 'gnus-summary)
772 ;; backward-compatibility alias
773 (put 'gnus-summary-normal-ancient-face 'face-alias 'gnus-summary-normal-ancient)
775 (defface gnus-summary-high-undownloaded
778 (:bold t :foreground "cyan4"))
779 (((class color) (background dark))
780 (:bold t :foreground "LightGray"))
781 (t (:inverse-video t :bold t)))
782 "Face used for high interest uncached articles."
783 :group 'gnus-summary)
784 ;; backward-compatibility alias
785 (put 'gnus-summary-high-undownloaded-face 'face-alias 'gnus-summary-high-undownloaded)
787 (defface gnus-summary-low-undownloaded
790 (:italic t :foreground "cyan4" :bold nil))
791 (((class color) (background dark))
792 (:italic t :foreground "LightGray" :bold nil))
793 (t (:inverse-video t :italic t)))
794 "Face used for low interest uncached articles."
795 :group 'gnus-summary)
796 ;; backward-compatibility alias
797 (put 'gnus-summary-low-undownloaded-face 'face-alias 'gnus-summary-low-undownloaded)
799 (defface gnus-summary-normal-undownloaded
802 (:foreground "cyan4" :bold nil))
803 (((class color) (background dark))
804 (:foreground "LightGray" :bold nil))
805 (t (:inverse-video t)))
806 "Face used for normal interest uncached articles."
807 :group 'gnus-summary)
808 ;; backward-compatibility alias
809 (put 'gnus-summary-normal-undownloaded-face 'face-alias 'gnus-summary-normal-undownloaded)
811 (defface gnus-summary-high-unread
814 "Face used for high interest unread articles."
815 :group 'gnus-summary)
816 ;; backward-compatibility alias
817 (put 'gnus-summary-high-unread-face 'face-alias 'gnus-summary-high-unread)
819 (defface gnus-summary-low-unread
822 "Face used for low interest unread articles."
823 :group 'gnus-summary)
824 ;; backward-compatibility alias
825 (put 'gnus-summary-low-unread-face 'face-alias 'gnus-summary-low-unread)
827 (defface gnus-summary-normal-unread
830 "Face used for normal interest unread articles."
831 :group 'gnus-summary)
832 ;; backward-compatibility alias
833 (put 'gnus-summary-normal-unread-face 'face-alias 'gnus-summary-normal-unread)
835 (defface gnus-summary-high-read
838 (:foreground "PaleGreen"
842 (:foreground "DarkGreen"
846 "Face used for high interest read articles."
847 :group 'gnus-summary)
848 ;; backward-compatibility alias
849 (put 'gnus-summary-high-read-face 'face-alias 'gnus-summary-high-read)
851 (defface gnus-summary-low-read
854 (:foreground "PaleGreen"
858 (:foreground "DarkGreen"
862 "Face used for low interest read articles."
863 :group 'gnus-summary)
864 ;; backward-compatibility alias
865 (put 'gnus-summary-low-read-face 'face-alias 'gnus-summary-low-read)
867 (defface gnus-summary-normal-read
870 (:foreground "PaleGreen"))
873 (:foreground "DarkGreen"))
876 "Face used for normal interest read articles."
877 :group 'gnus-summary)
878 ;; backward-compatibility alias
879 (put 'gnus-summary-normal-read-face 'face-alias 'gnus-summary-normal-read)
886 (defvar gnus-buffers nil)
888 (defun gnus-get-buffer-create (name)
889 "Do the same as `get-buffer-create', but store the created buffer."
890 (or (get-buffer name)
891 (car (push (get-buffer-create name) gnus-buffers))))
893 (defun gnus-add-buffer ()
894 "Add the current buffer to the list of Gnus buffers."
895 (push (current-buffer) gnus-buffers))
897 (defmacro gnus-kill-buffer (buffer)
898 "Kill BUFFER and remove from the list of Gnus buffers."
899 `(let ((buf ,buffer))
900 (when (gnus-buffer-exists-p buf)
901 (setq gnus-buffers (delete (get-buffer buf) gnus-buffers))
904 (defun gnus-buffers ()
905 "Return a list of live Gnus buffers."
906 (while (and gnus-buffers
907 (not (buffer-name (car gnus-buffers))))
909 (let ((buffers gnus-buffers))
911 (if (buffer-name (cadr buffers))
913 (setcdr buffers (cddr buffers)))))
918 (defvar gnus-group-buffer "*Group*")
921 (autoload 'gnus-play-jingle "gnus-audio"))
926 (:foreground "#888888"))
929 (:foreground "#888888"))
932 "Face for the splash screen."
934 ;; backward-compatibility alias
935 (put 'gnus-splash-face 'face-alias 'gnus-splash)
937 (defun gnus-splash ()
939 (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer))
940 (let ((buffer-read-only nil))
942 (unless gnus-inhibit-startup-message
943 (gnus-group-startup-message)
945 (when gnus-play-startup-jingle
946 (gnus-play-jingle))))))
948 (defun gnus-indent-rigidly (start end arg)
949 "Indent rigidly using only spaces and no tabs."
952 (narrow-to-region start end)
954 (indent-rigidly start end arg)
955 ;; We translate tabs into spaces -- not everybody uses
956 ;; an 8-character tab.
957 (goto-char (point-min))
958 (while (search-forward "\t" nil t)
959 (replace-match " " t t))))))
961 (defvar gnus-simple-splash nil)
963 ;;(format "%02x%02x%02x" 114 66 20) "724214"
965 (defvar gnus-logo-color-alist
966 '((flame "#cc3300" "#ff2200")
967 (pine "#c0cc93" "#f8ffb8")
968 (moss "#a1cc93" "#d2ffb8")
969 (irish "#04cc90" "#05ff97")
970 (sky "#049acc" "#05deff")
971 (tin "#6886cc" "#82b6ff")
972 (velvet "#7c68cc" "#8c82ff")
973 (grape "#b264cc" "#cf7df")
974 (labia "#cc64c2" "#fd7dff")
975 (berry "#cc6485" "#ff7db5")
976 (dino "#724214" "#1e3f03")
977 (oort "#cccccc" "#888888")
978 (storm "#666699" "#99ccff")
979 (pdino "#9999cc" "#99ccff")
980 (purp "#9999cc" "#666699")
981 (no "#ff0000" "#ffff00")
982 (neutral "#b4b4b4" "#878787")
983 (september "#bf9900" "#ffcc00"))
984 "Color alist used for the Gnus logo.")
986 (defcustom gnus-logo-color-style 'no
987 "*Color styles used for the Gnus logo."
988 :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem)))
989 gnus-logo-color-alist))
992 (defvar gnus-logo-colors
993 (cdr (assq gnus-logo-color-style gnus-logo-color-alist))
994 "Colors used for the Gnus logo.")
996 (defun gnus-group-startup-message (&optional x y)
997 "Insert startup message in current buffer."
998 ;; Insert the message.
1002 (fboundp 'find-image)
1004 (let* ((data-directory (nnheader-find-etc-directory "images/gnus"))
1005 (image-load-path (cond (data-directory
1006 (list data-directory))
1007 ((boundp 'image-load-path)
1008 (symbol-value 'image-load-path))
1011 `((:type xpm :file "gnus.xpm"
1013 (("thing" . ,(car gnus-logo-colors))
1014 ("shadow" . ,(cadr gnus-logo-colors))
1015 ("oort" . "#eeeeee")
1016 ("background" . ,(face-background 'default))))
1017 (:type pbm :file "gnus.pbm"
1018 ;; Account for the pbm's blackground.
1019 :background ,(face-foreground 'gnus-splash)
1020 :foreground ,(face-background 'default))
1021 (:type xbm :file "gnus.xbm"
1022 ;; Account for the xbm's blackground.
1023 :background ,(face-foreground 'gnus-splash)
1024 :foreground ,(face-background 'default))))))
1026 (let ((size (image-size image)))
1027 (insert-char ?\n (max 0 (round (- (window-height)
1028 (or y (cdr size)) 1) 2)))
1029 (insert-char ?\ (max 0 (round (- (window-width)
1030 (or x (car size))) 2)))
1031 (insert-image image))
1032 (setq gnus-simple-splash nil)
1038 _ ___ __ ___ __ _ ___
1057 ;; And then hack it.
1058 (gnus-indent-rigidly (point-min) (point-max)
1059 (/ (max (- (window-width) (or x 46)) 0) 2))
1060 (goto-char (point-min))
1062 (let* ((pheight (count-lines (point-min) (point-max)))
1063 (wheight (window-height))
1064 (rest (- wheight pheight)))
1065 (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n)))
1067 (put-text-property (point-min) (point-max) 'face 'gnus-splash)
1068 (setq gnus-simple-splash t)))
1069 (goto-char (point-min))
1070 (setq mode-line-buffer-identification (concat " " gnus-version))
1071 (set-buffer-modified-p t))
1074 (let ((command (format "%s" this-command)))
1075 (when (string-match "gnus" command)
1076 (if (string-match "gnus-other-frame" command)
1077 (gnus-get-buffer-create gnus-group-buffer)
1082 (require 'gnus-util)
1085 (defcustom gnus-parameters nil
1086 "Alist of group parameters.
1089 ((\"mail\\\\..*\" (gnus-show-threads nil)
1090 (gnus-use-scoring nil)
1091 (gnus-summary-line-format
1092 \"%U%R%z%I%(%[%d:%ub%-23,23f%]%) %s\\n\")
1095 (\"mail\\\\.me\" (gnus-use-scoring t))
1096 (\"list\\\\..*\" (total-expire . t)
1097 (broken-reply-to . t)))"
1099 :group 'gnus-group-various
1100 :type '(repeat (cons regexp
1103 (defcustom gnus-parameters-case-fold-search 'default
1104 "If it is t, ignore case of group names specified in `gnus-parameters'.
1105 If it is nil, don't ignore case. If it is `default', which is for the
1106 backward compatibility, use the value of `case-fold-search'."
1108 :group 'gnus-group-various
1109 :type '(choice :format "%{%t%}:\n %[Value Menu%] %v"
1110 (const :tag "Use `case-fold-search'" default)
1114 (defvar gnus-group-parameters-more nil)
1116 (defmacro gnus-define-group-parameter (param &rest rest)
1117 "Define a group parameter PARAM.
1118 REST is a plist of following:
1119 :type One of `bool', `list' or nil.
1120 :function The name of the function.
1121 :function-document The documentation of the function.
1122 :parameter-type The type for customizing the parameter.
1123 :parameter-document The documentation for the parameter.
1124 :variable The name of the variable.
1125 :variable-document The documentation for the variable.
1126 :variable-group The group for customizing the variable.
1127 :variable-type The type for customizing the variable.
1128 :variable-default The default value of the variable."
1129 (let* ((type (plist-get rest :type))
1130 (parameter-type (plist-get rest :parameter-type))
1131 (parameter-document (plist-get rest :parameter-document))
1132 (function (or (plist-get rest :function)
1133 (intern (format "gnus-parameter-%s" param))))
1134 (function-document (or (plist-get rest :function-document) ""))
1135 (variable (or (plist-get rest :variable)
1136 (intern (format "gnus-parameter-%s-alist" param))))
1137 (variable-document (or (plist-get rest :variable-document) ""))
1138 (variable-group (plist-get rest :variable-group))
1139 (variable-type (or (plist-get rest :variable-type)
1141 (list (regexp :tag "Group")
1142 ,(car (cdr parameter-type)))))))
1143 (variable-default (plist-get rest :variable-default)))
1146 `(defcustom ,variable ,variable-default
1148 :group 'gnus-group-parameter
1149 :group ',variable-group
1150 :type ,variable-type)
1151 `(setq gnus-group-parameters-more
1152 (delq (assq ',param gnus-group-parameters-more)
1153 gnus-group-parameters-more))
1154 `(add-to-list 'gnus-group-parameters-more
1157 ,parameter-document))
1159 `(defun ,function (name)
1161 (let ((params (gnus-group-find-parameter name))
1164 ((memq ',param params)
1166 ((setq val (assq ',param params))
1168 ((stringp ,variable)
1169 (string-match ,variable name))
1171 (let ((alist ,variable)
1173 (while (setq elem (pop alist))
1175 (string-match (car elem) name))
1178 (if (consp value) (car value) value))))))
1179 `(defun ,function (name)
1182 (or (gnus-group-find-parameter name ',param ,(and type t))
1183 (let ((alist ,variable)
1185 (while (setq elem (pop alist))
1187 (string-match (car elem) name))
1192 '(if (consp value) (car value) value))))))))))
1194 (defcustom gnus-home-directory "~/"
1195 "Directory variable that specifies the \"home\" directory.
1196 All other Gnus file and directory variables are initialized from this variable."
1200 (defcustom gnus-directory (or (getenv "SAVEDIR")
1201 (nnheader-concat gnus-home-directory "News/"))
1202 "*Directory variable from which all other Gnus file variables are derived.
1204 Note that Gnus is mostly loaded when the `.gnus.el' file is read.
1205 This means that other directory variables that are initialized from
1206 this variable won't be set properly if you set this variable in `.gnus.el'.
1207 Set this variable in `.emacs' instead."
1211 (defcustom gnus-default-directory nil
1212 "*Default directory for all Gnus buffers."
1214 :type '(choice (const :tag "current" nil)
1217 ;; Site dependent variables. These variables should be defined in
1220 (defvar gnus-default-nntp-server nil
1221 "Specify a default NNTP server.
1222 This variable should be defined in paths.el, and should never be set
1224 If you want to change servers, you should use `gnus-select-method'.
1225 See the documentation to that variable.")
1227 ;; Don't touch this variable.
1228 (defvar gnus-nntp-service "nntp"
1229 "NNTP service name (\"nntp\" or 119).
1230 This is an obsolete variable, which is scarcely used. If you use an
1231 nntp server for your newsgroup and want to change the port number
1232 used to 899, you would say something along these lines:
1234 (setq gnus-select-method '(nntp \"my.nntp.server\" (nntp-port-number 899)))")
1236 (defcustom gnus-nntpserver-file "/etc/nntpserver"
1237 "A file with only the name of the nntp server in it."
1242 (defun gnus-getenv-nntpserver ()
1243 "Find default nntp server.
1244 Check the NNTPSERVER environment variable and the
1245 `gnus-nntpserver-file' file."
1246 (or (getenv "NNTPSERVER")
1247 (and (file-readable-p gnus-nntpserver-file)
1249 (insert-file-contents gnus-nntpserver-file)
1250 (when (re-search-forward "[^ \t\n\r]+" nil t)
1251 (match-string 0))))))
1253 (defcustom gnus-select-method
1256 (list 'nntp (or (condition-case nil
1257 (gnus-getenv-nntpserver)
1259 (when (and gnus-default-nntp-server
1260 (not (string= gnus-default-nntp-server "")))
1261 gnus-default-nntp-server)
1263 (if (or (null gnus-nntp-service)
1264 (equal gnus-nntp-service "nntp"))
1266 (list gnus-nntp-service)))
1268 "Default method for selecting a newsgroup.
1269 This variable should be a list, where the first element is how the
1270 news is to be fetched, the second is the address.
1272 For instance, if you want to get your news via \"flab.flab.edu\" using
1273 NNTP, you could say:
1275 \(setq gnus-select-method '(nntp \"flab.flab.edu\"))
1277 If you want to use your local spool, say:
1279 \(setq gnus-select-method (list 'nnspool (system-name)))
1281 If you use this variable, you must set `gnus-nntp-server' to nil.
1283 There is a lot more to know about select methods and virtual servers -
1284 see the manual for details."
1286 :type 'gnus-select-method)
1288 (defcustom gnus-message-archive-method "archive"
1289 "*Method used for archiving messages you've sent.
1290 This should be a mail method."
1292 :group 'gnus-message
1293 :type '(choice (const :tag "Default archive method" "archive")
1294 gnus-select-method))
1296 (defcustom gnus-message-archive-group nil
1297 "*Name of the group in which to save the messages you've written.
1298 This can either be a string; a list of strings; or an alist
1299 of regexps/functions/forms to be evaluated to return a string (or a list
1300 of strings). The functions are called with the name of the current
1301 group (or nil) as a parameter.
1303 If you want to save your mail in one group and the news articles you
1304 write in another group, you could say something like:
1306 \(setq gnus-message-archive-group
1307 '((if (message-news-p)
1311 Normally the group names returned by this variable should be
1312 unprefixed -- which implicitly means \"store on the archive server\".
1313 However, you may wish to store the message on some other server. In
1314 that case, just return a fully prefixed name of the group --
1315 \"nnml+private:mail.misc\", for instance."
1316 :group 'gnus-message
1317 :type '(choice (const :tag "none" nil)
1322 (defcustom gnus-secondary-servers nil
1323 "List of NNTP servers that the user can choose between interactively.
1324 To make Gnus query you for a server, you have to give `gnus' a
1325 non-numeric prefix - `C-u M-x gnus', in short."
1327 :type '(repeat string))
1329 (defcustom gnus-nntp-server nil
1330 "*The name of the host running the NNTP server.
1331 This variable is semi-obsolete. Use the `gnus-select-method'
1334 :type '(choice (const :tag "disable" nil)
1337 (defcustom gnus-secondary-select-methods nil
1338 "A list of secondary methods that will be used for reading news.
1339 This is a list where each element is a complete select method (see
1340 `gnus-select-method').
1342 If, for instance, you want to read your mail with the nnml back end,
1343 you could set this variable:
1345 \(setq gnus-secondary-select-methods '((nnml \"\")))"
1347 :type '(repeat gnus-select-method))
1349 (defvar gnus-backup-default-subscribed-newsgroups
1350 '("news.announce.newusers" "news.groups.questions" "gnu.emacs.gnus")
1351 "Default default new newsgroups the first time Gnus is run.
1352 Should be set in paths.el, and shouldn't be touched by the user.")
1354 (defcustom gnus-local-domain nil
1355 "Local domain name without a host name.
1356 The DOMAINNAME environment variable is used instead if it is defined.
1357 If the function `system-name' returns the full Internet name, there is
1358 no need to set this variable."
1359 :group 'gnus-message
1360 :type '(choice (const :tag "default" nil)
1363 (defvar gnus-local-organization nil
1364 "String with a description of what organization (if any) the user belongs to.
1365 Obsolete variable; use `message-user-organization' instead.")
1367 ;; Customization variables
1369 (defcustom gnus-refer-article-method nil
1370 "Preferred method for fetching an article by Message-ID.
1371 If you are reading news from the local spool (with nnspool), fetching
1372 articles by Message-ID is painfully slow. By setting this method to an
1373 nntp method, you might get acceptable results.
1375 The value of this variable must be a valid select method as discussed
1376 in the documentation of `gnus-select-method'.
1378 It can also be a list of select methods, as well as the special symbol
1379 `current', which means to use the current select method. If it is a
1380 list, Gnus will try all the methods in the list until it finds a match."
1382 :type '(choice (const :tag "default" nil)
1384 (const :tag "Google" (nnweb "refer" (nnweb-type google)))
1386 (repeat :menu-tag "Try multiple"
1388 :value (current (nnweb "refer" (nnweb-type google)))
1389 (choice :tag "Method"
1391 (const :tag "Google"
1392 (nnweb "refer" (nnweb-type google)))
1393 gnus-select-method))))
1395 (defcustom gnus-group-faq-directory
1396 '("/ftp@mirrors.aol.com:/pub/rtfm/usenet/"
1397 "/ftp@sunsite.doc.ic.ac.uk:/pub/usenet/news-faqs/"
1398 "/ftp@src.doc.ic.ac.uk:/usenet/news-FAQS/"
1399 "/ftp@ftp.seas.gwu.edu:/pub/rtfm/"
1400 "/ftp@ftp.pasteur.fr:/pub/FAQ/"
1401 "/ftp@rtfm.mit.edu:/pub/usenet/"
1402 "/ftp@ftp.uni-paderborn.de:/pub/FAQ/"
1403 "/ftp@ftp.sunet.se:/pub/usenet/"
1404 "/ftp@nctuccca.nctu.edu.tw:/pub/Documents/rtfm/usenet-by-group/"
1405 "/ftp@hwarang.postech.ac.kr:/pub/usenet/"
1406 "/ftp@ftp.hk.super.net:/mirror/faqs/")
1407 "*Directory where the group FAQs are stored.
1408 This will most commonly be on a remote machine, and the file will be
1409 fetched by ange-ftp.
1411 This variable can also be a list of directories. In that case, the
1412 first element in the list will be used by default. The others can
1413 be used when being prompted for a site.
1415 Note that Gnus uses an aol machine as the default directory. If this
1416 feels fundamentally unclean, just think of it as a way to finally get
1417 something of value back from them.
1419 If the default site is too slow, try one of these:
1421 North America: mirrors.aol.com /pub/rtfm/usenet
1422 ftp.seas.gwu.edu /pub/rtfm
1423 rtfm.mit.edu /pub/usenet
1424 Europe: ftp.uni-paderborn.de /pub/FAQ
1425 src.doc.ic.ac.uk /usenet/news-FAQS
1426 ftp.sunet.se /pub/usenet
1427 ftp.pasteur.fr /pub/FAQ
1428 Asia: nctuccca.nctu.edu.tw /pub/Documents/rtfm/usenet-by-group/
1429 hwarang.postech.ac.kr /pub/usenet
1430 ftp.hk.super.net /mirror/faqs"
1431 :group 'gnus-group-various
1432 :type '(choice directory
1433 (repeat directory)))
1435 (defcustom gnus-group-charter-alist
1436 '(("no" . (concat "http://no.news-admin.org/charter/" name ".txt"))
1437 ("de" . (concat "http://purl.net/charta/" name ".html"))
1438 ("dk" . (concat "http://www.usenet.dk/grupper.pl?get=" name))
1439 ("england" . (concat "http://england.news-admin.org/charters/" name))
1440 ("fr" . (concat "http://www.usenet-fr.net/fur/chartes/" name ".html"))
1441 ("europa" . (concat "http://www.europa.usenet.eu.org/chartas/charta-en-"
1442 (gnus-replace-in-string name "europa\\." "") ".html"))
1443 ("nl" . (concat "http://www.xs4all.nl/~sister/usenet/charters/" name))
1444 ("aus" . (concat "http://aus.news-admin.org/groupinfo.cgi/" name))
1445 ("pl" . (concat "http://www.usenet.pl/opisy/" name))
1446 ("ch" . (concat "http://www.use-net.ch/Usenet/charter.html#" name))
1447 ("at" . (concat "http://www.usenet.at/chartas/" name "/charta"))
1448 ("uk" . (concat "http://www.usenet.org.uk/" name ".html"))
1449 ("dfw" . (concat "http://www.cirr.com/dfw/charters/" name ".html"))
1450 ("se" . (concat "http://www.usenet-se.net/Reglementen/"
1451 (gnus-replace-in-string name "\\." "_") ".html"))
1452 ("milw" . (concat "http://usenet.mil.wi.us/"
1453 (gnus-replace-in-string name "milw\\." "") "-charter"))
1454 ("ca" . (concat "http://www.sbay.org/ca/charter-" name ".html"))
1455 ("netins" . (concat "http://www.netins.net/usenet/charter/"
1456 (gnus-replace-in-string name "\\." "-") "-charter.html")))
1457 "*An alist of (HIERARCHY . FORM) pairs used to construct the URL of a charter.
1458 When FORM is evaluated `name' is bound to the name of the group."
1460 :group 'gnus-group-various
1461 :type '(repeat (cons (string :tag "Hierarchy") (sexp :tag "Form"))))
1463 (defcustom gnus-group-fetch-control-use-browse-url nil
1464 "*Non-nil means that control messages are displayed using `browse-url'.
1465 Otherwise they are fetched with ange-ftp and displayed in an ephemeral
1468 :group 'gnus-group-various
1471 (defcustom gnus-use-cross-reference t