2001-01-30 10:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
[gnus] / lisp / gnus-art.el
1 ;;; gnus-art.el --- article mode commands for Gnus
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
3 ;;        Free Software Foundation, Inc.
4
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Keywords: news
7
8 ;; This file is part of GNU Emacs.
9
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)
13 ;; any later version.
14
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.
19
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.
24
25 ;;; Commentary:
26
27 ;;; Code:
28
29 (eval-when-compile (require 'cl))
30
31 (require 'gnus)
32 (require 'gnus-sum)
33 (require 'gnus-spec)
34 (require 'gnus-int)
35 (require 'mm-bodies)
36 (require 'mail-parse)
37 (require 'mm-decode)
38 (require 'mm-view)
39 (require 'wid-edit)
40 (require 'mm-uu)
41
42 (autoload 'gnus-msg-mail "gnus-msg" nil t)
43 (autoload 'gnus-button-mailto "gnus-msg")
44 (autoload 'gnus-button-reply "gnus-msg" nil t)
45
46 (defgroup gnus-article nil
47   "Article display."
48   :link '(custom-manual "(gnus)The Article Buffer")
49   :group 'gnus)
50
51 (defgroup gnus-article-treat nil
52   "Treating article parts."
53   :link '(custom-manual "(gnus)Article Hiding")
54   :group 'gnus-article)
55
56 (defgroup gnus-article-hiding nil
57   "Hiding article parts."
58   :link '(custom-manual "(gnus)Article Hiding")
59   :group 'gnus-article)
60
61 (defgroup gnus-article-highlight nil
62   "Article highlighting."
63   :link '(custom-manual "(gnus)Article Highlighting")
64   :group 'gnus-article
65   :group 'gnus-visual)
66
67 (defgroup gnus-article-signature nil
68   "Article signatures."
69   :link '(custom-manual "(gnus)Article Signature")
70   :group 'gnus-article)
71
72 (defgroup gnus-article-headers nil
73   "Article headers."
74   :link '(custom-manual "(gnus)Hiding Headers")
75   :group 'gnus-article)
76
77 (defgroup gnus-article-washing nil
78   "Special commands on articles."
79   :link '(custom-manual "(gnus)Article Washing")
80   :group 'gnus-article)
81
82 (defgroup gnus-article-emphasis nil
83   "Fontisizing articles."
84   :link '(custom-manual "(gnus)Article Fontisizing")
85   :group 'gnus-article)
86
87 (defgroup gnus-article-saving nil
88   "Saving articles."
89   :link '(custom-manual "(gnus)Saving Articles")
90   :group 'gnus-article)
91
92 (defgroup gnus-article-mime nil
93   "Worshiping the MIME wonder."
94   :link '(custom-manual "(gnus)Using MIME")
95   :group 'gnus-article)
96
97 (defgroup gnus-article-buttons nil
98   "Pushable buttons in the article buffer."
99   :link '(custom-manual "(gnus)Article Buttons")
100   :group 'gnus-article)
101
102 (defgroup gnus-article-various nil
103   "Other article options."
104   :link '(custom-manual "(gnus)Misc Article")
105   :group 'gnus-article)
106
107 (defcustom gnus-ignored-headers
108   '("^Path:" "^Expires:" "^Date-Received:" "^References:" "^Xref:" "^Lines:"
109     "^Relay-Version:" "^Message-ID:" "^Approved:" "^Sender:" "^Received:"
110     "^X-UIDL:" "^MIME-Version:" "^Return-Path:" "^In-Reply-To:"
111     "^Content-Type:" "^Content-Transfer-Encoding:" "^X-WebTV-Signature:"
112     "^X-MimeOLE:" "^X-MSMail-Priority:" "^X-Priority:" "^X-Loop:"
113     "^X-Authentication-Warning:" "^X-MIME-Autoconverted:" "^X-Face:"
114     "^X-Attribution:" "^X-Originating-IP:" "^Delivered-To:"
115     "^NNTP-[-A-Za-z]+:" "^Distribution:" "^X-no-archive:" "^X-Trace:"
116     "^X-Complaints-To:" "^X-NNTP-Posting-Host:" "^X-Orig.*:"
117     "^Abuse-Reports-To:" "^Cache-Post-Path:" "^X-Article-Creation-Date:"
118     "^X-Poster:" "^X-Mail2News-Path:" "^X-Server-Date:" "^X-Cache:"
119     "^Originator:" "^X-Problems-To:" "^X-Auth-User:" "^X-Post-Time:"
120     "^X-Admin:" "^X-UID:" "^Resent-[-A-Za-z]+:" "^X-Mailing-List:"
121     "^Precedence:" "^Original-[-A-Za-z]+:" "^X-filename:" "^X-Orcpt:"
122     "^Old-Received:" "^X-Pgp" "^X-Auth:" "^X-From-Line:"
123     "^X-Gnus-Article-Number:" "^X-Majordomo:" "^X-Url:" "^X-Sender:"
124     "^MBOX-Line" "^Priority:" "^X400-[-A-Za-z]+:"
125     "^Status:" "^X-Gnus-Mail-Source:" "^Cancel-Lock:"
126     "^X-FTN" "^X-EXP32-SerialNo:" "^Encoding:" "^Importance:"
127     "^Autoforwarded:" "^Original-Encoded-Information-Types:" "^X-Ya-Pop3:"
128     "^X-Face-Version:" "^X-Vms-To:" "^X-ML-NAME:" "^X-ML-COUNT:"
129     "^Mailing-List:" "^X-finfo:" "^X-md5sum:" "^X-md5sum-Origin:"
130     "^X-Sun-Charset:" "^X-Accept-Language:" "^X-Envelope-Sender:"
131     "^List-[A-Za-z]+:" "^X-Listprocessor-Version:"
132     "^X-Received:" "^X-Distribute:" "^X-Sequence:" "^X-Juno-Line-Breaks:"
133     "^X-Notes-Item:" "^X-MS-TNEF-Correlator:" "^x-uunet-gateway:"
134     "^X-Received:" "^Content-length:" "X-precedence:"
135     "^X-Authenticated-User:" "^X-Comment" "^X-Report:" "^X-Abuse-Info:"
136     "^X-HTTP-Proxy:" "^X-Mydeja-Info:" "^X-Copyright" "^X-No-Markup:"
137     "^X-Abuse-Info:")
138   "*All headers that start with this regexp will be hidden.
139 This variable can also be a list of regexps of headers to be ignored.
140 If `gnus-visible-headers' is non-nil, this variable will be ignored."
141   :type '(choice :custom-show nil
142                  regexp
143                  (repeat regexp))
144   :group 'gnus-article-hiding)
145
146 (defcustom gnus-visible-headers
147   "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^[BGF]?Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Mail-Followup-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-From:\\|^X-Sent:"
148   "*All headers that do not match this regexp will be hidden.
149 This variable can also be a list of regexp of headers to remain visible.
150 If this variable is non-nil, `gnus-ignored-headers' will be ignored."
151   :type '(repeat :value-to-internal (lambda (widget value)
152                                       (custom-split-regexp-maybe value))
153                  :match (lambda (widget value)
154                           (or (stringp value)
155                               (widget-editable-list-match widget value)))
156                  regexp)
157   :group 'gnus-article-hiding)
158
159 (defcustom gnus-sorted-header-list
160   '("^From:" "^Subject:" "^Summary:" "^Keywords:" "^Newsgroups:"
161     "^Followup-To:" "^To:" "^Cc:" "^Date:" "^Organization:")
162   "*This variable is a list of regular expressions.
163 If it is non-nil, headers that match the regular expressions will
164 be placed first in the article buffer in the sequence specified by
165 this list."
166   :type '(repeat regexp)
167   :group 'gnus-article-hiding)
168
169 (defcustom gnus-boring-article-headers '(empty followup-to reply-to)
170   "Headers that are only to be displayed if they have interesting data.
171 Possible values in this list are `empty', `newsgroups', `followup-to',
172 `to-address', `reply-to', `date', `long-to', and `many-to'."
173   :type '(set (const :tag "Headers with no content." empty)
174               (const :tag "Newsgroups with only one group." newsgroups)
175               (const :tag "To identical to to-address." to-address)
176               (const :tag "Followup-to identical to newsgroups." followup-to)
177               (const :tag "Reply-to identical to from." reply-to)
178               (const :tag "Date less than four days old." date)
179               (const :tag "Very long To and/or Cc header." long-to)
180               (const :tag "Multiple To and/or Cc headers." many-to))
181   :group 'gnus-article-hiding)
182
183 (defcustom gnus-signature-separator '("^-- $" "^-- *$")
184   "Regexp matching signature separator.
185 This can also be a list of regexps.  In that case, it will be checked
186 from head to tail looking for a separator.  Searches will be done from
187 the end of the buffer."
188   :type '(repeat string)
189   :group 'gnus-article-signature)
190
191 (defcustom gnus-signature-limit nil
192   "Provide a limit to what is considered a signature.
193 If it is a number, no signature may not be longer (in characters) than
194 that number.  If it is a floating point number, no signature may be
195 longer (in lines) than that number.  If it is a function, the function
196 will be called without any parameters, and if it returns nil, there is
197 no signature in the buffer.  If it is a string, it will be used as a
198 regexp.  If it matches, the text in question is not a signature."
199   :type '(choice (integer :value 200)
200                  (number :value 4.0)
201                  (function :value fun)
202                  (regexp :value ".*"))
203   :group 'gnus-article-signature)
204
205 (defcustom gnus-hidden-properties '(invisible t intangible t)
206   "Property list to use for hiding text."
207   :type 'sexp
208   :group 'gnus-article-hiding)
209
210 ;; Fixme: This isn't the right thing for mixed graphical and and
211 ;; non-graphical frames in a session.
212 ;; gnus-xmas.el overrides this for XEmacs.
213 (defcustom gnus-article-x-face-command
214   (if (and (fboundp 'image-type-available-p)
215            (image-type-available-p 'xbm))
216       'gnus-article-display-xface
217     (if gnus-article-compface-xbm
218         "{ echo '/* Width=48, Height=48 */'; uncompface; } | display -"
219       "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | \
220 display -"))
221   "*String or function to be executed to display an X-Face header.
222 If it is a string, the command will be executed in a sub-shell
223 asynchronously.  The compressed face will be piped to this command."
224   :type '(choice string
225                  (function-item gnus-article-display-xface)
226                  function)
227   :group 'gnus-article-washing)
228
229 (defcustom gnus-article-x-face-too-ugly nil
230   "Regexp matching posters whose face shouldn't be shown automatically."
231   :type '(choice regexp (const nil))
232   :group 'gnus-article-washing)
233
234 (defcustom gnus-article-banner-alist nil
235   "Banner alist for stripping.
236 For example,
237      ((egroups . \"^[ \\t\\n]*-------------------+\\\\( \\\\(e\\\\|Yahoo! \\\\)Groups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))"
238   :version "21.1"
239   :type '(repeat (cons symbol regexp))
240   :group 'gnus-article-washing)
241
242 (gnus-define-group-parameter
243  banner
244  :variable-document
245  "Alist of regexps (to match group names) and banner."
246  :variable-group gnus-article-washing
247  :parameter-type
248  '(choice :tag "Banner"
249           :value nil
250           (const :tag "Remove signature" signature)
251           (symbol :tag "Item in `gnus-article-banner-alist'" none)
252           regexp
253           (const :tag "None" nil))
254  :parameter-document
255  "If non-nil, specify how to remove `banners' from articles.
256
257 Symbol `signature' means to remove signatures delimited by
258 `gnus-signature-separator'.  Any other symbol is used to look up a
259 regular expression to match the banner in `gnus-article-banner-alist'.
260 A string is used as a regular expression to match the banner
261 directly.")
262
263 (defcustom gnus-emphasis-alist
264   (let ((format
265          "\\(\\s-\\|^\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\s-\\|[-,;:\"]\\s-\\|[?!.]+\\s-\\|\\s)\\)")
266         (types
267          '(("_" "_" underline)
268            ("/" "/" italic)
269            ("\\*" "\\*" bold)
270            ("_/" "/_" underline-italic)
271            ("_\\*" "\\*_" underline-bold)
272            ("\\*/" "/\\*" bold-italic)
273            ("_\\*/" "/\\*_" underline-bold-italic))))
274     `(("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)"
275        2 3 gnus-emphasis-underline)
276       ,@(mapcar
277          (lambda (spec)
278            (list
279             (format format (car spec) (cadr spec))
280             2 3 (intern (format "gnus-emphasis-%s" (nth 2 spec)))))
281          types)))
282   "*Alist that says how to fontify certain phrases.
283 Each item looks like this:
284
285   (\"_\\\\(\\\\w+\\\\)_\" 0 1 'underline)
286
287 The first element is a regular expression to be matched.  The second
288 is a number that says what regular expression grouping used to find
289 the entire emphasized word.  The third is a number that says what
290 regexp grouping should be displayed and highlighted.  The fourth
291 is the face used for highlighting."
292   :type '(repeat (list :value ("" 0 0 default)
293                        regexp
294                        (integer :tag "Match group")
295                        (integer :tag "Emphasize group")
296                        face))
297   :group 'gnus-article-emphasis)
298
299 (defcustom gnus-emphasize-whitespace-regexp "^[ \t]+\\|[ \t]*\n"
300   "A regexp to describe whitespace which should not be emphasized.
301 Typical values are \"^[ \\t]+\\\\|[ \\t]*\\n\" and \"[ \\t]+\\\\|[ \\t]*\\n\".
302 The former avoids underlining of leading and trailing whitespace,
303 and the latter avoids underlining any whitespace at all."
304   :version "21.1"
305   :group 'gnus-article-emphasis
306   :type 'regexp)
307
308 (defface gnus-emphasis-bold '((t (:bold t)))
309   "Face used for displaying strong emphasized text (*word*)."
310   :group 'gnus-article-emphasis)
311
312 (defface gnus-emphasis-italic '((t (:italic t)))
313   "Face used for displaying italic emphasized text (/word/)."
314   :group 'gnus-article-emphasis)
315
316 (defface gnus-emphasis-underline '((t (:underline t)))
317   "Face used for displaying underlined emphasized text (_word_)."
318   :group 'gnus-article-emphasis)
319
320 (defface gnus-emphasis-underline-bold '((t (:bold t :underline t)))
321   "Face used for displaying underlined bold emphasized text (_*word*_)."
322   :group 'gnus-article-emphasis)
323
324 (defface gnus-emphasis-underline-italic '((t (:italic t :underline t)))
325   "Face used for displaying underlined italic emphasized text (_/word/_)."
326   :group 'gnus-article-emphasis)
327
328 (defface gnus-emphasis-bold-italic '((t (:bold t :italic t)))
329   "Face used for displaying bold italic emphasized text (/*word*/)."
330   :group 'gnus-article-emphasis)
331
332 (defface gnus-emphasis-underline-bold-italic
333   '((t (:bold t :italic t :underline t)))
334   "Face used for displaying underlined bold italic emphasized text.
335 Esample: (_/*word*/_)."
336   :group 'gnus-article-emphasis)
337
338 (defface gnus-emphasis-highlight-words
339   '((t (:background "black" :foreground "yellow")))
340   "Face used for displaying highlighted words."
341   :group 'gnus-article-emphasis)
342
343 (defcustom gnus-article-time-format "%a, %b %d %Y %T %Z"
344   "Format for display of Date headers in article bodies.
345 See `format-time-string' for the possible values.
346
347 The variable can also be function, which should return a complete Date
348 header.  The function is called with one argument, the time, which can
349 be fed to `format-time-string'."
350   :type '(choice string symbol)
351   :link '(custom-manual "(gnus)Article Date")
352   :group 'gnus-article-washing)
353
354 (eval-and-compile
355   (autoload 'mail-extract-address-components "mail-extr"))
356
357 (defcustom gnus-save-all-headers t
358   "*If non-nil, don't remove any headers before saving."
359   :group 'gnus-article-saving
360   :type 'boolean)
361
362 (defcustom gnus-prompt-before-saving 'always
363   "*This variable says how much prompting is to be done when saving articles.
364 If it is nil, no prompting will be done, and the articles will be
365 saved to the default files.  If this variable is `always', each and
366 every article that is saved will be preceded by a prompt, even when
367 saving large batches of articles.  If this variable is neither nil not
368 `always', there the user will be prompted once for a file name for
369 each invocation of the saving commands."
370   :group 'gnus-article-saving
371   :type '(choice (item always)
372                  (item :tag "never" nil)
373                  (sexp :tag "once" :format "%t\n" :value t)))
374
375 (defcustom gnus-saved-headers gnus-visible-headers
376   "Headers to keep if `gnus-save-all-headers' is nil.
377 If `gnus-save-all-headers' is non-nil, this variable will be ignored.
378 If that variable is nil, however, all headers that match this regexp
379 will be kept while the rest will be deleted before saving."
380   :group 'gnus-article-saving
381   :type 'regexp)
382
383 (defcustom gnus-default-article-saver 'gnus-summary-save-in-rmail
384   "A function to save articles in your favourite format.
385 The function must be interactively callable (in other words, it must
386 be an Emacs command).
387
388 Gnus provides the following functions:
389
390 * gnus-summary-save-in-rmail (Rmail format)
391 * gnus-summary-save-in-mail (Unix mail format)
392 * gnus-summary-save-in-folder (MH folder)
393 * gnus-summary-save-in-file (article format)
394 * gnus-summary-save-in-vm (use VM's folder format)
395 * gnus-summary-write-to-file (article format -- overwrite)."
396   :group 'gnus-article-saving
397   :type '(radio (function-item gnus-summary-save-in-rmail)
398                 (function-item gnus-summary-save-in-mail)
399                 (function-item gnus-summary-save-in-folder)
400                 (function-item gnus-summary-save-in-file)
401                 (function-item gnus-summary-save-in-vm)
402                 (function-item gnus-summary-write-to-file)))
403
404 (defcustom gnus-rmail-save-name 'gnus-plain-save-name
405   "A function generating a file name to save articles in Rmail format.
406 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE."
407   :group 'gnus-article-saving
408   :type 'function)
409
410 (defcustom gnus-mail-save-name 'gnus-plain-save-name
411   "A function generating a file name to save articles in Unix mail format.
412 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE."
413   :group 'gnus-article-saving
414   :type 'function)
415
416 (defcustom gnus-folder-save-name 'gnus-folder-save-name
417   "A function generating a file name to save articles in MH folder.
418 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER."
419   :group 'gnus-article-saving
420   :type 'function)
421
422 (defcustom gnus-file-save-name 'gnus-numeric-save-name
423   "A function generating a file name to save articles in article format.
424 The function is called with NEWSGROUP, HEADERS, and optional
425 LAST-FILE."
426   :group 'gnus-article-saving
427   :type 'function)
428
429 (defcustom gnus-split-methods
430   '((gnus-article-archive-name)
431     (gnus-article-nndoc-name))
432   "*Variable used to suggest where articles are to be saved.
433 For instance, if you would like to save articles related to Gnus in
434 the file \"gnus-stuff\", and articles related to VM in \"vm-stuff\",
435 you could set this variable to something like:
436
437  '((\"^Subject:.*gnus\\|^Newsgroups:.*gnus\" \"gnus-stuff\")
438    (\"^Subject:.*vm\\|^Xref:.*vm\" \"vm-stuff\"))
439
440 This variable is an alist where the where the key is the match and the
441 value is a list of possible files to save in if the match is non-nil.
442
443 If the match is a string, it is used as a regexp match on the
444 article.  If the match is a symbol, that symbol will be funcalled
445 from the buffer of the article to be saved with the newsgroup as the
446 parameter.  If it is a list, it will be evaled in the same buffer.
447
448 If this form or function returns a string, this string will be used as
449 a possible file name; and if it returns a non-nil list, that list will
450 be used as possible file names."
451   :group 'gnus-article-saving
452   :type '(repeat (choice (list :value (fun) function)
453                          (cons :value ("" "") regexp (repeat string))
454                          (sexp :value nil))))
455
456 (defcustom gnus-page-delimiter "^\^L"
457   "*Regexp describing what to use as article page delimiters.
458 The default value is \"^\^L\", which is a form linefeed at the
459 beginning of a line."
460   :type 'regexp
461   :group 'gnus-article-various)
462
463 (defcustom gnus-article-mode-line-format "Gnus: %g [%w] %S%m"
464   "*The format specification for the article mode line.
465 See `gnus-summary-mode-line-format' for a closer description.
466
467 The following additional specs are available:
468
469 %w  The article washing status.
470 %m  The number of MIME parts in the article."
471   :type 'string
472   :group 'gnus-article-various)
473
474 (defcustom gnus-article-mode-hook nil
475   "*A hook for Gnus article mode."
476   :type 'hook
477   :group 'gnus-article-various)
478
479 (when (featurep 'xemacs)
480   ;; Extracted from gnus-xmas-define in order to preserve user settings
481   (when (fboundp 'turn-off-scroll-in-place)
482     (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place))
483   ;; Extracted from gnus-xmas-redefine in order to preserve user settings
484   (add-hook 'gnus-article-mode-hook 'gnus-xmas-article-menu-add))
485
486 (defcustom gnus-article-menu-hook nil
487   "*Hook run after the creation of the article mode menu."
488   :type 'hook
489   :group 'gnus-article-various)
490
491 (defcustom gnus-article-prepare-hook nil
492   "*A hook called after an article has been prepared in the article buffer."
493   :type 'hook
494   :group 'gnus-article-various)
495
496 (defcustom gnus-article-hide-pgp-hook nil
497   "*A hook called after successfully hiding a PGP signature."
498   :type 'hook
499   :group 'gnus-article-various)
500
501 (defcustom gnus-article-button-face 'bold
502   "Face used for highlighting buttons in the article buffer.
503
504 An article button is a piece of text that you can activate by pressing
505 `RET' or `mouse-2' above it."
506   :type 'face
507   :group 'gnus-article-buttons)
508
509 (defcustom gnus-article-mouse-face 'highlight
510   "Face used for mouse highlighting in the article buffer.
511
512 Article buttons will be displayed in this face when the cursor is
513 above them."
514   :type 'face
515   :group 'gnus-article-buttons)
516
517 (defcustom gnus-signature-face 'gnus-signature-face
518   "Face used for highlighting a signature in the article buffer.
519 Obsolete; use the face `gnus-signature-face' for customizations instead."
520   :type 'face
521   :group 'gnus-article-highlight
522   :group 'gnus-article-signature)
523
524 (defface gnus-signature-face
525   '((t
526      (:italic t)))
527   "Face used for highlighting a signature in the article buffer."
528   :group 'gnus-article-highlight
529   :group 'gnus-article-signature)
530
531 (defface gnus-header-from-face
532   '((((class color)
533       (background dark))
534      (:foreground "spring green"))
535     (((class color)
536       (background light))
537      (:foreground "red3"))
538     (t
539      (:italic t)))
540   "Face used for displaying from headers."
541   :group 'gnus-article-headers
542   :group 'gnus-article-highlight)
543
544 (defface gnus-header-subject-face
545   '((((class color)
546       (background dark))
547      (:foreground "SeaGreen3"))
548     (((class color)
549       (background light))
550      (:foreground "red4"))
551     (t
552      (:bold t :italic t)))
553   "Face used for displaying subject headers."
554   :group 'gnus-article-headers
555   :group 'gnus-article-highlight)
556
557 (defface gnus-header-newsgroups-face
558   '((((class color)
559       (background dark))
560      (:foreground "yellow" :italic t))
561     (((class color)
562       (background light))
563      (:foreground "MidnightBlue" :italic t))
564     (t
565      (:italic t)))
566   "Face used for displaying newsgroups headers."
567   :group 'gnus-article-headers
568   :group 'gnus-article-highlight)
569
570 (defface gnus-header-name-face
571   '((((class color)
572       (background dark))
573      (:foreground "SeaGreen"))
574     (((class color)
575       (background light))
576      (:foreground "maroon"))
577     (t
578      (:bold t)))
579   "Face used for displaying header names."
580   :group 'gnus-article-headers
581   :group 'gnus-article-highlight)
582
583 (defface gnus-header-content-face
584   '((((class color)
585       (background dark))
586      (:foreground "forest green" :italic t))
587     (((class color)
588       (background light))
589      (:foreground "indianred4" :italic t))
590     (t
591      (:italic t)))  "Face used for displaying header content."
592   :group 'gnus-article-headers
593   :group 'gnus-article-highlight)
594
595 (defcustom gnus-header-face-alist
596   '(("From" nil gnus-header-from-face)
597     ("Subject" nil gnus-header-subject-face)
598     ("Newsgroups:.*," nil gnus-header-newsgroups-face)
599     ("" gnus-header-name-face gnus-header-content-face))
600   "*Controls highlighting of article header.
601
602 An alist of the form (HEADER NAME CONTENT).
603
604 HEADER is a regular expression which should match the name of an
605 header header and NAME and CONTENT are either face names or nil.
606
607 The name of each header field will be displayed using the face
608 specified by the first element in the list where HEADER match the
609 header name and NAME is non-nil.  Similarly, the content will be
610 displayed by the first non-nil matching CONTENT face."
611   :group 'gnus-article-headers
612   :group 'gnus-article-highlight
613   :type '(repeat (list (regexp :tag "Header")
614                        (choice :tag "Name"
615                                (item :tag "skip" nil)
616                                (face :value default))
617                        (choice :tag "Content"
618                                (item :tag "skip" nil)
619                                (face :value default)))))
620
621 (defcustom gnus-article-decode-hook
622   '(article-decode-charset article-decode-encoded-words)
623   "*Hook run to decode charsets in articles."
624   :group 'gnus-article-headers
625   :type 'hook)
626
627 (defcustom gnus-display-mime-function 'gnus-display-mime
628   "Function to display MIME articles."
629   :group 'gnus-article-mime
630   :type 'function)
631
632 (defvar gnus-decode-header-function 'mail-decode-encoded-word-region
633   "Function used to decode headers.")
634
635 (defvar gnus-article-dumbquotes-map
636   '(("\200" "EUR")
637     ("\202" ",")
638     ("\203" "f")
639     ("\204" ",,")
640     ("\205" "...")
641     ("\213" "<")
642     ("\214" "OE")
643     ("\221" "`")
644     ("\222" "'")
645     ("\223" "``")
646     ("\224" "\"")
647     ("\225" "*")
648     ("\226" "-")
649     ("\227" "--")
650     ("\231" "(TM)")
651     ("\233" ">")
652     ("\234" "oe")
653     ("\264" "'"))
654   "Table for MS-to-Latin1 translation.")
655
656 (defcustom gnus-ignored-mime-types nil
657   "List of MIME types that should be ignored by Gnus."
658   :version "21.1"
659   :group 'gnus-article-mime
660   :type '(repeat regexp))
661
662 (defcustom gnus-unbuttonized-mime-types '(".*/.*")
663   "List of MIME types that should not be given buttons when rendered inline."
664   :version "21.1"
665   :group 'gnus-article-mime
666   :type '(repeat regexp))
667
668 (defcustom gnus-article-mime-part-function nil
669   "Function called with a MIME handle as the argument.
670 This is meant for people who want to do something automatic based
671 on parts -- for instance, adding Vcard info to a database."
672   :group 'gnus-article-mime
673   :type 'function)
674
675 (defcustom gnus-mime-multipart-functions nil
676   "An alist of MIME types to functions to display them."
677   :version "21.1"
678   :group 'gnus-article-mime
679   :type 'alist)
680
681 (defcustom gnus-article-date-lapsed-new-header nil
682   "Whether the X-Sent and Date headers can coexist.
683 When using `gnus-treat-date-lapsed', the \"X-Sent:\" header will
684 either replace the old \"Date:\" header (if this variable is nil), or
685 be added below it (otherwise)."
686   :version "21.1"
687   :group 'gnus-article-headers
688   :type 'boolean)
689
690 (defcustom gnus-article-mime-match-handle-function 'undisplayed-alternative
691   "Function called with a MIME handle as the argument.
692 This is meant for people who want to view first matched part.
693 For `undisplayed-alternative' (default), the first undisplayed
694 part or alternative part is used.  For `undisplayed', the first
695 undisplayed part is used.  For a function, the first part which
696 the function return `t' is used.  For `nil', the first part is
697 used."
698   :version "21.1"
699   :group 'gnus-article-mime
700   :type '(choice
701           (item :tag "first" :value nil)
702           (item :tag "undisplayed" :value undisplayed)
703           (item :tag "undisplayed or alternative"
704                 :value undisplayed-alternative)
705           (function)))
706
707 (defcustom gnus-mime-action-alist
708   '(("save to file" . gnus-mime-save-part)
709     ("save and strip" . gnus-mime-save-part-and-strip)
710     ("display as text" . gnus-mime-inline-part)
711     ("view the part" . gnus-mime-view-part)
712     ("pipe to command" . gnus-mime-pipe-part)
713     ("toggle display" . gnus-article-press-button)
714     ("toggle display" . gnus-article-view-part-as-charset)
715     ("view as type" . gnus-mime-view-part-as-type)
716     ("internalize type" . gnus-mime-internalize-part)
717     ("externalize type" . gnus-mime-externalize-part))
718   "An alist of actions that run on the MIME attachment."
719   :group 'gnus-article-mime
720   :type '(repeat (cons (string :tag "name")
721                        (function))))
722
723 (defcustom gnus-mime-action-alist
724   '(("save to file" . gnus-mime-save-part)
725     ("display as text" . gnus-mime-inline-part)
726     ("view the part" . gnus-mime-view-part)
727     ("pipe to command" . gnus-mime-pipe-part)
728     ("toggle display" . gnus-article-press-button)