1 ;;; gnus.el --- a newsreader for GNU Emacs
2 ;; Copyright (C) 1987-1990,1993-1999 Free Software Foundation, Inc.
4 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
5 ;; Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Keywords: news, mail
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
29 (eval '(run-hooks 'gnus-load-hook))
31 (eval-when-compile (require 'cl))
36 (if (< emacs-major-version 20)
37 (require 'gnus-load)))
41 "The coffee-brewing, all singing, all dancing, kitchen sink newsreader."
45 (defgroup gnus-charset nil
46 "Group character set issues."
47 :link '(custom-manual "(gnus)Charsets")
50 (defgroup gnus-cache nil
54 (defgroup gnus-start nil
55 "Starting your favorite newsreader."
58 (defgroup gnus-start-server nil
59 "Server options at startup."
62 ;; These belong to gnus-group.el.
63 (defgroup gnus-group nil
65 :link '(custom-manual "(gnus)The Group Buffer")
68 (defgroup gnus-group-foreign nil
70 :link '(custom-manual "(gnus)Foreign Groups")
73 (defgroup gnus-group-new nil
74 "Automatic subscription of new groups."
77 (defgroup gnus-group-levels nil
79 :link '(custom-manual "(gnus)Group Levels")
82 (defgroup gnus-group-select nil
84 :link '(custom-manual "(gnus)Selecting a Group")
87 (defgroup gnus-group-listing nil
88 "Showing slices of the group list."
89 :link '(custom-manual "(gnus)Listing Groups")
92 (defgroup gnus-group-visual nil
93 "Sorting the group buffer."
94 :link '(custom-manual "(gnus)Group Buffer Format")
98 (defgroup gnus-group-various nil
99 "Various group options."
100 :link '(custom-manual "(gnus)Scanning New Messages")
103 ;; These belong to gnus-sum.el.
104 (defgroup gnus-summary nil
106 :link '(custom-manual "(gnus)The Summary Buffer")
109 (defgroup gnus-summary-exit nil
110 "Leaving summary buffers."
111 :link '(custom-manual "(gnus)Exiting the Summary Buffer")
112 :group 'gnus-summary)
114 (defgroup gnus-summary-marks nil
115 "Marks used in summary buffers."
116 :link '(custom-manual "(gnus)Marking Articles")
117 :group 'gnus-summary)
119 (defgroup gnus-thread nil
120 "Ordering articles according to replies."
121 :link '(custom-manual "(gnus)Threading")
122 :group 'gnus-summary)
124 (defgroup gnus-summary-format nil
125 "Formatting of the summary buffer."
126 :link '(custom-manual "(gnus)Summary Buffer Format")
127 :group 'gnus-summary)
129 (defgroup gnus-summary-choose nil
131 :link '(custom-manual "(gnus)Choosing Articles")
132 :group 'gnus-summary)
134 (defgroup gnus-summary-maneuvering nil
135 "Summary movement commands."
136 :link '(custom-manual "(gnus)Summary Maneuvering")
137 :group 'gnus-summary)
139 (defgroup gnus-summary-mail nil
140 "Mail group commands."
141 :link '(custom-manual "(gnus)Mail Group Commands")
142 :group 'gnus-summary)
144 (defgroup gnus-summary-sort nil
145 "Sorting the summary buffer."
146 :link '(custom-manual "(gnus)Sorting")
147 :group 'gnus-summary)
149 (defgroup gnus-summary-visual nil
150 "Highlighting and menus in the summary buffer."
151 :link '(custom-manual "(gnus)Summary Highlighting")
153 :group 'gnus-summary)
155 (defgroup gnus-summary-various nil
156 "Various summary buffer options."
157 :link '(custom-manual "(gnus)Various Summary Stuff")
158 :group 'gnus-summary)
160 (defgroup gnus-summary-pick nil
161 "Pick mode in the summary buffer."
162 :link '(custom-manual "(gnus)Pick and Read")
164 :group 'gnus-summary)
166 (defgroup gnus-summary-tree nil
167 "Tree display of threads in the summary buffer."
168 :link '(custom-manual "(gnus)Tree Display")
170 :group 'gnus-summary)
172 ;; Belongs to gnus-uu.el
173 (defgroup gnus-extract-view nil
174 "Viewing extracted files."
175 :link '(custom-manual "(gnus)Viewing Files")
176 :group 'gnus-extract)
178 ;; Belongs to gnus-score.el
179 (defgroup gnus-score nil
180 "Score and kill file handling."
183 (defgroup gnus-score-kill nil
187 (defgroup gnus-score-adapt nil
188 "Adaptive score files."
191 (defgroup gnus-score-default nil
192 "Default values for score files."
195 (defgroup gnus-score-expire nil
196 "Expiring score rules."
199 (defgroup gnus-score-decay nil
200 "Decaying score rules."
203 (defgroup gnus-score-files nil
204 "Score and kill file names."
208 (defgroup gnus-score-various nil
209 "Various scoring and killing options."
213 (defgroup gnus-visual nil
214 "Options controling the visual fluff."
218 (defgroup gnus-agent nil
219 "Offline support for Gnus."
222 (defgroup gnus-files nil
223 "Files used by Gnus."
226 (defgroup gnus-dribble-file nil
228 :link '(custom-manual "(gnus)Auto Save")
231 (defgroup gnus-newsrc nil
232 "Storing Gnus state."
235 (defgroup gnus-server nil
236 "Options related to newsservers and other servers used by Gnus."
239 (defgroup gnus-message '((message custom-group))
240 "Composing replies and followups in Gnus."
243 (defgroup gnus-meta nil
244 "Meta variables controling major portions of Gnus.
245 In general, modifying these variables does not take affect until Gnus
246 is restarted, and sometimes reloaded."
249 (defgroup gnus-various nil
250 "Other Gnus options."
251 :link '(custom-manual "(gnus)Various Various")
254 (defgroup gnus-mime nil
255 "Variables for controlling the Gnus MIME interface."
258 (defgroup gnus-exit nil
260 :link '(custom-manual "(gnus)Exiting Gnus")
263 (defconst gnus-version-number "5.8.3"
264 "Version number for this version of Gnus.")
266 (defconst gnus-version (format "Gnus v%s" gnus-version-number)
267 "Version string for this version of Gnus.")
269 (defcustom gnus-inhibit-startup-message nil
270 "If non-nil, the startup message will not be displayed.
271 This variable is used before `.gnus.el' is loaded, so it should
272 be set in `.emacs' instead."
276 (defcustom gnus-play-startup-jingle nil
277 "If non-nil, play the Gnus jingle at startup."
281 (unless (featurep 'gnus-xmas)
282 (defalias 'gnus-make-overlay 'make-overlay)
283 (defalias 'gnus-delete-overlay 'delete-overlay)
284 (defalias 'gnus-overlay-put 'overlay-put)
285 (defalias 'gnus-move-overlay 'move-overlay)
286 (defalias 'gnus-overlay-end 'overlay-end)
287 (defalias 'gnus-extent-detached-p 'ignore)
288 (defalias 'gnus-extent-start-open 'ignore)
289 (defalias 'gnus-set-text-properties 'set-text-properties)
290 (defalias 'gnus-group-remove-excess-properties 'ignore)
291 (defalias 'gnus-appt-select-lowest-window 'appt-select-lowest-window)
292 (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
293 (defalias 'gnus-character-to-event 'identity)
294 (defalias 'gnus-add-text-properties 'add-text-properties)
295 (defalias 'gnus-put-text-property 'put-text-property)
296 (defalias 'gnus-mode-line-buffer-identification 'identity)
297 (defalias 'gnus-characterp 'numberp)
298 (defalias 'gnus-deactivate-mark 'deactivate-mark)
299 (defalias 'gnus-window-edges 'window-edges)
300 (defalias 'gnus-key-press-event-p 'numberp)
301 (defalias 'gnus-decode-rfc1522 'ignore))
303 ;; We define these group faces here to avoid the display
304 ;; update forced when creating new faces.
306 (defface gnus-group-news-1-face
309 (:foreground "PaleTurquoise" :bold t))
312 (:foreground "ForestGreen" :bold t))
315 "Level 1 newsgroup face.")
317 (defface gnus-group-news-1-empty-face
320 (:foreground "PaleTurquoise"))
323 (:foreground "ForestGreen"))
326 "Level 1 empty newsgroup face.")
328 (defface gnus-group-news-2-face
331 (:foreground "turquoise" :bold t))
334 (:foreground "CadetBlue4" :bold t))
337 "Level 2 newsgroup face.")
339 (defface gnus-group-news-2-empty-face
342 (:foreground "turquoise"))
345 (:foreground "CadetBlue4"))
348 "Level 2 empty newsgroup face.")
350 (defface gnus-group-news-3-face
359 "Level 3 newsgroup face.")
361 (defface gnus-group-news-3-empty-face
370 "Level 3 empty newsgroup face.")
372 (defface gnus-group-news-4-face
381 "Level 4 newsgroup face.")
383 (defface gnus-group-news-4-empty-face
392 "Level 4 empty newsgroup face.")
394 (defface gnus-group-news-5-face
403 "Level 5 newsgroup face.")
405 (defface gnus-group-news-5-empty-face
414 "Level 5 empty newsgroup face.")
416 (defface gnus-group-news-6-face
425 "Level 6 newsgroup face.")
427 (defface gnus-group-news-6-empty-face
436 "Level 6 empty newsgroup face.")
438 (defface gnus-group-news-low-face
441 (:foreground "DarkTurquoise" :bold t))
444 (:foreground "DarkGreen" :bold t))
447 "Low level newsgroup face.")
449 (defface gnus-group-news-low-empty-face
452 (:foreground "DarkTurquoise"))
455 (:foreground "DarkGreen"))
458 "Low level empty newsgroup face.")
460 (defface gnus-group-mail-1-face
463 (:foreground "aquamarine1" :bold t))
466 (:foreground "DeepPink3" :bold t))
469 "Level 1 mailgroup face.")
471 (defface gnus-group-mail-1-empty-face
474 (:foreground "aquamarine1"))
477 (:foreground "DeepPink3"))
479 (:italic t :bold t)))
480 "Level 1 empty mailgroup face.")
482 (defface gnus-group-mail-2-face
485 (:foreground "aquamarine2" :bold t))
488 (:foreground "HotPink3" :bold t))
491 "Level 2 mailgroup face.")
493 (defface gnus-group-mail-2-empty-face
496 (:foreground "aquamarine2"))
499 (:foreground "HotPink3"))
502 "Level 2 empty mailgroup face.")
504 (defface gnus-group-mail-3-face
507 (:foreground "aquamarine3" :bold t))
510 (:foreground "magenta4" :bold t))
513 "Level 3 mailgroup face.")
515 (defface gnus-group-mail-3-empty-face
518 (:foreground "aquamarine3"))
521 (:foreground "magenta4"))
524 "Level 3 empty mailgroup face.")
526 (defface gnus-group-mail-low-face
529 (:foreground "aquamarine4" :bold t))
532 (:foreground "DeepPink4" :bold t))
535 "Low level mailgroup face.")
537 (defface gnus-group-mail-low-empty-face
540 (:foreground "aquamarine4"))
543 (:foreground "DeepPink4"))
546 "Low level empty mailgroup face.")
548 ;; Summary mode faces.
550 (defface gnus-summary-selected-face '((t
552 "Face used for selected articles.")
554 (defface gnus-summary-cancelled-face
556 (:foreground "yellow" :background "black")))
557 "Face used for cancelled articles.")
559 (defface gnus-summary-high-ticked-face
562 (:foreground "pink" :bold t))
565 (:foreground "firebrick" :bold t))
568 "Face used for high interest ticked articles.")
570 (defface gnus-summary-low-ticked-face
573 (:foreground "pink" :italic t))
576 (:foreground "firebrick" :italic t))
579 "Face used for low interest ticked articles.")
581 (defface gnus-summary-normal-ticked-face
584 (:foreground "pink"))
587 (:foreground "firebrick"))
590 "Face used for normal interest ticked articles.")
592 (defface gnus-summary-high-ancient-face
595 (:foreground "SkyBlue" :bold t))
598 (:foreground "RoyalBlue" :bold t))
601 "Face used for high interest ancient articles.")
603 (defface gnus-summary-low-ancient-face
606 (:foreground "SkyBlue" :italic t))
609 (:foreground "RoyalBlue" :italic t))
612 "Face used for low interest ancient articles.")
614 (defface gnus-summary-normal-ancient-face
617 (:foreground "SkyBlue"))
620 (:foreground "RoyalBlue"))
623 "Face used for normal interest ancient articles.")
625 (defface gnus-summary-high-unread-face
628 "Face used for high interest unread articles.")
630 (defface gnus-summary-low-unread-face
633 "Face used for low interest unread articles.")
635 (defface gnus-summary-normal-unread-face
638 "Face used for normal interest unread articles.")
640 (defface gnus-summary-high-read-face
643 (:foreground "PaleGreen"
647 (:foreground "DarkGreen"
651 "Face used for high interest read articles.")
653 (defface gnus-summary-low-read-face
656 (:foreground "PaleGreen"
660 (:foreground "DarkGreen"
664 "Face used for low interest read articles.")
666 (defface gnus-summary-normal-read-face
669 (:foreground "PaleGreen"))
672 (:foreground "DarkGreen"))
675 "Face used for normal interest read articles.")
682 (defvar gnus-buffers nil)
684 (defun gnus-get-buffer-create (name)
685 "Do the same as `get-buffer-create', but store the created buffer."
686 (or (get-buffer name)
687 (car (push (get-buffer-create name) gnus-buffers))))
689 (defun gnus-add-buffer ()
690 "Add the current buffer to the list of Gnus buffers."
691 (push (current-buffer) gnus-buffers))
693 (defun gnus-buffers ()
694 "Return a list of live Gnus buffers."
695 (while (and gnus-buffers
696 (not (buffer-name (car gnus-buffers))))
698 (let ((buffers gnus-buffers))
700 (if (buffer-name (cadr buffers))
702 (setcdr buffers (cddr buffers)))))
707 (defvar gnus-group-buffer "*Group*")
710 (autoload 'gnus-play-jingle "gnus-audio"))
712 (defface gnus-splash-face
715 (:foreground "Brown"))
718 (:foreground "Brown"))
721 "Face of the splash screen.")
723 (defun gnus-splash ()
725 (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer))
726 (let ((buffer-read-only nil))
728 (unless gnus-inhibit-startup-message
729 (gnus-group-startup-message)
731 (when gnus-play-startup-jingle
732 (gnus-play-jingle))))))
734 (defun gnus-indent-rigidly (start end arg)
735 "Indent rigidly using only spaces and no tabs."
738 (narrow-to-region start end)
740 (indent-rigidly start end arg)
741 ;; We translate tabs into spaces -- not everybody uses
742 ;; an 8-character tab.
743 (goto-char (point-min))
744 (while (search-forward "\t" nil t)
745 (replace-match " " t t))))))
747 (defvar gnus-simple-splash nil)
749 (defun gnus-group-startup-message (&optional x y)
750 "Insert startup message in current buffer."
751 ;; Insert the message.
756 _ ___ __ ___ __ _ ___