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, 2007, 2008, 2009, 2010
5 ;; Free Software Foundation, Inc.
7 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
8 ;; Lars Magne Ingebrigtsen <larsi@gnus.org>
9 ;; Keywords: news, mail
11 ;; This file is part of GNU Emacs.
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation, either version 3 of the License, or
16 ;; (at your option) any later version.
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
30 (eval '(run-hooks 'gnus-load-hook))
32 ;; For Emacs <22.2 and XEmacs.
34 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
36 (eval-when-compile (require 'cl))
41 ;; These are defined afterwards with gnus-define-group-parameter
42 (defvar gnus-ham-process-destinations)
43 (defvar gnus-parameter-ham-marks-alist)
44 (defvar gnus-parameter-spam-marks-alist)
45 (defvar gnus-spam-autodetect)
46 (defvar gnus-spam-autodetect-methods)
47 (defvar gnus-spam-newsgroup-contents)
48 (defvar gnus-spam-process-destinations)
49 (defvar gnus-spam-resend-to)
50 (defvar gnus-ham-resend-to)
51 (defvar gnus-spam-process-newsgroups)
55 "The coffee-brewing, all singing, all dancing, kitchen sink newsreader."
59 (defgroup gnus-start nil
60 "Starting your favorite newsreader."
63 (defgroup gnus-format nil
64 "Dealing with formatting issues."
67 (defgroup gnus-charset nil
68 "Group character set issues."
69 :link '(custom-manual "(gnus)Charsets")
73 (defgroup gnus-cache nil
75 :link '(custom-manual "(gnus)Article Caching")
78 (defgroup gnus-registry nil
82 (defgroup gnus-start-server nil
83 "Server options at startup."
86 ;; These belong to gnus-group.el.
87 (defgroup gnus-group nil
89 :link '(custom-manual "(gnus)Group Buffer")
92 (defgroup gnus-group-foreign nil
94 :link '(custom-manual "(gnus)Foreign Groups")
97 (defgroup gnus-group-new nil
98 "Automatic subscription of new groups."
101 (defgroup gnus-group-levels nil
103 :link '(custom-manual "(gnus)Group Levels")
106 (defgroup gnus-group-select nil
108 :link '(custom-manual "(gnus)Selecting a Group")
111 (defgroup gnus-group-listing nil
112 "Showing slices of the group list."
113 :link '(custom-manual "(gnus)Listing Groups")
116 (defgroup gnus-group-visual nil
117 "Sorting the group buffer."
118 :link '(custom-manual "(gnus)Group Buffer Format")
122 (defgroup gnus-group-various nil
123 "Various group options."
124 :link '(custom-manual "(gnus)Scanning New Messages")
127 ;; These belong to gnus-sum.el.
128 (defgroup gnus-summary nil
130 :link '(custom-manual "(gnus)Summary Buffer")
133 (defgroup gnus-summary-exit nil
134 "Leaving summary buffers."
135 :link '(custom-manual "(gnus)Exiting the Summary Buffer")
136 :group 'gnus-summary)
138 (defgroup gnus-summary-marks nil
139 "Marks used in summary buffers."
140 :link '(custom-manual "(gnus)Marking Articles")
141 :group 'gnus-summary)
143 (defgroup gnus-thread nil
144 "Ordering articles according to replies."
145 :link '(custom-manual "(gnus)Threading")
146 :group 'gnus-summary)
148 (defgroup gnus-summary-format nil
149 "Formatting of the summary buffer."
150 :link '(custom-manual "(gnus)Summary Buffer Format")
151 :group 'gnus-summary)
153 (defgroup gnus-summary-choose nil
155 :link '(custom-manual "(gnus)Choosing Articles")
156 :group 'gnus-summary)
158 (defgroup gnus-summary-maneuvering nil
159 "Summary movement commands."
160 :link '(custom-manual "(gnus)Summary Maneuvering")
161 :group 'gnus-summary)
163 (defgroup gnus-picon nil
164 "Show pictures of people, domains, and newsgroups."
167 (defgroup gnus-summary-mail nil
168 "Mail group commands."
169 :link '(custom-manual "(gnus)Mail Group Commands")
170 :group 'gnus-summary)
172 (defgroup gnus-summary-sort nil
173 "Sorting the summary buffer."
174 :link '(custom-manual "(gnus)Sorting the Summary Buffer")
175 :group 'gnus-summary)
177 (defgroup gnus-summary-visual nil
178 "Highlighting and menus in the summary buffer."
179 :link '(custom-manual "(gnus)Summary Highlighting")
181 :group 'gnus-summary)
183 (defgroup gnus-summary-various nil
184 "Various summary buffer options."
185 :link '(custom-manual "(gnus)Various Summary Stuff")
186 :group 'gnus-summary)
188 (defgroup gnus-summary-pick nil
189 "Pick mode in the summary buffer."
190 :link '(custom-manual "(gnus)Pick and Read")
192 :group 'gnus-summary)
194 (defgroup gnus-summary-tree nil
195 "Tree display of threads in the summary buffer."
196 :link '(custom-manual "(gnus)Tree Display")
198 :group 'gnus-summary)
200 ;; Belongs to gnus-uu.el
201 (defgroup gnus-extract-view nil
202 "Viewing extracted files."
203 :link '(custom-manual "(gnus)Viewing Files")
204 :group 'gnus-extract)
206 ;; Belongs to gnus-score.el
207 (defgroup gnus-score nil
208 "Score and kill file handling."
211 (defgroup gnus-score-kill nil
215 (defgroup gnus-score-adapt nil
216 "Adaptive score files."
219 (defgroup gnus-score-default nil
220 "Default values for score files."
223 (defgroup gnus-score-expire nil
224 "Expiring score rules."
227 (defgroup gnus-score-decay nil
228 "Decaying score rules."
231 (defgroup gnus-score-files nil
232 "Score and kill file names."
236 (defgroup gnus-score-various nil
237 "Various scoring and killing options."
241 (defgroup gnus-visual nil
242 "Options controlling the visual fluff."
246 (defgroup gnus-agent nil
247 "Offline support for Gnus."
250 (defgroup gnus-files nil
251 "Files used by Gnus."
254 (defgroup gnus-dribble-file nil
256 :link '(custom-manual "(gnus)Auto Save")
259 (defgroup gnus-newsrc nil
260 "Storing Gnus state."
263 (defgroup gnus-server nil
264 "Options related to newsservers and other servers used by Gnus."
267 (defgroup gnus-server-visual nil
268 "Highlighting and menus in the server buffer."
272 (defgroup gnus-message '((message custom-group))
273 "Composing replies and followups in Gnus."
276 (defgroup gnus-meta nil
277 "Meta variables controlling major portions of Gnus.
278 In general, modifying these variables does not take affect until Gnus
279 is restarted, and sometimes reloaded."
282 (defgroup gnus-various nil
283 "Other Gnus options."
284 :link '(custom-manual "(gnus)Various Various")
287 (defgroup gnus-exit nil
289 :link '(custom-manual "(gnus)Exiting Gnus")
292 (defgroup gnus-fun nil
293 "Frivolous Gnus extensions."
294 :link '(custom-manual "(gnus)Exiting Gnus")
297 (defconst gnus-version-number "0.11"
298 "Version number for this version of Gnus.")
300 (defconst gnus-version (format "No Gnus v%s" gnus-version-number)
301 "Version string for this version of Gnus.")
303 (defcustom gnus-inhibit-startup-message nil
304 "If non-nil, the startup message will not be displayed.
305 This variable is used before `.gnus.el' is loaded, so it should
306 be set in `.emacs' instead."
310 (unless (featurep 'gnus-xmas)
311 (defalias 'gnus-make-overlay 'make-overlay)
312 (defalias 'gnus-delete-overlay 'delete-overlay)
313 (defalias 'gnus-overlay-get 'overlay-get)
314 (defalias 'gnus-overlay-put 'overlay-put)
315 (defalias 'gnus-move-overlay 'move-overlay)
316 (defalias 'gnus-overlay-buffer 'overlay-buffer)
317 (defalias 'gnus-overlay-start 'overlay-start)
318 (defalias 'gnus-overlay-end 'overlay-end)
319 (defalias 'gnus-overlays-in 'overlays-in)
320 (defalias 'gnus-extent-detached-p 'ignore)
321 (defalias 'gnus-extent-start-open 'ignore)
322 (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
323 (defalias 'gnus-character-to-event 'identity)
324 (defalias 'gnus-assq-delete-all 'assq-delete-all)
325 (defalias 'gnus-add-text-properties 'add-text-properties)
326 (defalias 'gnus-put-text-property 'put-text-property)
327 (defvar gnus-mode-line-image-cache t)
328 (if (fboundp 'find-image)
329 (defun gnus-mode-line-buffer-identification (line)
330 (let ((str (car-safe line))
331 (load-path (mm-image-load-path)))
332 (if (and (stringp str)
333 (string-match "^Gnus:" str))
334 (progn (add-text-properties
337 (if (eq t gnus-mode-line-image-cache)
338 (setq gnus-mode-line-image-cache
340 '((:type xpm :file "gnus-pointer.xpm"
342 (:type xbm :file "gnus-pointer.xbm"
344 gnus-mode-line-image-cache)
347 gnus-version (gnus-emacs-version)))
351 (defalias 'gnus-mode-line-buffer-identification 'identity))
352 (defalias 'gnus-deactivate-mark 'deactivate-mark)
353 (defalias 'gnus-window-edges 'window-edges)
354 (defalias 'gnus-key-press-event-p 'numberp)
355 ;;(defalias 'gnus-decode-rfc1522 'ignore)
358 ;; We define these group faces here to avoid the display
359 ;; update forced when creating new faces.
361 (defface gnus-group-news-1
364 (:foreground "PaleTurquoise" :bold t))
367 (:foreground "ForestGreen" :bold t))
370 "Level 1 newsgroup face."
372 ;; backward-compatibility alias
373 (put 'gnus-group-news-1-face 'face-alias 'gnus-group-news-1)
374 (put 'gnus-group-news-1-face 'obsolete-face "22.1")
376 (defface gnus-group-news-1-empty
379 (:foreground "PaleTurquoise"))
382 (:foreground "ForestGreen"))
385 "Level 1 empty newsgroup face."
387 ;; backward-compatibility alias
388 (put 'gnus-group-news-1-empty-face 'face-alias 'gnus-group-news-1-empty)
389 (put 'gnus-group-news-1-empty-face 'obsolete-face "22.1")
391 (defface gnus-group-news-2
394 (:foreground "turquoise" :bold t))
397 (:foreground "CadetBlue4" :bold t))
400 "Level 2 newsgroup face."
402 ;; backward-compatibility alias
403 (put 'gnus-group-news-2-face 'face-alias 'gnus-group-news-2)
404 (put 'gnus-group-news-2-face 'obsolete-face "22.1")
406 (defface gnus-group-news-2-empty
409 (:foreground "turquoise"))
412 (:foreground "CadetBlue4"))
415 "Level 2 empty newsgroup face."
417 ;; backward-compatibility alias
418 (put 'gnus-group-news-2-empty-face 'face-alias 'gnus-group-news-2-empty)
419 (put 'gnus-group-news-2-empty-face 'obsolete-face "22.1")
421 (defface gnus-group-news-3
430 "Level 3 newsgroup face."
432 ;; backward-compatibility alias
433 (put 'gnus-group-news-3-face 'face-alias 'gnus-group-news-3)
434 (put 'gnus-group-news-3-face 'obsolete-face "22.1")
436 (defface gnus-group-news-3-empty
445 "Level 3 empty newsgroup face."
447 ;; backward-compatibility alias
448 (put 'gnus-group-news-3-empty-face 'face-alias 'gnus-group-news-3-empty)
449 (put 'gnus-group-news-3-empty-face 'obsolete-face "22.1")
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)
464 (put 'gnus-group-news-4-face 'obsolete-face "22.1")
466 (defface gnus-group-news-4-empty
475 "Level 4 empty newsgroup face."
477 ;; backward-compatibility alias
478 (put 'gnus-group-news-4-empty-face 'face-alias 'gnus-group-news-4-empty)
479 (put 'gnus-group-news-4-empty-face 'obsolete-face "22.1")
481 (defface gnus-group-news-5
490 "Level 5 newsgroup face."
492 ;; backward-compatibility alias
493 (put 'gnus-group-news-5-face 'face-alias 'gnus-group-news-5)
494 (put 'gnus-group-news-5-face 'obsolete-face "22.1")
496 (defface gnus-group-news-5-empty
505 "Level 5 empty newsgroup face."
507 ;; backward-compatibility alias
508 (put 'gnus-group-news-5-empty-face 'face-alias 'gnus-group-news-5-empty)
509 (put 'gnus-group-news-5-empty-face 'obsolete-face "22.1")
511 (defface gnus-group-news-6
520 "Level 6 newsgroup face."
522 ;; backward-compatibility alias
523 (put 'gnus-group-news-6-face 'face-alias 'gnus-group-news-6)
524 (put 'gnus-group-news-6-face 'obsolete-face "22.1")
526 (defface gnus-group-news-6-empty
535 "Level 6 empty newsgroup face."
537 ;; backward-compatibility alias
538 (put 'gnus-group-news-6-empty-face 'face-alias 'gnus-group-news-6-empty)
539 (put 'gnus-group-news-6-empty-face 'obsolete-face "22.1")
541 (defface gnus-group-news-low
544 (:foreground "DarkTurquoise" :bold t))
547 (:foreground "DarkGreen" :bold t))
550 "Low level newsgroup face."
552 ;; backward-compatibility alias
553 (put 'gnus-group-news-low-face 'face-alias 'gnus-group-news-low)
554 (put 'gnus-group-news-low-face 'obsolete-face "22.1")
556 (defface gnus-group-news-low-empty
559 (:foreground "DarkTurquoise"))
562 (:foreground "DarkGreen"))
565 "Low level empty newsgroup face."
567 ;; backward-compatibility alias
568 (put 'gnus-group-news-low-empty-face 'face-alias 'gnus-group-news-low-empty)
569 (put 'gnus-group-news-low-empty-face 'obsolete-face "22.1")
571 (defface gnus-group-mail-1
574 (:foreground "#e1ffe1" :bold t))
577 (:foreground "DeepPink3" :bold t))
580 "Level 1 mailgroup face."
582 ;; backward-compatibility alias
583 (put 'gnus-group-mail-1-face 'face-alias 'gnus-group-mail-1)
584 (put 'gnus-group-mail-1-face 'obsolete-face "22.1")
586 (defface gnus-group-mail-1-empty
589 (:foreground "#e1ffe1"))
592 (:foreground "DeepPink3"))
594 (:italic t :bold t)))
595 "Level 1 empty mailgroup face."
597 ;; backward-compatibility alias
598 (put 'gnus-group-mail-1-empty-face 'face-alias 'gnus-group-mail-1-empty)
599 (put 'gnus-group-mail-1-empty-face 'obsolete-face "22.1")
601 (defface gnus-group-mail-2
604 (:foreground "DarkSeaGreen1" :bold t))
607 (:foreground "HotPink3" :bold t))
610 "Level 2 mailgroup face."
612 ;; backward-compatibility alias
613 (put 'gnus-group-mail-2-face 'face-alias 'gnus-group-mail-2)
614 (put 'gnus-group-mail-2-face 'obsolete-face "22.1")
616 (defface gnus-group-mail-2-empty
619 (:foreground "DarkSeaGreen1"))
622 (:foreground "HotPink3"))
625 "Level 2 empty mailgroup face."
627 ;; backward-compatibility alias
628 (put 'gnus-group-mail-2-empty-face 'face-alias 'gnus-group-mail-2-empty)
629 (put 'gnus-group-mail-2-empty-face 'obsolete-face "22.1")
631 (defface gnus-group-mail-3
634 (:foreground "aquamarine1" :bold t))
637 (:foreground "magenta4" :bold t))
640 "Level 3 mailgroup face."
642 ;; backward-compatibility alias
643 (put 'gnus-group-mail-3-face 'face-alias 'gnus-group-mail-3)
644 (put 'gnus-group-mail-3-face 'obsolete-face "22.1")
646 (defface gnus-group-mail-3-empty
649 (:foreground "aquamarine1"))
652 (:foreground "magenta4"))
655 "Level 3 empty mailgroup face."
657 ;; backward-compatibility alias
658 (put 'gnus-group-mail-3-empty-face 'face-alias 'gnus-group-mail-3-empty)
659 (put 'gnus-group-mail-3-empty-face 'obsolete-face "22.1")
661 (defface gnus-group-mail-low
664 (:foreground "aquamarine2" :bold t))
667 (:foreground "DeepPink4" :bold t))
670 "Low level mailgroup face."
672 ;; backward-compatibility alias
673 (put 'gnus-group-mail-low-face 'face-alias 'gnus-group-mail-low)
674 (put 'gnus-group-mail-low-face 'obsolete-face "22.1")
676 (defface gnus-group-mail-low-empty
679 (:foreground "aquamarine2"))
682 (:foreground "DeepPink4"))
685 "Low level empty mailgroup face."
687 ;; backward-compatibility alias
688 (put 'gnus-group-mail-low-empty-face 'face-alias 'gnus-group-mail-low-empty)
689 (put 'gnus-group-mail-low-empty-face 'obsolete-face "22.1")
691 ;; Summary mode faces.
693 (defface gnus-summary-selected '((t (:underline t)))
694 "Face used for selected articles."
695 :group 'gnus-summary)
696 ;; backward-compatibility alias
697 (put 'gnus-summary-selected-face 'face-alias 'gnus-summary-selected)
698 (put 'gnus-summary-selected-face 'obsolete-face "22.1")
700 (defface gnus-summary-cancelled
702 (:foreground "yellow" :background "black")))
703 "Face used for cancelled articles."
704 :group 'gnus-summary)
705 ;; backward-compatibility alias
706 (put 'gnus-summary-cancelled-face 'face-alias 'gnus-summary-cancelled)
707 (put 'gnus-summary-cancelled-face 'obsolete-face "22.1")
709 (defface gnus-summary-high-ticked
712 (:foreground "pink" :bold t))
715 (:foreground "firebrick" :bold t))
718 "Face used for high interest ticked articles."
719 :group 'gnus-summary)
720 ;; backward-compatibility alias
721 (put 'gnus-summary-high-ticked-face 'face-alias 'gnus-summary-high-ticked)
722 (put 'gnus-summary-high-ticked-face 'obsolete-face "22.1")
724 (defface gnus-summary-low-ticked
727 (:foreground "pink" :italic t))
730 (:foreground "firebrick" :italic t))
733 "Face used for low interest ticked articles."
734 :group 'gnus-summary)
735 ;; backward-compatibility alias
736 (put 'gnus-summary-low-ticked-face 'face-alias 'gnus-summary-low-ticked)
737 (put 'gnus-summary-low-ticked-face 'obsolete-face "22.1")
739 (defface gnus-summary-normal-ticked
742 (:foreground "pink"))
745 (:foreground "firebrick"))
748 "Face used for normal interest ticked articles."
749 :group 'gnus-summary)
750 ;; backward-compatibility alias
751 (put 'gnus-summary-normal-ticked-face 'face-alias 'gnus-summary-normal-ticked)
752 (put 'gnus-summary-normal-ticked-face 'obsolete-face "22.1")
754 (defface gnus-summary-high-ancient
757 (:foreground "SkyBlue" :bold t))
760 (:foreground "RoyalBlue" :bold t))
763 "Face used for high interest ancient articles."
764 :group 'gnus-summary)
765 ;; backward-compatibility alias
766 (put 'gnus-summary-high-ancient-face 'face-alias 'gnus-summary-high-ancient)
767 (put 'gnus-summary-high-ancient-face 'obsolete-face "22.1")
769 (defface gnus-summary-low-ancient
772 (:foreground "SkyBlue" :italic t))
775 (:foreground "RoyalBlue" :italic t))
778 "Face used for low interest ancient articles."
779 :group 'gnus-summary)
780 ;; backward-compatibility alias
781 (put 'gnus-summary-low-ancient-face 'face-alias 'gnus-summary-low-ancient)
782 (put 'gnus-summary-low-ancient-face 'obsolete-face "22.1")
784 (defface gnus-summary-normal-ancient
787 (:foreground "SkyBlue"))
790 (:foreground "RoyalBlue"))
793 "Face used for normal interest ancient articles."
794 :group 'gnus-summary)
795 ;; backward-compatibility alias
796 (put 'gnus-summary-normal-ancient-face 'face-alias 'gnus-summary-normal-ancient)
797 (put 'gnus-summary-normal-ancient-face 'obsolete-face "22.1")
799 (defface gnus-summary-high-undownloaded
802 (:bold t :foreground "cyan4"))
803 (((class color) (background dark))
804 (:bold t :foreground "LightGray"))
805 (t (:inverse-video t :bold t)))
806 "Face used for high interest uncached articles."
807 :group 'gnus-summary)
808 ;; backward-compatibility alias
809 (put 'gnus-summary-high-undownloaded-face 'face-alias 'gnus-summary-high-undownloaded)
810 (put 'gnus-summary-high-undownloaded-face 'obsolete-face "22.1")
812 (defface gnus-summary-low-undownloaded
815 (:italic t :foreground "cyan4" :bold nil))
816 (((class color) (background dark))
817 (:italic t :foreground "LightGray" :bold nil))
818 (t (:inverse-video t :italic t)))
819 "Face used for low interest uncached articles."
820 :group 'gnus-summary)
821 ;; backward-compatibility alias
822 (put 'gnus-summary-low-undownloaded-face 'face-alias 'gnus-summary-low-undownloaded)
823 (put 'gnus-summary-low-undownloaded-face 'obsolete-face "22.1")
825 (defface gnus-summary-normal-undownloaded
828 (:foreground "cyan4" :bold nil))
829 (((class color) (background dark))
830 (:foreground "LightGray" :bold nil))
831 (t (:inverse-video t)))
832 "Face used for normal interest uncached articles."
833 :group 'gnus-summary)
834 ;; backward-compatibility alias
835 (put 'gnus-summary-normal-undownloaded-face 'face-alias 'gnus-summary-normal-undownloaded)
836 (put 'gnus-summary-normal-undownloaded-face 'obsolete-face "22.1")
838 (defface gnus-summary-high-unread
841 "Face used for high interest unread articles."
842 :group 'gnus-summary)
843 ;; backward-compatibility alias
844 (put 'gnus-summary-high-unread-face 'face-alias 'gnus-summary-high-unread)
845 (put 'gnus-summary-high-unread-face 'obsolete-face "22.1")
847 (defface gnus-summary-low-unread
850 "Face used for low interest unread articles."
851 :group 'gnus-summary)
852 ;; backward-compatibility alias
853 (put 'gnus-summary-low-unread-face 'face-alias 'gnus-summary-low-unread)
854 (put 'gnus-summary-low-unread-face 'obsolete-face "22.1")
856 (defface gnus-summary-normal-unread
859 "Face used for normal interest unread articles."
860 :group 'gnus-summary)
861 ;; backward-compatibility alias
862 (put 'gnus-summary-normal-unread-face 'face-alias 'gnus-summary-normal-unread)
863 (put 'gnus-summary-normal-unread-face 'obsolete-face "22.1")
865 (defface gnus-summary-high-read
868 (:foreground "PaleGreen"
872 (:foreground "DarkGreen"
876 "Face used for high interest read articles."
877 :group 'gnus-summary)
878 ;; backward-compatibility alias
879 (put 'gnus-summary-high-read-face 'face-alias 'gnus-summary-high-read)
880 (put 'gnus-summary-high-read-face 'obsolete-face "22.1")
882 (defface gnus-summary-low-read
885 (:foreground "PaleGreen"
889 (:foreground "DarkGreen"
893 "Face used for low interest read articles."
894 :group 'gnus-summary)
895 ;; backward-compatibility alias
896 (put 'gnus-summary-low-read-face 'face-alias 'gnus-summary-low-read)
897 (put 'gnus-summary-low-read-face 'obsolete-face "22.1")
899 (defface gnus-summary-normal-read
902 (:foreground "PaleGreen"))
905 (:foreground "DarkGreen"))
908 "Face used for normal interest read articles."
909 :group 'gnus-summary)
910 ;; backward-compatibility alias
911 (put 'gnus-summary-normal-read-face 'face-alias 'gnus-summary-normal-read)
912 (put 'gnus-summary-normal-read-face 'obsolete-face "22.1")
919 (defvar gnus-buffers nil
920 "List of buffers handled by Gnus.")
922 (defun gnus-get-buffer-create (name)
923 "Do the same as `get-buffer-create', but store the created buffer."
924 (or (get-buffer name)
925 (car (push (get-buffer-create name) gnus-buffers))))
927 (defun gnus-add-buffer ()
928 "Add the current buffer to the list of Gnus buffers."
929 (push (current-buffer) gnus-buffers))
931 (defmacro gnus-kill-buffer (buffer)
932 "Kill BUFFER and remove from the list of Gnus buffers."
933 `(let ((buf ,buffer))
934 (when (gnus-buffer-exists-p buf)
935 (setq gnus-buffers (delete (get-buffer buf) gnus-buffers))
938 (defun gnus-buffers ()
939 "Return a list of live Gnus buffers."
940 (while (and gnus-buffers
941 (not (buffer-name (car gnus-buffers))))
943 (let ((buffers gnus-buffers))
945 (if (buffer-name (cadr buffers))
947 (setcdr buffers (cddr buffers)))))
952 (defvar gnus-group-buffer "*Group*"
953 "Name of the Gnus group buffer.")
958 (:foreground "#cccccc"))
961 (:foreground "#888888"))
964 "Face for the splash screen."
966 ;; backward-compatibility alias
967 (put 'gnus-splash-face 'face-alias 'gnus-splash)
968 (put 'gnus-splash-face 'obsolete-face "22.1")
970 (defun gnus-splash ()
972 (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer))
973 (let ((buffer-read-only nil))
975 (unless gnus-inhibit-startup-message
976 (gnus-group-startup-message)
979 (defun gnus-indent-rigidly (start end arg)
980 "Indent rigidly using only spaces and no tabs."
983 (narrow-to-region start end)
985 (indent-rigidly start end arg)
986 ;; We translate tabs into spaces -- not everybody uses
987 ;; an 8-character tab.
988 (goto-char (point-min))
989 (while (search-forward "\t" nil t)
990 (replace-match " " t t))))))
992 ;;(format "%02x%02x%02x" 114 66 20) "724214"
994 (defvar gnus-logo-color-alist
995 '((flame "#cc3300" "#ff2200")
996 (pine "#c0cc93" "#f8ffb8")
997 (moss "#a1cc93" "#d2ffb8")
998 (irish "#04cc90" "#05ff97")
999 (sky "#049acc" "#05deff")
1000 (tin "#6886cc" "#82b6ff")
1001 (velvet "#7c68cc" "#8c82ff")
1002 (grape "#b264cc" "#cf7df")
1003 (labia "#cc64c2" "#fd7dff")
1004 (berry "#cc6485" "#ff7db5")
1005 (dino "#724214" "#1e3f03")
1006 (oort "#cccccc" "#888888")
1007 (storm "#666699" "#99ccff")
1008 (pdino "#9999cc" "#99ccff")
1009 (purp "#9999cc" "#666699")
1010 (no "#ff0000" "#ffff00")
1011 (neutral "#b4b4b4" "#878787")
1012 (september "#bf9900" "#ffcc00"))
1013 "Color alist used for the Gnus logo.")
1015 (defcustom gnus-logo-color-style 'no
1016 "*Color styles used for the Gnus logo."
1017 :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem)))
1018 gnus-logo-color-alist))
1021 (defvar gnus-logo-colors
1022 (cdr (assq gnus-logo-color-style gnus-logo-color-alist))
1023 "Colors used for the Gnus logo.")
1025 (declare-function image-size "image.c" (spec &optional pixels frame))
1027 (defun gnus-group-startup-message (&optional x y)
1028 "Insert startup message in current buffer."
1029 ;; Insert the message.
1032 (fboundp 'find-image)
1034 ;; Make sure the library defining `image-load-path' is loaded
1035 ;; (`find-image' is autoloaded) (and discard the result). Else, we may
1036 ;; get "defvar ignored because image-load-path is let-bound" when calling
1037 ;; `find-image' below.
1038 (or (find-image '(nil (:type xpm :file "gnus.xpm"))) t)
1039 (let* ((data-directory (nnheader-find-etc-directory "images/gnus"))
1040 (image-load-path (cond (data-directory
1041 (list data-directory))
1042 ((boundp 'image-load-path)
1043 (symbol-value 'image-load-path))
1046 `((:type xpm :file "gnus.xpm"
1048 (("thing" . ,(car gnus-logo-colors))
1049 ("shadow" . ,(cadr gnus-logo-colors))))
1050 (:type svg :file "gnus.svg")
1051 (:type png :file "gnus.png")
1052 (:type pbm :file "gnus.pbm"
1053 ;; Account for the pbm's background.
1054 :background ,(face-foreground 'gnus-splash)
1055 :foreground ,(face-background 'default))
1056 (:type xbm :file "gnus.xbm"
1057 ;; Account for the xbm's background.
1058 :background ,(face-foreground 'gnus-splash)
1059 :foreground ,(face-background 'default))))))
1061 (let ((size (image-size image)))
1062 (insert-char ?\n (max 0 (round (- (window-height)
1063 (or y (cdr size)) 1) 2)))
1064 (insert-char ?\ (max 0 (round (- (window-width)
1065 (or x (car size))) 2)))
1066 (insert-image image))
1071 _ ___ __ ___ __ _ ___
1089 ;; And then hack it.
1090 (gnus-indent-rigidly (point-min) (point-max)
1091 (/ (max (- (window-width) (or x 46)) 0) 2))
1092 (goto-char (point-min))
1094 (let* ((pheight (count-lines (point-min) (point-max)))
1095 (wheight (window-height))
1096 (rest (- wheight pheight)))
1097 (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n)))
1099 (put-text-property (point-min) (point-max) 'face 'gnus-splash)
1100 (goto-char (point-min))
1101 (setq mode-line-buffer-identification (concat " " gnus-version))
1102 (set-buffer-modified-p t)))
1105 (let ((command (format "%s" this-command)))
1106 (when (string-match "gnus" command)
1107 (if (string-match "gnus-other-frame" command)
1108 (gnus-get-buffer-create gnus-group-buffer)
1113 (require 'gnus-util)
1116 (defcustom gnus-parameters nil
1117 "Alist of group parameters.
1120 ((\"mail\\\\..*\" (gnus-show-threads nil)
1121 (gnus-use-scoring nil)
1122 (gnus-summary-line-format
1123 \"%U%R%z%I%(%[%d:%ub%-23,23f%]%) %s\\n\")
1126 (\"mail\\\\.me\" (gnus-use-scoring t))
1127 (\"list\\\\..*\" (total-expire . t)
1128 (broken-reply-to . t)))"
1130 :group 'gnus-group-various
1131 :type '(repeat (cons regexp
1134 (defcustom gnus-parameters-case-fold-search 'default
1135 "If it is t, ignore case of group names specified in `gnus-parameters'.
1136 If it is nil, don't ignore case. If it is `default', which is for the
1137 backward compatibility, use the value of `case-fold-search'."
1139 :group 'gnus-group-various
1140 :type '(choice :format "%{%t%}:\n %[Value Menu%] %v"
1141 (const :tag "Use `case-fold-search'" default)
1145 (defvar gnus-group-parameters-more nil)
1147 (defmacro gnus-define-group-parameter (param &rest rest)
1148 "Define a group parameter PARAM.
1149 REST is a plist of following:
1150 :type One of `bool', `list' or nil.
1151 :function The name of the function.
1152 :function-document The documentation of the function.
1153 :parameter-type The type for customizing the parameter.
1154 :parameter-document The documentation for the parameter.
1155 :variable The name of the variable.
1156 :variable-document The documentation for the variable.
1157 :variable-group The group for customizing the variable.
1158 :variable-type The type for customizing the variable.
1159 :variable-default The default value of the variable."
1160 (let* ((type (plist-get rest :type))
1161 (parameter-type (plist-get rest :parameter-type))
1162 (parameter-document (plist-get rest :parameter-document))
1163 (function (or (plist-get rest :function)
1164 (intern (format "gnus-parameter-%s" param))))
1165 (function-document (or (plist-get rest :function-document) ""))
1166 (variable (or (plist-get rest :variable)
1167 (intern (format "gnus-parameter-%s-alist" param))))
1168 (variable-document (or (plist-get rest :variable-document) ""))
1169 (variable-group (plist-get rest :variable-group))
1170 (variable-type (or (plist-get rest :variable-type)
1172 (list (regexp :tag "Group")
1173 ,(car (cdr parameter-type)))))))
1174 (variable-default (plist-get rest :variable-default)))
1177 `(defcustom ,variable ,variable-default
1179 :group 'gnus-group-parameter
1180 :group ',variable-group
1181 :type ,variable-type)
1182 `(setq gnus-group-parameters-more
1183 (delq (assq ',param gnus-group-parameters-more)
1184 gnus-group-parameters-more))
1185 `(add-to-list 'gnus-group-parameters-more
1188 ,parameter-document))
1190 `(defun ,function (name)
1192 (let ((params (gnus-group-find-parameter name))
1195 ((memq ',param params)
1197 ((setq val (assq ',param params))
1199 ((stringp ,variable)
1200 (string-match ,variable name))
1202 (let ((alist ,variable)
1204 (while (setq elem (pop alist))
1206 (string-match (car elem) name))
1209 (if (consp value) (car value) value))))))
1210 `(defun ,function (name)
1213 (or (gnus-group-find-parameter name ',param ,(and type t))
1214 (let ((alist ,variable)
1216 (while (setq elem (pop alist))
1218 (string-match (car elem) name))
1223 '(if (consp value) (car value) value))))))))))
1225 (defcustom gnus-home-directory "~/"
1226 "Directory variable that specifies the \"home\" directory.
1227 All other Gnus file and directory variables are initialized from this variable."
1231 (defcustom gnus-directory (or (getenv "SAVEDIR")
1232 (nnheader-concat gnus-home-directory "News/"))
1233 "*Directory variable from which all other Gnus file variables are derived.
1235 Note that Gnus is mostly loaded when the `.gnus.el' file is read.
1236 This means that other directory variables that are initialized from
1237 this variable won't be set properly if you set this variable in `.gnus.el'.
1238 Set this variable in `.emacs' instead."
1242 (defcustom gnus-default-directory nil
1243 "*Default directory for all Gnus buffers."
1245 :type '(choice (const :tag "current" nil)
1248 ;; Site dependent variables. These variables should be defined in
1251 (defvar gnus-default-nntp-server nil
1252 "Specify a default NNTP server.
1253 This variable should be defined in paths.el, and should never be set
1255 If you want to change servers, you should use `gnus-select-method'.
1256 See the documentation to that variable.")
1258 (defcustom gnus-nntpserver-file "/etc/nntpserver"
1259 "A file with only the name of the nntp server in it."
1264 (defun gnus-getenv-nntpserver ()
1265 "Find default nntp server.
1266 Check the NNTPSERVER environment variable and the
1267 `gnus-nntpserver-file' file."
1268 (or (getenv "NNTPSERVER")
1269 (and (file-readable-p gnus-nntpserver-file)
1271 (insert-file-contents gnus-nntpserver-file)
1272 (when (re-search-forward "[^ \t\n\r]+" nil t)
1273 (match-string 0))))))
1275 ;; `M-x customize-variable RET gnus-select-method RET' should work without
1276 ;; starting or even loading Gnus.
1277 ;;;###autoload(when (fboundp 'custom-autoload)
1278 ;;;###autoload (custom-autoload 'gnus-select-method "gnus"))
1280 (defcustom gnus-select-method
1281 (list 'nntp (or (gnus-getenv-nntpserver)
1282 (when (and gnus-default-nntp-server
1283 (not (string= gnus-default-nntp-server "")))
1284 gnus-default-nntp-server)
1286 "Default method for selecting a newsgroup.
1287 This variable should be a list, where the first element is how the
1288 news is to be fetched, the second is the address.
1290 For instance, if you want to get your news via \"flab.flab.edu\" using
1291 NNTP, you could say:
1293 \(setq gnus-select-method '(nntp \"flab.flab.edu\"))
1295 If you want to use your local spool, say:
1297 \(setq gnus-select-method (list 'nnspool (system-name)))
1299 If you use this variable, you must set `gnus-nntp-server' to nil.
1301 There is a lot more to know about select methods and virtual servers -
1302 see the manual for details."
1305 :initialize 'custom-initialize-default
1306 :type 'gnus-select-method)
1308 (defcustom gnus-message-archive-method "archive"
1309 "*Method used for archiving messages you've sent.
1310 This should be a mail method.
1312 See also `gnus-update-message-archive-method'."
1314 :group 'gnus-message
1315 :type '(choice (const :tag "Default archive method" "archive")
1316 gnus-select-method))
1318 (defcustom gnus-update-message-archive-method nil
1319 "Non-nil means always update the saved \"archive\" method.
1321 The archive method is initially set according to the value of
1322 `gnus-message-archive-method' and is saved in the \"~/.newsrc.eld\" file
1323 so that it may be used as a real method of the server which is named
1324 \"archive\" ever since. If it once has been saved, it will never be
1325 updated if the value of this variable is nil, even if you change the
1326 value of `gnus-message-archive-method' afterward. If you want the
1327 saved \"archive\" method to be updated whenever you change the value of
1328 `gnus-message-archive-method', set this variable to a non-nil value."
1331 :group 'gnus-message
1334 (defcustom gnus-message-archive-group '((format-time-string "sent.%Y-%m"))
1335 "*Name of the group in which to save the messages you've written.
1336 This can either be a string; a list of strings; or an alist
1337 of regexps/functions/forms to be evaluated to return a string (or a list
1338 of strings). The functions are called with the name of the current
1339 group (or nil) as a parameter.
1341 If you want to save your mail in one group and the news articles you
1342 write in another group, you could say something like:
1344 \(setq gnus-message-archive-group
1345 '((if (message-news-p)
1349 Normally the group names returned by this variable should be
1350 unprefixed -- which implicitly means \"store on the archive server\".
1351 However, you may wish to store the message on some other server. In
1352 that case, just return a fully prefixed name of the group --
1353 \"nnml+private:mail.misc\", for instance."
1355 :group 'gnus-message
1356 :type '(choice (const :tag "none" nil)
1357 (const :tag "Weekly" ((format-time-string "sent.%Yw%U")))
1358 (const :tag "Monthly" ((format-time-string "sent.%Y-%m")))
1359 (const :tag "Yearly" ((format-time-string "sent.%Y")))
1364 (defcustom gnus-secondary-servers nil
1365 "List of NNTP servers that the user can choose between interactively.
1366 To make Gnus query you for a server, you have to give `gnus' a
1367 non-numeric prefix - `C-u M-x gnus', in short."
1369 :type '(repeat string))
1370 (make-obsolete-variable 'gnus-secondary-servers 'gnus-select-method "24.1")
1372 (defcustom gnus-nntp-server nil
1373 "The name of the host running the NNTP server."
1375 :type '(choice (const :tag "disable" nil)
1377 (make-obsolete-variable 'gnus-nntp-server 'gnus-select-method "24.1")
1379 (defcustom gnus-secondary-select-methods nil
1380 "A list of secondary methods that will be used for reading news.
1381 This is a list where each element is a complete select method (see
1382 `gnus-select-method').
1384 If, for instance, you want to read your mail with the nnml back end,
1385 you could set this variable:
1387 \(setq gnus-secondary-select-methods '((nnml \"\")))"
1389 :type '(repeat gnus-select-method))
1391 (defvar gnus-backup-default-subscribed-newsgroups
1392 '("news.announce.newusers" "news.groups.questions" "gnu.emacs.gnus")
1393 "Default default new newsgroups the first time Gnus is run.
1394 Should be set in paths.el, and shouldn't be touched by the user.")
1396 (defcustom gnus-local-domain nil
1397 "Local domain name without a host name.
1398 The DOMAINNAME environment variable is used instead if it is defined.
1399 If the function `system-name' returns the full Internet name, there is
1400 no need to set this variable."
1401 :group 'gnus-message
1402 :type '(choice (const :tag "default" nil)
1404 (make-obsolete-variable 'gnus-local-domain nil "Emacs 24.1")
1406 (defvar gnus-local-organization nil
1407 "String with a description of what organization (if any) the user belongs to.
1408 Obsolete variable; use `message-user-organization' instead.")
1410 ;; Customization variables
1412 (defcustom gnus-refer-article-method 'current
1413 "Preferred method for fetching an article by Message-ID.
1414 If you are reading news from the local spool (with nnspool), fetching
1415 articles by Message-ID is painfully slow. By setting this method to an
1416 nntp method, you might get acceptable results.
1418 The value of this variable must be a valid select method as discussed
1419 in the documentation of `gnus-select-method'.
1421 It can also be a list of select methods, as well as the special symbol
1422 `current', which means to use the current select method. If it is a
1423 list, Gnus will try all the methods in the list until it finds a match."
1426 :type '(choice (const :tag "default" nil)
1428 (const :tag "Google" (nnweb "refer" (nnweb-type google)))
1430 (repeat :menu-tag "Try multiple"
1432 :value (current (nnweb "refer" (nnweb-type google)))
1433 (choice :tag "Method"
1435 (const :tag "Google"
1436 (nnweb "refer" (nnweb-type google)))
1437 gnus-select-method))))
1439 (defcustom gnus-group-fetch-control-use-browse-url nil
1440 "*Non-nil means that control messages are displayed using `browse-url'.
1441 Otherwise they are fetched wit