gnus-art.el 251 KB
Newer Older
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
1
;;; gnus-art.el --- article mode commands for Gnus
2 3
;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
;;        Free Software Foundation, Inc.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
4

5
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
;; Keywords: news

;; This file is part of GNU Emacs.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;;; Code:

29 30 31
(eval-when-compile
  (require 'cl)
  (defvar tool-bar-map))
32

Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
33 34 35 36
(require 'gnus)
(require 'gnus-sum)
(require 'gnus-spec)
(require 'gnus-int)
37
(require 'gnus-win)
38 39 40 41 42 43
(require 'mm-bodies)
(require 'mail-parse)
(require 'mm-decode)
(require 'mm-view)
(require 'wid-edit)
(require 'mm-uu)
44 45 46 47 48
(require 'message)

(autoload 'gnus-msg-mail "gnus-msg" nil t)
(autoload 'gnus-button-mailto "gnus-msg")
(autoload 'gnus-button-reply "gnus-msg" nil t)
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
49 50 51

(defgroup gnus-article nil
  "Article display."
52
  :link '(custom-manual "(gnus)Article Buffer")
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
53 54
  :group 'gnus)

55 56 57 58 59
(defgroup gnus-article-treat nil
  "Treating article parts."
  :link '(custom-manual "(gnus)Article Hiding")
  :group 'gnus-article)

Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
(defgroup gnus-article-hiding nil
  "Hiding article parts."
  :link '(custom-manual "(gnus)Article Hiding")
  :group 'gnus-article)

(defgroup gnus-article-highlight nil
  "Article highlighting."
  :link '(custom-manual "(gnus)Article Highlighting")
  :group 'gnus-article
  :group 'gnus-visual)

(defgroup gnus-article-signature nil
  "Article signatures."
  :link '(custom-manual "(gnus)Article Signature")
  :group 'gnus-article)

(defgroup gnus-article-headers nil
  "Article headers."
  :link '(custom-manual "(gnus)Hiding Headers")
  :group 'gnus-article)

(defgroup gnus-article-washing nil
  "Special commands on articles."
  :link '(custom-manual "(gnus)Article Washing")
  :group 'gnus-article)

(defgroup gnus-article-emphasis nil
  "Fontisizing articles."
  :link '(custom-manual "(gnus)Article Fontisizing")
  :group 'gnus-article)

(defgroup gnus-article-saving nil
  "Saving articles."
  :link '(custom-manual "(gnus)Saving Articles")
  :group 'gnus-article)

(defgroup gnus-article-mime nil
  "Worshiping the MIME wonder."
  :link '(custom-manual "(gnus)Using MIME")
  :group 'gnus-article)

(defgroup gnus-article-buttons nil
  "Pushable buttons in the article buffer."
  :link '(custom-manual "(gnus)Article Buttons")
  :group 'gnus-article)

(defgroup gnus-article-various nil
  "Other article options."
  :link '(custom-manual "(gnus)Misc Article")
  :group 'gnus-article)

(defcustom gnus-ignored-headers
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
  (mapcar
   (lambda (header)
     (concat "^" header ":"))
   '("Path" "Expires" "Date-Received" "References" "Xref" "Lines"
     "Relay-Version" "Message-ID" "Approved" "Sender" "Received"
     "X-UIDL" "MIME-Version" "Return-Path" "In-Reply-To"
     "Content-Type" "Content-Transfer-Encoding" "X-WebTV-Signature"
     "X-MimeOLE" "X-MSMail-Priority" "X-Priority" "X-Loop"
     "X-Authentication-Warning" "X-MIME-Autoconverted" "X-Face"
     "X-Attribution" "X-Originating-IP" "Delivered-To"
     "NNTP-[-A-Za-z]+" "Distribution" "X-no-archive" "X-Trace"
     "X-Complaints-To" "X-NNTP-Posting-Host" "X-Orig.*"
     "Abuse-Reports-To" "Cache-Post-Path" "X-Article-Creation-Date"
     "X-Poster" "X-Mail2News-Path" "X-Server-Date" "X-Cache"
     "Originator" "X-Problems-To" "X-Auth-User" "X-Post-Time"
     "X-Admin" "X-UID" "Resent-[-A-Za-z]+" "X-Mailing-List"
     "Precedence" "Original-[-A-Za-z]+" "X-filename" "X-Orcpt"
     "Old-Received" "X-Pgp" "X-Auth" "X-From-Line"
     "X-Gnus-Article-Number" "X-Majordomo" "X-Url" "X-Sender"
     "MBOX-Line" "Priority" "X400-[-A-Za-z]+"
     "Status" "X-Gnus-Mail-Source" "Cancel-Lock"
     "X-FTN" "X-EXP32-SerialNo" "Encoding" "Importance"
     "Autoforwarded" "Original-Encoded-Information-Types" "X-Ya-Pop3"
     "X-Face-Version" "X-Vms-To" "X-ML-NAME" "X-ML-COUNT"
     "Mailing-List" "X-finfo" "X-md5sum" "X-md5sum-Origin"
     "X-Sun-Charset" "X-Accept-Language" "X-Envelope-Sender"
     "List-[A-Za-z]+" "X-Listprocessor-Version"
     "X-Received" "X-Distribute" "X-Sequence" "X-Juno-Line-Breaks"
     "X-Notes-Item" "X-MS-TNEF-Correlator" "x-uunet-gateway"
     "X-Received" "Content-length" "X-precedence"
     "X-Authenticated-User" "X-Comment" "X-Report" "X-Abuse-Info"
     "X-HTTP-Proxy" "X-Mydeja-Info" "X-Copyright" "X-No-Markup"
     "X-Abuse-Info" "X-From_" "X-Accept-Language" "Errors-To"
     "X-BeenThere" "X-Mailman-Version" "List-Help" "List-Post"
     "List-Subscribe" "List-Id" "List-Unsubscribe" "List-Archive"
     "X-Content-length" "X-Posting-Agent" "Original-Received"
     "X-Request-PGP" "X-Fingerprint" "X-WRIEnvto" "X-WRIEnvfrom"
     "X-Virus-Scanned" "X-Delivery-Agent" "Posted-Date" "X-Gateway"
     "X-Local-Origin" "X-Local-Destination" "X-UserInfo1"
     "X-Received-Date" "X-Hashcash" "Face" "X-DMCA-Notifications"
     "X-Abuse-and-DMCA-Info" "X-Postfilter" "X-Gpg-.*" "X-Disclaimer"))
153
  "*All headers that start with this regexp will be hidden.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
154 155 156 157 158 159 160 161
This variable can also be a list of regexps of headers to be ignored.
If `gnus-visible-headers' is non-nil, this variable will be ignored."
  :type '(choice :custom-show nil
		 regexp
		 (repeat regexp))
  :group 'gnus-article-hiding)

(defcustom gnus-visible-headers
162
  "^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:"
163
  "*All headers that do not match this regexp will be hidden.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
164 165 166 167 168 169 170 171 172 173 174 175 176
This variable can also be a list of regexp of headers to remain visible.
If this variable is non-nil, `gnus-ignored-headers' will be ignored."
  :type '(repeat :value-to-internal (lambda (widget value)
				      (custom-split-regexp-maybe value))
		 :match (lambda (widget value)
			  (or (stringp value)
			      (widget-editable-list-match widget value)))
		 regexp)
  :group 'gnus-article-hiding)

(defcustom gnus-sorted-header-list
  '("^From:" "^Subject:" "^Summary:" "^Keywords:" "^Newsgroups:"
    "^Followup-To:" "^To:" "^Cc:" "^Date:" "^Organization:")
177
  "*This variable is a list of regular expressions.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
178 179 180 181 182 183 184 185
If it is non-nil, headers that match the regular expressions will
be placed first in the article buffer in the sequence specified by
this list."
  :type '(repeat regexp)
  :group 'gnus-article-hiding)

(defcustom gnus-boring-article-headers '(empty followup-to reply-to)
  "Headers that are only to be displayed if they have interesting data.
186 187 188 189 190 191 192 193 194 195 196 197
Possible values in this list are:

  'empty       Headers with no content.
  'newsgroups  Newsgroup identical to Gnus group.
  'to-address  To identical to To-address.
  'to-list     To identical to To-list.
  'cc-list     CC identical to To-list.
  'followup-to Followup-to identical to Newsgroups.
  'reply-to    Reply-to identical to From.
  'date        Date less than four days old.
  'long-to     To and/or Cc longer than 1024 characters.
  'many-to     Multiple To and/or Cc."
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
198
  :type '(set (const :tag "Headers with no content." empty)
199 200 201 202 203 204
	      (const :tag "Newsgroups identical to Gnus group." newsgroups)
	      (const :tag "To identical to To-address." to-address)
	      (const :tag "To identical to To-list." to-list)
	      (const :tag "CC identical to To-list." cc-list)
	      (const :tag "Followup-to identical to Newsgroups." followup-to)
	      (const :tag "Reply-to identical to From." reply-to)
205
	      (const :tag "Date less than four days old." date)
206
	      (const :tag "To and/or Cc longer than 1024 characters." long-to)
207
	      (const :tag "Multiple To and/or Cc headers." many-to))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
208 209
  :group 'gnus-article-hiding)

210 211 212 213 214 215
(defcustom gnus-article-skip-boring nil
  "Skip over text that is not worth reading.
By default, if you set this t, then Gnus will display citations and
signatures, but will never scroll down to show you a page consisting
only of boring text.  Boring text is controlled by
`gnus-article-boring-faces'."
216
  :version "21.4"
217 218 219
  :type 'boolean
  :group 'gnus-article-hiding)

Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
220 221 222 223 224 225 226 227 228
(defcustom gnus-signature-separator '("^-- $" "^-- *$")
  "Regexp matching signature separator.
This can also be a list of regexps.  In that case, it will be checked
from head to tail looking for a separator.  Searches will be done from
the end of the buffer."
  :type '(repeat string)
  :group 'gnus-article-signature)

(defcustom gnus-signature-limit nil
229
  "Provide a limit to what is considered a signature.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
230 231 232 233 234 235
If it is a number, no signature may not be longer (in characters) than
that number.  If it is a floating point number, no signature may be
longer (in lines) than that number.  If it is a function, the function
will be called without any parameters, and if it returns nil, there is
no signature in the buffer.  If it is a string, it will be used as a
regexp.  If it matches, the text in question is not a signature."
236 237 238 239
  :type '(choice (integer :value 200)
		 (number :value 4.0)
		 (function :value fun)
		 (regexp :value ".*"))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
240 241 242 243 244 245 246
  :group 'gnus-article-signature)

(defcustom gnus-hidden-properties '(invisible t intangible t)
  "Property list to use for hiding text."
  :type 'sexp
  :group 'gnus-article-hiding)

247 248
;; Fixme: This isn't the right thing for mixed graphical and non-graphical
;; frames in a session.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
249
(defcustom gnus-article-x-face-command
250 251 252 253 254 255 256
  (if (featurep 'xemacs)
      (if (or (gnus-image-type-available-p 'xface)
	      (gnus-image-type-available-p 'pbm))
	  'gnus-display-x-face-in-from
	"{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | ee -")
    (if (gnus-image-type-available-p 'pbm)
	'gnus-display-x-face-in-from
257 258
      "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | \
display -"))
259
  "*String or function to be executed to display an X-Face header.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
260 261
If it is a string, the command will be executed in a sub-shell
asynchronously.	 The compressed face will be piped to this command."
262 263
  :type `(choice string
		 (function-item gnus-display-x-face-in-from)
264
		 function)
Dave Love's avatar
Dave Love committed
265
  :version "21.1"
266
  :group 'gnus-picon
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
267 268 269 270
  :group 'gnus-article-washing)

(defcustom gnus-article-x-face-too-ugly nil
  "Regexp matching posters whose face shouldn't be shown automatically."
271
  :type '(choice regexp (const nil))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
272 273
  :group 'gnus-article-washing)

274 275
(defcustom gnus-article-banner-alist nil
  "Banner alist for stripping.
276
For example,
277
     ((egroups . \"^[ \\t\\n]*-------------------+\\\\( \\\\(e\\\\|Yahoo! \\\\)Groups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))"
Dave Love's avatar
Dave Love committed
278
  :version "21.1"
279 280 281
  :type '(repeat (cons symbol regexp))
  :group 'gnus-article-washing)

282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
(gnus-define-group-parameter
 banner
 :variable-document
 "Alist of regexps (to match group names) and banner."
 :variable-group gnus-article-washing
 :parameter-type
 '(choice :tag "Banner"
	  :value nil
	  (const :tag "Remove signature" signature)
	  (symbol :tag "Item in `gnus-article-banner-alist'" none)
	  regexp
	  (const :tag "None" nil))
 :parameter-document
 "If non-nil, specify how to remove `banners' from articles.

Symbol `signature' means to remove signatures delimited by
`gnus-signature-separator'.  Any other symbol is used to look up a
regular expression to match the banner in `gnus-article-banner-alist'.
A string is used as a regular expression to match the banner
directly.")

(defcustom gnus-article-address-banner-alist nil
  "Alist of mail addresses and banners.
Each element has the form (ADDRESS . BANNER), where ADDRESS is a regexp
to match a mail address in the From: header, BANNER is one of a symbol
`signature', an item in `gnus-article-banner-alist', a regexp and nil.
If ADDRESS matches author's mail address, it will remove things like
advertisements.  For example:

\((\"@yoo-hoo\\\\.co\\\\.jp\\\\'\" . \"\\n_+\\nDo You Yoo-hoo!\\\\?\\n.*\\n.*\\n\"))
"
  :type '(repeat
	  (cons
	   (regexp :tag "Address")
	   (choice :tag "Banner" :value nil
		   (const :tag "Remove signature" signature)
		   (symbol :tag "Item in `gnus-article-banner-alist'" none)
		   regexp
		   (const :tag "None" nil))))
  :group 'gnus-article-washing)

Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
323 324
(defcustom gnus-emphasis-alist
  (let ((format
325
	 "\\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\([-,.;:!?\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)")
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
326
	(types
327 328
	 '(("\\*" "\\*" bold)
	   ("_" "_" underline)
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
329 330 331 332 333
	   ("/" "/" italic)
	   ("_/" "/_" underline-italic)
	   ("_\\*" "\\*_" underline-bold)
	   ("\\*/" "/\\*" bold-italic)
	   ("_\\*/" "/\\*_" underline-bold-italic))))
334
    `(,@(mapcar
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
335 336 337
	 (lambda (spec)
	   (list
	    (format format (car spec) (cadr spec))
338
	    2 3 (intern (format "gnus-emphasis-%s" (nth 2 spec)))))
339 340 341 342 343
	 types)
	("\\(\\s-\\|^\\)\\(-\\(\\(\\w\\|-[^-]\\)+\\)-\\)\\(\\s-\\|[?!.,;]\\)"
	 2 3 gnus-emphasis-strikethru)
	("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)"
	 2 3 gnus-emphasis-underline)))
344
  "*Alist that says how to fontify certain phrases.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
Each item looks like this:

  (\"_\\\\(\\\\w+\\\\)_\" 0 1 'underline)

The first element is a regular expression to be matched.  The second
is a number that says what regular expression grouping used to find
the entire emphasized word.  The third is a number that says what
regexp grouping should be displayed and highlighted.  The fourth
is the face used for highlighting."
  :type '(repeat (list :value ("" 0 0 default)
		       regexp
		       (integer :tag "Match group")
		       (integer :tag "Emphasize group")
		       face))
  :group 'gnus-article-emphasis)

361 362 363 364 365
(defcustom gnus-emphasize-whitespace-regexp "^[ \t]+\\|[ \t]*\n"
  "A regexp to describe whitespace which should not be emphasized.
Typical values are \"^[ \\t]+\\\\|[ \\t]*\\n\" and \"[ \\t]+\\\\|[ \\t]*\\n\".
The former avoids underlining of leading and trailing whitespace,
and the latter avoids underlining any whitespace at all."
Dave Love's avatar
Dave Love committed
366
  :version "21.1"
367 368 369
  :group 'gnus-article-emphasis
  :type 'regexp)

370
(defface gnus-emphasis-bold '((t (:bold t)))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
371 372 373
  "Face used for displaying strong emphasized text (*word*)."
  :group 'gnus-article-emphasis)

374
(defface gnus-emphasis-italic '((t (:italic t)))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
375 376 377 378 379 380 381
  "Face used for displaying italic emphasized text (/word/)."
  :group 'gnus-article-emphasis)

(defface gnus-emphasis-underline '((t (:underline t)))
  "Face used for displaying underlined emphasized text (_word_)."
  :group 'gnus-article-emphasis)

382
(defface gnus-emphasis-underline-bold '((t (:bold t :underline t)))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
383 384 385
  "Face used for displaying underlined bold emphasized text (_*word*_)."
  :group 'gnus-article-emphasis)

386
(defface gnus-emphasis-underline-italic '((t (:italic t :underline t)))
387
  "Face used for displaying underlined italic emphasized text (_/word/_)."
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
388 389
  :group 'gnus-article-emphasis)

390
(defface gnus-emphasis-bold-italic '((t (:bold t :italic t)))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
391 392 393 394
  "Face used for displaying bold italic emphasized text (/*word*/)."
  :group 'gnus-article-emphasis)

(defface gnus-emphasis-underline-bold-italic
395
  '((t (:bold t :italic t :underline t)))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
396
  "Face used for displaying underlined bold italic emphasized text.
ShengHuo ZHU's avatar
Typos.  
ShengHuo ZHU committed
397
Example: (_/*word*/_)."
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
398 399
  :group 'gnus-article-emphasis)

400 401 402 403 404 405
(defface gnus-emphasis-strikethru (if (featurep 'xemacs)
				      '((t (:strikethru t)))
				    '((t (:strike-through t))))
  "Face used for displaying strike-through text (-word-)."
  :group 'gnus-article-emphasis)

406 407 408 409 410
(defface gnus-emphasis-highlight-words
  '((t (:background "black" :foreground "yellow")))
  "Face used for displaying highlighted words."
  :group 'gnus-article-emphasis)

Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
411 412
(defcustom gnus-article-time-format "%a, %b %d %Y %T %Z"
  "Format for display of Date headers in article bodies.
413 414 415 416 417 418
See `format-time-string' for the possible values.

The variable can also be function, which should return a complete Date
header.  The function is called with one argument, the time, which can
be fed to `format-time-string'."
  :type '(choice string symbol)
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
  :link '(custom-manual "(gnus)Article Date")
  :group 'gnus-article-washing)

(eval-and-compile
  (autoload 'mail-extract-address-components "mail-extr"))

(defcustom gnus-save-all-headers t
  "*If non-nil, don't remove any headers before saving."
  :group 'gnus-article-saving
  :type 'boolean)

(defcustom gnus-prompt-before-saving 'always
  "*This variable says how much prompting is to be done when saving articles.
If it is nil, no prompting will be done, and the articles will be
saved to the default files.  If this variable is `always', each and
every article that is saved will be preceded by a prompt, even when
saving large batches of articles.  If this variable is neither nil not
`always', there the user will be prompted once for a file name for
each invocation of the saving commands."
  :group 'gnus-article-saving
  :type '(choice (item always)
		 (item :tag "never" nil)
441
		 (sexp :tag "once" :format "%t\n" :value t)))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
442 443 444 445 446 447 448

(defcustom gnus-saved-headers gnus-visible-headers
  "Headers to keep if `gnus-save-all-headers' is nil.
If `gnus-save-all-headers' is non-nil, this variable will be ignored.
If that variable is nil, however, all headers that match this regexp
will be kept while the rest will be deleted before saving."
  :group 'gnus-article-saving
449
  :type 'regexp)
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
450 451 452 453 454 455 456 457 458 459 460 461

(defcustom gnus-default-article-saver 'gnus-summary-save-in-rmail
  "A function to save articles in your favourite format.
The function must be interactively callable (in other words, it must
be an Emacs command).

Gnus provides the following functions:

* gnus-summary-save-in-rmail (Rmail format)
* gnus-summary-save-in-mail (Unix mail format)
* gnus-summary-save-in-folder (MH folder)
* gnus-summary-save-in-file (article format)
462
* gnus-summary-save-body-in-file (article body)
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
463 464 465 466 467 468 469
* gnus-summary-save-in-vm (use VM's folder format)
* gnus-summary-write-to-file (article format -- overwrite)."
  :group 'gnus-article-saving
  :type '(radio (function-item gnus-summary-save-in-rmail)
		(function-item gnus-summary-save-in-mail)
		(function-item gnus-summary-save-in-folder)
		(function-item gnus-summary-save-in-file)
470
		(function-item gnus-summary-save-body-in-file)
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
		(function-item gnus-summary-save-in-vm)
		(function-item gnus-summary-write-to-file)))

(defcustom gnus-rmail-save-name 'gnus-plain-save-name
  "A function generating a file name to save articles in Rmail format.
The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE."
  :group 'gnus-article-saving
  :type 'function)

(defcustom gnus-mail-save-name 'gnus-plain-save-name
  "A function generating a file name to save articles in Unix mail format.
The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE."
  :group 'gnus-article-saving
  :type 'function)

(defcustom gnus-folder-save-name 'gnus-folder-save-name
  "A function generating a file name to save articles in MH folder.
The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER."
  :group 'gnus-article-saving
  :type 'function)

(defcustom gnus-file-save-name 'gnus-numeric-save-name
  "A function generating a file name to save articles in article format.
The function is called with NEWSGROUP, HEADERS, and optional
LAST-FILE."
  :group 'gnus-article-saving
  :type 'function)

(defcustom gnus-split-methods
  '((gnus-article-archive-name)
    (gnus-article-nndoc-name))
502
  "*Variable used to suggest where articles are to be saved.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521
For instance, if you would like to save articles related to Gnus in
the file \"gnus-stuff\", and articles related to VM in \"vm-stuff\",
you could set this variable to something like:

 '((\"^Subject:.*gnus\\|^Newsgroups:.*gnus\" \"gnus-stuff\")
   (\"^Subject:.*vm\\|^Xref:.*vm\" \"vm-stuff\"))

This variable is an alist where the where the key is the match and the
value is a list of possible files to save in if the match is non-nil.

If the match is a string, it is used as a regexp match on the
article.  If the match is a symbol, that symbol will be funcalled
from the buffer of the article to be saved with the newsgroup as the
parameter.  If it is a list, it will be evaled in the same buffer.

If this form or function returns a string, this string will be used as
a possible file name; and if it returns a non-nil list, that list will
be used as possible file names."
  :group 'gnus-article-saving
522 523 524
  :type '(repeat (choice (list :value (fun) function)
			 (cons :value ("" "") regexp (repeat string))
			 (sexp :value nil))))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
525 526 527 528 529 530 531 532

(defcustom gnus-page-delimiter "^\^L"
  "*Regexp describing what to use as article page delimiters.
The default value is \"^\^L\", which is a form linefeed at the
beginning of a line."
  :type 'regexp
  :group 'gnus-article-various)

533
(defcustom gnus-article-mode-line-format "Gnus: %g [%w] %S%m"
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
534
  "*The format specification for the article mode line.
535 536 537 538 539 540
See `gnus-summary-mode-line-format' for a closer description.

The following additional specs are available:

%w  The article washing status.
%m  The number of MIME parts in the article."
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
541 542 543 544 545 546 547 548
  :type 'string
  :group 'gnus-article-various)

(defcustom gnus-article-mode-hook nil
  "*A hook for Gnus article mode."
  :type 'hook
  :group 'gnus-article-various)

549 550 551 552 553 554 555
(when (featurep 'xemacs)
  ;; Extracted from gnus-xmas-define in order to preserve user settings
  (when (fboundp 'turn-off-scroll-in-place)
    (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place))
  ;; Extracted from gnus-xmas-redefine in order to preserve user settings
  (add-hook 'gnus-article-mode-hook 'gnus-xmas-article-menu-add))

Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
556 557 558 559 560 561
(defcustom gnus-article-menu-hook nil
  "*Hook run after the creation of the article mode menu."
  :type 'hook
  :group 'gnus-article-various)

(defcustom gnus-article-prepare-hook nil
562
  "*A hook called after an article has been prepared in the article buffer."
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
563 564 565
  :type 'hook
  :group 'gnus-article-various)

566 567
(make-obsolete-variable 'gnus-article-hide-pgp-hook
			"This variable is obsolete in Gnus 5.10.")
568

Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584
(defcustom gnus-article-button-face 'bold
  "Face used for highlighting buttons in the article buffer.

An article button is a piece of text that you can activate by pressing
`RET' or `mouse-2' above it."
  :type 'face
  :group 'gnus-article-buttons)

(defcustom gnus-article-mouse-face 'highlight
  "Face used for mouse highlighting in the article buffer.

Article buttons will be displayed in this face when the cursor is
above them."
  :type 'face
  :group 'gnus-article-buttons)

585 586 587
(defcustom gnus-signature-face 'gnus-signature-face
  "Face used for highlighting a signature in the article buffer.
Obsolete; use the face `gnus-signature-face' for customizations instead."
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
588 589 590 591
  :type 'face
  :group 'gnus-article-highlight
  :group 'gnus-article-signature)

592
(defface gnus-signature-face
593
  '((t
594
     (:italic t)))
595 596 597 598
  "Face used for highlighting a signature in the article buffer."
  :group 'gnus-article-highlight
  :group 'gnus-article-signature)

Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
599 600 601
(defface gnus-header-from-face
  '((((class color)
      (background dark))
602
     (:foreground "spring green"))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
603 604
    (((class color)
      (background light))
605
     (:foreground "red3"))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
606
    (t
607
     (:italic t)))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
608 609 610 611 612 613 614
  "Face used for displaying from headers."
  :group 'gnus-article-headers
  :group 'gnus-article-highlight)

(defface gnus-header-subject-face
  '((((class color)
      (background dark))
615
     (:foreground "SeaGreen3"))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
616 617
    (((class color)
      (background light))
618
     (:foreground "red4"))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
619
    (t
620
     (:bold t :italic t)))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
621 622 623 624 625 626 627
  "Face used for displaying subject headers."
  :group 'gnus-article-headers
  :group 'gnus-article-highlight)

(defface gnus-header-newsgroups-face
  '((((class color)
      (background dark))
628
     (:foreground "yellow" :italic t))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
629 630
    (((class color)
      (background light))
631
     (:foreground "MidnightBlue" :italic t))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
632
    (t
633 634 635 636
     (:italic t)))
  "Face used for displaying newsgroups headers.
In the default setup this face is only used for crossposted
articles."
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
637 638 639 640 641 642 643 644 645 646 647
  :group 'gnus-article-headers
  :group 'gnus-article-highlight)

(defface gnus-header-name-face
  '((((class color)
      (background dark))
     (:foreground "SeaGreen"))
    (((class color)
      (background light))
     (:foreground "maroon"))
    (t
648
     (:bold t)))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
649 650 651 652 653 654 655
  "Face used for displaying header names."
  :group 'gnus-article-headers
  :group 'gnus-article-highlight)

(defface gnus-header-content-face
  '((((class color)
      (background dark))
656
     (:foreground "forest green" :italic t))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
657 658
    (((class color)
      (background light))
659
     (:foreground "indianred4" :italic t))
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
660
    (t
661
     (:italic t)))  "Face used for displaying header content."
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
662 663 664 665 666 667 668 669
  :group 'gnus-article-headers
  :group 'gnus-article-highlight)

(defcustom gnus-header-face-alist
  '(("From" nil gnus-header-from-face)
    ("Subject" nil gnus-header-subject-face)
    ("Newsgroups:.*," nil gnus-header-newsgroups-face)
    ("" gnus-header-name-face gnus-header-content-face))
670
  "*Controls highlighting of article headers.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
671 672 673

An alist of the form (HEADER NAME CONTENT).

674 675
HEADER is a regular expression which should match the name of a
header and NAME and CONTENT are either face names or nil.
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
676 677

The name of each header field will be displayed using the face
678 679 680
specified by the first element in the list where HEADER matches
the header name and NAME is non-nil.  Similarly, the content will
be displayed by the first non-nil matching CONTENT face."
Lars Magne Ingebrigtsen's avatar
Lars Magne Ingebrigtsen committed
681 682 683 684 685 686 687 688 689 690
  :group 'gnus-article-headers
  :group 'gnus-article-highlight
  :type '(repeat (list (regexp :tag "Header")
		       (choice :tag "Name"
			       (item :tag "skip" nil)
			       (face :value default))
		       (choice :tag "Content"
			       (item :tag "skip" nil)
			       (face :value default)))))

691
(defcustom gnus-article-decode-hook
692 693
  '(article-decode-charset article-decode-encoded-words
			   article-decode-group-name article-decode-idna-rhs)
694 695 696 697 698 699 700 701 702 703 704 705 706
  "*Hook run to decode charsets in articles."
  :group 'gnus-article-headers
  :type 'hook)

(defcustom gnus-display-mime-function 'gnus-display-mime
  "Function to display MIME articles."
  :group 'gnus-article-mime
  :type 'function)

(defvar gnus-decode-header-function 'mail-decode-encoded-word-region
  "Function used to decode headers.")

(defvar gnus-article-dumbquotes-map
707 708
  '(("\200" "EUR")
    ("\202" ",")
709 710 711 712 713 714 715 716 717 718
    ("\203" "f")
    ("\204" ",,")
    ("\205" "...")
    ("\213" "<")
    ("\214" "OE")
    ("\221" "`")
    ("\222" "'")
    ("\223" "``")
    ("\224" "\"")
    ("\225" "*")
719 720
    ("\226" "-")
    ("\227" "--")
721
    ("\230" "~")
722 723 724 725 726 727 728 729
    ("\231" "(TM)")
    ("\233" ">")
    ("\234" "oe")
    ("\264" "'"))
  "Table for MS-to-Latin1 translation.")

(defcustom gnus-ignored-mime-types nil
  "List of MIME types that should be ignored by Gnus."
Dave Love's avatar
Dave Love committed
730
  :version "21.1"
731 732 733 734
  :group 'gnus-article-mime
  :type '(repeat regexp))

(defcustom gnus-unbuttonized-mime-types '(".*/.*")
735 736 737 738 739 740 741 742 743 744 745 746 747
  "List of MIME types that should not be given buttons when rendered inline.
See also `gnus-buttonized-mime-types' which may override this variable.
This variable is only used when `gnus-inhibit-mime-unbuttonizing' is nil."
  :version "21.1"
  :group 'gnus-article-mime
  :type '(repeat regexp))

(defcustom gnus-buttonized-mime-types nil
  "List of MIME types that should be given buttons when rendered inline.
If set, this variable overrides `gnus-unbuttonized-mime-types'.
To see e.g. security buttons you could set this to
`(\"multipart/signed\")'.
This variable is only used when `gnus-inhibit-mime-unbuttonizing' is nil."
748
  :version "21.4"
749 750 751
  :group 'gnus-article-mime
  :type '(repeat regexp))

752 753 754 755 756
(defcustom gnus-inhibit-mime-unbuttonizing nil
  "If non-nil, all MIME parts get buttons.
When nil (the default value), then some MIME parts do not get buttons,
as described by the variables `gnus-buttonized-mime-types' and
`gnus-unbuttonized-mime-types'."
757
  :version "21.4"
758 759 760 761 762 763
  :type 'boolean)

(defcustom gnus-body-boundary-delimiter "_"
  "String used to delimit header and body.
This variable is used by `gnus-article-treat-body-boundary' which can
be controlled by `gnus-treat-body-boundary'."
764
  :version "21.4"
765 766 767 768 769 770 771 772
  :group 'gnus-article-various
  :type '(choice (item :tag "None" :value nil)
		 string))

(defcustom gnus-picon-databases '("/usr/lib/picon" "/usr/local/faces")
  "Defines the location of the faces database.
For information on obtaining this database of pretty pictures, please
see http://www.cs.indiana.edu/picons/ftp/index.html"
773
  :version "21.4"
774 775 776 777 778 779 780 781 782 783 784 785 786 787
  :type '(repeat directory)
  :link '(url-link :tag "download"
		   "http://www.cs.indiana.edu/picons/ftp/index.html")
  :link '(custom-manual "(gnus)Picons")
  :group 'gnus-picon)

(defun gnus-picons-installed-p ()
  "Say whether picons are installed on your machine."
  (let ((installed nil))
    (dolist (database gnus-picon-databases)
      (when (file-exists-p database)
	(setq installed t)))
    installed))

788 789 790 791 792 793 794 795
(defcustom gnus-article-mime-part-function nil
  "Function called with a MIME handle as the argument.
This is meant for people who want to do something automatic based
on parts -- for instance, adding Vcard info to a database."
  :group 'gnus-article-mime
  :type 'function)

(defcustom gnus-mime-multipart-functions nil
Dave Love's avatar
Dave Love committed
796 797 798 799
  "An alist of MIME types to functions to display them."
  :version "21.1"
  :group 'gnus-article-mime
  :type 'alist)
800 801 802 803 804 805

(defcustom gnus-article-date-lapsed-new-header nil
  "Whether the X-Sent and Date headers can coexist.
When using `gnus-treat-date-lapsed', the \"X-Sent:\" header will
either replace the old \"Date:\" header (if this variable is nil), or
be added below it (otherwise)."
Dave Love's avatar
Dave Love committed
806
  :version "21.1"
807 808 809 810 811 812
  :group 'gnus-article-headers
  :type 'boolean)

(defcustom gnus-article-mime-match-handle-function 'undisplayed-alternative
  "Function called with a MIME handle as the argument.
This is meant for people who want to view first matched part.
813 814 815
For `undisplayed-alternative' (default), the first undisplayed
part or alternative part is used.  For `undisplayed', the first
undisplayed part is used.  For a function, the first part which
816
the function return t is used.  For nil, the first part is
817
used."
Dave Love's avatar
Dave Love committed
818
  :version "21.1"
819
  :group 'gnus-article-mime
820
  :type '(choice
821 822
	  (item :tag "first" :value nil)
	  (item :tag "undisplayed" :value undisplayed)
823
	  (item :tag "undisplayed or alternative"
824 825 826
		:value undisplayed-alternative)
	  (function)))

827 828
(defcustom gnus-mime-action-alist
  '(("save to file" . gnus-mime-save-part)
829 830
    ("save and strip" . gnus-mime-save-part-and-strip)
    ("delete part" . gnus-mime-delete-part)
831 832 833 834
    ("display as text" . gnus-mime-inline-part)
    ("view the part" . gnus-mime-view-part)
    ("pipe to command" . gnus-mime-pipe-part)
    ("toggle display" . gnus-article-press-button)
835
    ("toggle display" . gnus-article-view-part-as-charset)
836
    ("view as type" . gnus-mime-view-part-as-type)
837 838
    ("view internally" . gnus-mime-view-part-internally)
    ("view externally" . gnus-mime-view-part-externally))
839 840 841 842 843
  "An alist of actions that run on the MIME attachment."
  :group 'gnus-article-mime
  :type '(repeat (cons (string :tag "name")
		       (function))))

844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869
;;;
;;; The treatment variables
;;;

(defvar gnus-part-display-hook nil
  "Hook called on parts that are to receive treatment.")

(defvar gnus-article-treat-custom
  '(choice (const :tag "Off" nil)
	   (const :tag "On" t)
	   (const :tag "Header" head)
	   (const :tag "Last" last)
	   (integer :tag "Less")
	   (repeat :tag "Groups" regexp)
	   (sexp :tag "Predicate")))

(defvar gnus-article-treat-head-custom
  '(choice (const :tag "Off" nil)
	   (const :tag "Header" head)))

(defvar gnus-article-treat-types '("text/plain")
  "Parts to treat.")

(defvar gnus-inhibit-treatment nil
  "Whether to inhibit treatment.")

870
(defcustom gnus-treat-highlight-signature '(or t (typep "text/x-vcard"))
871 872
  "Highlight the signature.
Valid values are nil, t, `head', `last', an integer or a predicate.
873
See Info node `(gnus)Customizing Articles'."
874
  :group 'gnus-article-treat
875
  :link '(custom-manual "(gnus)Customizing Articles")
876 877 878 879 880 881
  :type gnus-article-treat-custom)
(put 'gnus-treat-highlight-signature 'highlight t)

(defcustom gnus-treat-buttonize 100000
  "Add buttons.
Valid values are nil, t, `head', `last', an integer or a predicate.
882
See Info node `(gnus)Customizing Articles'."
883
  :group 'gnus-article-treat
884
  :link '(custom-manual "(gnus)Customizing Articles")
885 886 887 888 889 890
  :type gnus-article-treat-custom)
(put 'gnus-treat-buttonize 'highlight t)

(defcustom gnus-treat-buttonize-head 'head
  "Add buttons to the head.
Valid values are nil, t, `head', `last', an integer or a predicate.
891
See Info node `(gnus)Customizing Articles' for details."
892
  :group 'gnus-article-treat
893
  :link '(custom-manual "(gnus)Customizing Articles")
894 895 896
  :type gnus-article-treat-head-custom)
(put 'gnus-treat-buttonize-head 'highlight t)

897
(defcustom gnus-treat-emphasize
898 899 900 901
  (and (or window-system
	   (featurep 'xemacs)
	   (>= (string-to-number emacs-version) 21))
       50000)
902 903
  "Emphasize text.
Valid values are nil, t, `head', `last', an integer or a predicate.
904
See Info node `(gnus)Customizing Articles' for details."
905
  :group 'gnus-article-treat
906
  :link '(custom-manual "(gnus)Customizing Articles")
907 908 909 910 911 912
  :type gnus-article-treat-custom)
(put 'gnus-treat-emphasize 'highlight t)

(defcustom gnus-treat-strip-cr nil
  "Remove carriage returns.
Valid values are nil, t, `head', `last', an integer or a predicate.
913
See Info node `(gnus)Customizing Articles' for details."
914
  :version "21.4"
915
  :group 'gnus-article-treat
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930
  :link '(custom-manual "(gnus)Customizing Articles")
  :type gnus-article-treat-custom)

(defcustom gnus-treat-unsplit-urls nil
  "Remove newlines from within URLs.
Valid values are nil, t, `head', `last', an integer or a predicate.
See Info node `(gnus)Customizing Articles' for details."
  :group 'gnus-article-treat
  :link '(custom-manual "(gnus)Customizing Articles")
  :type gnus-article-treat-custom)

(defcustom gnus-treat-leading-whitespace nil
  "Remove leading whitespace in headers.
Valid values are nil, t, `head', `last', an integer or a predicate.
See Info node `(gnus)Customizing Articles' for details."
931
  :version "21.4"
932 933
  :group 'gnus-article-treat
  :link '(custom-manual "(gnus)Customizing Articles")
934 935 936 937 938
  :type gnus-article-treat-custom)

(defcustom gnus-treat-hide-headers 'head
  "Hide headers.
Valid values are nil, t, `head', `last', an integer or a predicate.
939
See Info node `(gnus)Customizing Articles' for details."
940
  :group 'gnus-article-treat
941
  :link '(custom-manual "(gnus)Customizing Articles")
942 943 944 945 946
  :type gnus-article-treat-head-custom)

(defcustom gnus-treat-hide-boring-headers nil
  "Hide boring headers.
Valid values are nil, t, `head', `last', an integer or a predicate.
947
See Info node `(gnus)Customizing Articles' for details."
948
  :group 'gnus-article-treat
949
  :link '(custom-manual "(gnus)Customizing Articles")
950 951 952 953 954
  :type gnus-article-treat-head-custom)

(defcustom gnus-treat-hide-signature nil
  "Hide the signature.
Valid values are nil, t, `head', `last', an integer or a predicate.
955
See Info node `(gnus)Customizing Articles' for details."
956
  :group 'gnus-article-treat
957
  :link '(custom-manual "(gnus)Customizing Articles")
958 959 960 961 962
  :type gnus-article-treat-custom)

(defcustom gnus-treat-fill-article nil
  "Fill the article.
Valid values are nil, t, `head', `last', an integer or a predicate.
963
See Info node `(gnus)Customizing Articles' for details."
964
  :group 'gnus-article-treat
965
  :link '(custom-manual "(gnus)Customizing Articles")
966 967 968 969 970
  :type gnus-article-treat-custom)

(defcustom gnus-treat-hide-citation nil
  "Hide cited text.
Valid values are nil, t, `head', `last', an integer or a predicate.
971
See Info node `(gnus)Customizing Articles' for details."
972
  :group 'gnus-article-treat
973
  :link '(custom-manual "(gnus)Customizing Articles")
974 975
  :type gnus-article-treat-custom)

976 977 978
(defcustom gnus-treat-hide-citation-maybe nil
  "Hide cited text.
Valid values are nil, t, `head', `last', an integer or a predicate.
979
See Info node `(gnus)Customizing Articles' for details."
980
  :group 'gnus-article-treat
981
  :link '(custom-manual "(gnus)Customizing Articles")
982 983
  :type gnus-article-treat-custom)

984 985 986
(defcustom gnus-treat-strip-list-identifiers 'head
  "Strip list identifiers from `gnus-list-identifiers`.
Valid values are nil, t, `head', `last', an integer or a predicate.
987
See Info node `(gnus)Customizing Articles' for details."
Dave Love's avatar
Dave Love committed
988
  :version "21.1"
989
  :group 'gnus-article-treat
990
  :link '(custom-manual "(gnus)Customizing Articles")
991 992
  :type gnus-article-treat-custom)

993 994
(make-obsolete-variable 'gnus-treat-strip-pgp
			"This option is obsolete in Gnus 5.10.")
995 996 997 998

(defcustom gnus-treat-strip-pem nil
  "Strip PEM signatures.
Valid values are nil, t, `head', `last', an integer or a predicate.
999
See Info node `(gnus)Customizing Articles' for details."
1000
  :group 'gnus-article-treat
1001
  :link '(custom-manual "(gnus)Customizing Articles")
1002 1003 1004 1005 1006 1007
  :type gnus-article-treat-custom)

(defcustom gnus-treat-strip-banner t
  "Strip banners from articles.
The banner to be stripped is specified in the `banner' group parameter.
Valid values are nil, t, `head', `last', an integer or a predicate.
1008
See Info node `(gnus)Customizing Articles' for details."
1009
  :group 'gnus-article-treat
1010
  :link '(custom-manual "(gnus)Customizing Articles")
1011 1012 1013 1014 1015
  :type gnus-article-treat-custom)

(defcustom gnus-treat-highlight-headers 'head
  "Highlight the headers.
Valid values are nil, t, `head', `last', an integer or a predicate.
1016
See Info node `(gnus)Customizing Articles' for details."
1017
  :group 'gnus-article-treat
1018
  :link '(custom-manual "(gnus)Customizing Articles")
1019 1020 1021 1022 1023 1024
  :type gnus-article-treat-head-custom)
(put 'gnus-treat-highlight-headers 'highlight t)

(defcustom gnus-treat-highlight-citation t
  "Highlight cited text.
Valid values are nil, t, `head', `last', an integer or a predicate.
1025
See Info node `(gnus)Customizing Articles' for details."
1026
  :group 'gnus-article-treat
1027
  :link '(custom-manual "(gnus)Customizing Articles")
1028 1029 1030 1031 1032 1033
  :type gnus-article-treat-custom)
(put 'gnus-treat-highlight-citation 'highlight t)

(defcustom gnus-treat-date-ut nil
  "Display the Date in UT (GMT).
Valid values are nil, t, `head', `last', an integer or a predicate.
1034
See Info node `(gnus)Customizing Articles' for details."
1035
  :group 'gnus-article-treat
1036
  :link '(custom-manual "(gnus)Customizing Articles")
1037 1038 1039 1040 1041
  :type gnus-article-treat-head-custom)

(defcustom gnus-treat-date-local nil
  "Display the Date in the local timezone.
Valid values are nil, t, `head', `last', an integer or a predicate.
1042 1043 1044 1045 1046 1047 1048 1049 1050
See Info node `(gnus)Customizing Articles' for details."
  :group 'gnus-article-treat
  :link '(custom-manual "(gnus)Customizing Articles")
  :type gnus-article-treat-head-custom)

(defcustom gnus-treat-date-english nil
  "Display the Date in a format that can be read aloud in English.
Valid values are nil, t, `head', `last', an integer or a predicate.
See Info node `(gnus)Customizing Articles' for details."
1051
  :version "21.4"
1052
  :group 'gnus-article-treat
1053
  :link '(custom-manual "(gnus)Customizing Articles")
1054 1055 1056 1057 1058
  :type gnus-article-treat-head-custom)

(defcustom gnus-treat-date-lapsed nil
  "Display the Date header in a way that says how much time has elapsed.
Valid values are nil, t, `head', `last', an integer or a predicate.
1059
See Info node `(gnus)Customizing Articles' for details."
1060
  :group 'gnus-article-treat
1061
  :link '(custom-manual "(gnus)Customizing Articles")
1062 1063 1064 1065 1066
  :type gnus-article-treat-head-custom)

(defcustom gnus-treat-date-original nil
  "Display the date in the original timezone.
Valid values are nil, t, `head', `last', an integer or a predicate.
1067
See Info node `(gnus)Customizing Articles' for details."
1068
  :group 'gnus-article-treat
1069
  :link '(custom-manual "(gnus)Customizing Articles")
1070 1071 1072 1073 1074
  :type gnus-article-treat-head-custom)

(defcustom gnus-treat-date-iso8601 nil
  "Display the date in the ISO8601 format.
Valid values are nil, t, `head', `last', an integer or a predicate.
1075
See Info node `(gnus)Customizing Articles' for details."
Dave Love's avatar
Dave Love committed
1076
  :version "21.1"
1077
  :group 'gnus-article-treat
1078
  :link '(custom-manual "(gnus)Customizing Articles")
1079 1080 1081 1082 1083 1084
  :type gnus-article-treat-head-custom)

(defcustom gnus-treat-date-user-defined nil
  "Display the date in a user-defined format.
The format is defined by the `gnus-article-time-format' variable.
Valid values are nil, t, `head', `last', an integer or a predicate.
1085
See Info node `(gnus)Customizing Articles' for details."
1086
  :group 'gnus-article-treat
1087
  :link '(custom-manual "(gnus)Customizing Articles")
1088 1089 1090 1091 1092
  :type gnus-article-treat-head-custom)

(defcustom gnus-treat-strip-headers-in-body t
  "Strip the X-No-Archive header line from the beginning of the body.
Valid values are nil, t, `head', `last', an integer or a predicate.
1093
See Info node `(gnus)Customizing Articles' for details."
Dave Love's avatar
Dave Love committed
1094
  :version "21.1"
1095
  :group 'gnus-article-treat
1096
  :link '(custom-manual "(gnus)Customizing Articles")
1097 1098 1099 1100 1101
  :type gnus-article-treat-custom)

(defcustom gnus-treat-strip-trailing-blank-lines nil
  "Strip trailing blank lines.
Valid values are nil, t, `head', `last', an integer or a predicate.
1102
See Info node `(gnus)Customizing Articles' for details."
1103
  :group 'gnus-article-treat
1104
  :link '(custom-manual "(gnus)Customizing Articles")
1105 1106 1107 1108 1109
  :type gnus-article-treat-custom)

(defcustom gnus-treat-strip-leading-blank-lines nil
  "Strip leading blank lines.
Valid values are nil, t, `head', `last', an integer or a predicate.
1110
See Info node `(gnus)Customizing Articles' for details."
1111
  :group 'gnus-article-treat
1112
  :link '(custom-manual "(gnus)Customizing Articles")
1113 1114 1115 1116 1117
  :type gnus-article-treat-custom)

(defcustom gnus-treat-strip-multiple-blank-lines nil
  "Strip multiple blank lines.
Valid values are nil, t, `head', `last', an integer or a predicate.
1118
See Info node `(gnus)Customizing Articles' for details."
1119
  :group 'gnus-article-treat
1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134
  :link '(custom-manual "(gnus)Customizing Articles")
  :type gnus-article-treat-custom)

(defcustom gnus-treat-unfold-headers 'head
  "Unfold folded header lines.
Valid values are nil, t, `head', `last', an integer or a predicate.
See Info node `(gnus)Customizing Articles' for details."
  :group 'gnus-article-treat
  :link '(custom-manual "(gnus)Customizing Articles")
  :type gnus-article-treat-custom)

(defcustom gnus-treat-fold-headers nil
  "Fold headers.
Valid values are nil, t, `head', `last', an integer or a predicate.
See Info node `(gnus)Customizing Articles' for details."
1135
  :version "21.4"
1136 1137 1138 1139 1140 1141 1142 1143
  :group 'gnus-article-treat
  :link '(custom-manual "(gnus)Customizing Articles")
  :type gnus-article-treat-custom)

(defcustom gnus-treat-fold-newsgroups 'head
  "Fold the Newsgroups and Followup-To headers.
Valid values are nil, t, `head', `last', an integer or a predicate.
See Info node `(gnus)Customizing Articles' for details."
1144
  :version "21.4"
1145 1146
  :group 'gnus-article-treat
  :link '(custom-manual "(gnus)Customizing Articles")
1147 1148 1149 1150 1151
  :type gnus-article-treat-custom)

(defcustom gnus-treat-overstrike t
  "Treat overstrike highlighting.
Valid values are nil, t, `head', `last', an integer or a predicate.
1152
See Info node `(gnus)Customizing Articles' for details."
1153
  :group 'gnus-article-treat
1154
  :link '(custom-manual "(gnus)Customizing Articles")
1155 1156 1157
  :type gnus-article-treat-custom)
(put 'gnus-treat-overstrike 'highlight t)

1158 1159 1160 1161 1162 1163
(make-obsolete-variable 'gnus-treat-display-xface
			'gnus-treat-display-x-face)

(defcustom gnus-treat-display-x-face
  (and (not noninteractive)
       (or (and (fboundp 'image-type-available-p)
1164
		(image-type-available-p 'xbm)
1165 1166 1167 1168
		(string-match "^0x" (shell-command-to-string "uncompface"))
		(executable-find "icontopbm"))
	   (and (featurep 'xemacs)
		(featurep 'xface)))
Dave Love's avatar
Dave Love committed
1169
       'head)
1170 1171
  "Display X-Face headers.
Valid values are nil, t, `head', `last', an integer or a predicate.
1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208
See Info node `(gnus)Customizing Articles' and Info node
`(gnus)X-Face' for details."
  :group 'gnus-article-treat
  :version "21.1"
  :link '(custom-manual "(gnus)Customizing Articles")
  :link '(custom-manual "(gnus)X-Face")
  :type gnus-article-treat-head-custom
  :set (lambda (symbol value)
	 (set-default
	  symbol
	  (cond ((or (boundp symbol) (get symbol 'saved-value))
		 value)
		((boundp 'gnus-treat-display-xface)
		 (message "\
** gnus-treat-display-xface is an obsolete variable;\
 use gnus-treat-display-x-face instead")
		 (default-value 'gnus-treat-display-xface))
		((get 'gnus-treat-display-xface 'saved-value)
		 (message "\
** gnus-treat-display-xface is an obsolete variable;\
 use gnus-treat-display-x-face instead")
		 (eval (car (get 'gnus-treat-display-xface 'saved-value))))
		(t
		 value)))))
(put 'gnus-treat-display-x-face 'highlight t)

(defcustom gnus-treat-display-face
  (and (not noninteractive)
       (or (and (fboundp 'image-type-available-p)
		(image-type-available-p 'png))
	   (and (featurep 'xemacs)
		(featurep 'png)))
       'head)
  "Display Face headers.
Valid values are nil, t, `head', `last', an integer or a predicate.
See Info node `(gnus)Customizing Articles' and Info node
`(gnus)X-Face' for details."
1209
  :group 'gnus-article-treat
1210
  :version "21.4"
1211 1212
  :link '(custom-manual "(gnus)Customizing Articles")
  :link '(custom-manual "(gnus)X-Face")
1213
  :type gnus-article-treat-head-custom)
1214
(put 'gnus-treat-display-face 'highlight t)
1215

1216
(defcustom gnus-treat-display-smileys
1217 1218 1219 1220 1221
  (if (or (and (featurep 'xemacs)
	       (featurep 'xpm))
	  (and (fboundp 'image-type-available-p)
	       (image-type-available-p 'pbm)))
      t nil)
1222 1223
  "Display smileys.
Valid values are nil, t, `head', `last', an integer or a predicate.
1224 1225
See Info node `(gnus)Customizing Articles' and Info node
`(gnus)Smileys' for details."
1226
  :group 'gnus-article-treat
Dave Love's avatar
Dave Love committed
1227
  :version "21.1"
1228 1229
  :link '(custom-manual "(gnus)Customizing Articles")
  :link '(custom-manual "(gnus)Smileys")
1230 1231 1232
  :type gnus-article-treat-custom)
(put 'gnus-treat-display-smileys 'highlight t)

1233 1234 1235 1236 1237
(defcustom gnus-treat-from-picon
  (if (and (gnus-image-type-available-p 'xpm)
	   (gnus-picons-installed-p))
      'head nil)
  "Display picons in the From header.
1238
Valid values are nil, t, `head', `last', an integer or a predicate.
1239 1240
See Info node `(gnus)Customizing Articles' and Info node
`(gnus)Picons' for details."
1241
  :group 'gnus-article-treat
1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264