PageRenderTime 67ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 2ms

/lisp/gnus/gnus-art.el

http://github.com/davidswelt/aquamacs-emacs
Emacs Lisp | 9035 lines | 7925 code | 629 blank | 481 comment | 121 complexity | 30dd8ce4a54c8af6353cb17adf8e1e7e MD5 | raw file
Possible License(s): GPL-3.0, LGPL-2.0, GPL-2.0, AGPL-3.0

Large files files are truncated, but you can click here to view the full file

  1. ;;; gnus-art.el --- article mode commands for Gnus
  2. ;; Copyright (C) 1996-2016 Free Software Foundation, Inc.
  3. ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
  4. ;; Keywords: news
  5. ;; This file is part of GNU Emacs.
  6. ;; GNU Emacs is free software: you can redistribute it and/or modify
  7. ;; it under the terms of the GNU General Public License as published by
  8. ;; the Free Software Foundation, either version 3 of the License, or
  9. ;; (at your option) any later version.
  10. ;; GNU Emacs is distributed in the hope that it will be useful,
  11. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ;; GNU General Public License for more details.
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;;; Code:
  18. (eval-when-compile
  19. (require 'cl))
  20. (defvar tool-bar-map)
  21. (defvar w3m-minor-mode-map)
  22. (require 'gnus)
  23. (require 'gnus-sum)
  24. (require 'gnus-spec)
  25. (require 'gnus-int)
  26. (require 'gnus-win)
  27. (require 'mm-bodies)
  28. (require 'mail-parse)
  29. (require 'mm-decode)
  30. (require 'mm-view)
  31. (require 'wid-edit)
  32. (require 'mm-uu)
  33. (require 'message)
  34. (require 'mouse)
  35. (autoload 'gnus-msg-mail "gnus-msg" nil t)
  36. (autoload 'gnus-button-mailto "gnus-msg")
  37. (autoload 'gnus-button-reply "gnus-msg" nil t)
  38. (autoload 'parse-time-string "parse-time" nil nil)
  39. (autoload 'ansi-color-apply-on-region "ansi-color")
  40. (autoload 'mm-url-insert-file-contents-external "mm-url")
  41. (autoload 'mm-extern-cache-contents "mm-extern")
  42. (autoload 'url-expand-file-name "url-expand")
  43. (defgroup gnus-article nil
  44. "Article display."
  45. :link '(custom-manual "(gnus)Article Buffer")
  46. :group 'gnus)
  47. (defgroup gnus-article-treat nil
  48. "Treating article parts."
  49. :link '(custom-manual "(gnus)Article Hiding")
  50. :group 'gnus-article)
  51. (defgroup gnus-article-hiding nil
  52. "Hiding article parts."
  53. :link '(custom-manual "(gnus)Article Hiding")
  54. :group 'gnus-article)
  55. (defgroup gnus-article-highlight nil
  56. "Article highlighting."
  57. :link '(custom-manual "(gnus)Article Highlighting")
  58. :group 'gnus-article
  59. :group 'gnus-visual)
  60. (defgroup gnus-article-signature nil
  61. "Article signatures."
  62. :link '(custom-manual "(gnus)Article Signature")
  63. :group 'gnus-article)
  64. (defgroup gnus-article-headers nil
  65. "Article headers."
  66. :link '(custom-manual "(gnus)Hiding Headers")
  67. :group 'gnus-article)
  68. (defgroup gnus-article-washing nil
  69. "Special commands on articles."
  70. :link '(custom-manual "(gnus)Article Washing")
  71. :group 'gnus-article)
  72. (defgroup gnus-article-emphasis nil
  73. "Fontisizing articles."
  74. :link '(custom-manual "(gnus)Article Fontisizing")
  75. :group 'gnus-article)
  76. (defgroup gnus-article-saving nil
  77. "Saving articles."
  78. :link '(custom-manual "(gnus)Saving Articles")
  79. :group 'gnus-article)
  80. (defgroup gnus-article-mime nil
  81. "Worshiping the MIME wonder."
  82. :link '(custom-manual "(gnus)Using MIME")
  83. :group 'gnus-article)
  84. (defgroup gnus-article-buttons nil
  85. "Pushable buttons in the article buffer."
  86. :link '(custom-manual "(gnus)Article Buttons")
  87. :group 'gnus-article)
  88. (defgroup gnus-article-various nil
  89. "Other article options."
  90. :link '(custom-manual "(gnus)Misc Article")
  91. :group 'gnus-article)
  92. (defcustom gnus-ignored-headers
  93. (mapcar
  94. (lambda (header)
  95. (concat "^" header ":"))
  96. '("Path" "Expires" "Date-Received" "References" "Xref" "Lines"
  97. "Relay-Version" "Message-ID" "Approved" "Sender" "Received"
  98. "X-UIDL" "MIME-Version" "Return-Path" "In-Reply-To"
  99. "Content-Type" "Content-Transfer-Encoding" "X-WebTV-Signature"
  100. "X-MimeOLE" "X-MSMail-Priority" "X-Priority" "X-Loop"
  101. "X-Authentication-Warning" "X-MIME-Autoconverted" "X-Face"
  102. "X-Attribution" "X-Originating-IP" "Delivered-To"
  103. "NNTP-[-A-Za-z]+" "Distribution" "X-no-archive" "X-Trace"
  104. "X-Complaints-To" "X-NNTP-Posting-Host" "X-Orig.*"
  105. "Abuse-Reports-To" "Cache-Post-Path" "X-Article-Creation-Date"
  106. "X-Poster" "X-Mail2News-Path" "X-Server-Date" "X-Cache"
  107. "Originator" "X-Problems-To" "X-Auth-User" "X-Post-Time"
  108. "X-Admin" "X-UID" "Resent-[-A-Za-z]+" "X-Mailing-List"
  109. "Precedence" "Original-[-A-Za-z]+" "X-filename" "X-Orcpt"
  110. "Old-Received" "X-Pgp" "X-Auth" "X-From-Line"
  111. "X-Gnus-Article-Number" "X-Majordomo" "X-Url" "X-Sender"
  112. "MBOX-Line" "Priority" "X400-[-A-Za-z]+"
  113. "Status" "X-Gnus-Mail-Source" "Cancel-Lock"
  114. "X-FTN" "X-EXP32-SerialNo" "Encoding" "Importance"
  115. "Autoforwarded" "Original-Encoded-Information-Types" "X-Ya-Pop3"
  116. "X-Face-Version" "X-Vms-To" "X-ML-NAME" "X-ML-COUNT"
  117. "Mailing-List" "X-finfo" "X-md5sum" "X-md5sum-Origin"
  118. "X-Sun-Charset" "X-Accept-Language" "X-Envelope-Sender"
  119. "List-[A-Za-z]+" "X-Listprocessor-Version"
  120. "X-Received" "X-Distribute" "X-Sequence" "X-Juno-Line-Breaks"
  121. "X-Notes-Item" "X-MS-TNEF-Correlator" "x-uunet-gateway"
  122. "X-Received" "Content-length" "X-precedence"
  123. "X-Authenticated-User" "X-Comment" "X-Report" "X-Abuse-Info"
  124. "X-HTTP-Proxy" "X-Mydeja-Info" "X-Copyright" "X-No-Markup"
  125. "X-Abuse-Info" "X-From_" "X-Accept-Language" "Errors-To"
  126. "X-BeenThere" "X-Mailman-Version" "List-Help" "List-Post"
  127. "List-Subscribe" "List-Id" "List-Unsubscribe" "List-Archive"
  128. "X-Content-length" "X-Posting-Agent" "Original-Received"
  129. "X-Request-PGP" "X-Fingerprint" "X-WRIEnvto" "X-WRIEnvfrom"
  130. "X-Virus-Scanned" "X-Delivery-Agent" "Posted-Date" "X-Gateway"
  131. "X-Local-Origin" "X-Local-Destination" "X-UserInfo1"
  132. "X-Received-Date" "X-Hashcash" "Face" "X-DMCA-Notifications"
  133. "X-Abuse-and-DMCA-Info" "X-Postfilter" "X-Gpg-.*" "X-Disclaimer"
  134. "Envelope-To" "X-Spam-Score" "System-Type" "X-Injected-Via-Gmane"
  135. "X-Gmane-NNTP-Posting-Host" "Jabber-ID" "Archived-At"
  136. "Envelope-Sender" "Envelope-Recipients"))
  137. "*All headers that start with this regexp will be hidden.
  138. This variable can also be a list of regexps of headers to be ignored.
  139. If `gnus-visible-headers' is non-nil, this variable will be ignored."
  140. :type '(choice regexp
  141. (repeat regexp))
  142. :group 'gnus-article-hiding)
  143. (defcustom gnus-visible-headers
  144. "^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:"
  145. "*All headers that do not match this regexp will be hidden.
  146. This variable can also be a list of regexp of headers to remain visible.
  147. If this variable is non-nil, `gnus-ignored-headers' will be ignored."
  148. :type '(choice
  149. (repeat :value-to-internal (lambda (widget value)
  150. (custom-split-regexp-maybe value))
  151. :match (lambda (widget value)
  152. (or (stringp value)
  153. (widget-editable-list-match widget value)))
  154. regexp)
  155. (const :tag "Use gnus-ignored-headers" nil)
  156. regexp)
  157. :group 'gnus-article-hiding)
  158. (defcustom gnus-sorted-header-list
  159. '("^From:" "^Subject:" "^Summary:" "^Keywords:" "^Newsgroups:"
  160. "^Followup-To:" "^To:" "^Cc:" "^Date:" "^Organization:")
  161. "*This variable is a list of regular expressions.
  162. If it is non-nil, headers that match the regular expressions will
  163. be placed first in the article buffer in the sequence specified by
  164. this list."
  165. :type '(repeat regexp)
  166. :group 'gnus-article-hiding)
  167. (defcustom gnus-boring-article-headers '(empty followup-to reply-to)
  168. "Headers that are only to be displayed if they have interesting data.
  169. Possible values in this list are:
  170. `empty' Headers with no content.
  171. `newsgroups' Newsgroup identical to Gnus group.
  172. `to-address' To identical to To-address.
  173. `to-list' To identical to To-list.
  174. `cc-list' CC identical to To-list.
  175. `followup-to' Followup-to identical to Newsgroups.
  176. `reply-to' Reply-to identical to From.
  177. `date' Date less than four days old.
  178. `long-to' To and/or Cc longer than 1024 characters.
  179. `many-to' Multiple To and/or Cc."
  180. :type '(set (const :tag "Headers with no content." empty)
  181. (const :tag "Newsgroups identical to Gnus group." newsgroups)
  182. (const :tag "To identical to To-address." to-address)
  183. (const :tag "To identical to To-list." to-list)
  184. (const :tag "CC identical to To-list." cc-list)
  185. (const :tag "Followup-to identical to Newsgroups." followup-to)
  186. (const :tag "Reply-to identical to From." reply-to)
  187. (const :tag "Date less than four days old." date)
  188. (const :tag "To and/or Cc longer than 1024 characters." long-to)
  189. (const :tag "Multiple To and/or Cc headers." many-to))
  190. :group 'gnus-article-hiding)
  191. (defcustom gnus-article-skip-boring nil
  192. "Skip over text that is not worth reading.
  193. By default, if you set this t, then Gnus will display citations and
  194. signatures, but will never scroll down to show you a page consisting
  195. only of boring text. Boring text is controlled by
  196. `gnus-article-boring-faces'."
  197. :version "22.1"
  198. :type 'boolean
  199. :group 'gnus-article-hiding)
  200. (defcustom gnus-signature-separator '("^-- $" "^-- *$")
  201. "Regexp matching signature separator.
  202. This can also be a list of regexps. In that case, it will be checked
  203. from head to tail looking for a separator. Searches will be done from
  204. the end of the buffer."
  205. :type '(choice :format "%{%t%}: %[Value Menu%]\n%v"
  206. (regexp)
  207. (repeat :tag "List of regexp" regexp))
  208. :group 'gnus-article-signature)
  209. (defcustom gnus-signature-limit nil
  210. "Provide a limit to what is considered a signature.
  211. If it is a number, no signature may not be longer (in characters) than
  212. that number. If it is a floating point number, no signature may be
  213. longer (in lines) than that number. If it is a function, the function
  214. will be called without any parameters, and if it returns nil, there is
  215. no signature in the buffer. If it is a string, it will be used as a
  216. regexp. If it matches, the text in question is not a signature.
  217. This can also be a list of the above values."
  218. :type '(choice (const nil)
  219. (integer :value 200)
  220. (number :value 4.0)
  221. function
  222. (regexp :value ".*"))
  223. :group 'gnus-article-signature)
  224. (defcustom gnus-hidden-properties
  225. ;; We use to have `intangible' here as well, but Emacs's command loop moves
  226. ;; point out of invisible text anyway, so `intangible' is clearly not
  227. ;; needed there. And XEmacs doesn't handle `intangible' anyway.
  228. '(invisible t)
  229. "Property list to use for hiding text."
  230. :type 'plist
  231. :group 'gnus-article-hiding)
  232. ;; Fixme: This isn't the right thing for mixed graphical and non-graphical
  233. ;; frames in a session.
  234. (defcustom gnus-article-x-face-command
  235. (if (featurep 'xemacs)
  236. (if (or (gnus-image-type-available-p 'xface)
  237. (gnus-image-type-available-p 'pbm))
  238. 'gnus-display-x-face-in-from
  239. "{ echo \
  240. '/* Format_version=1, Width=48, Height=48, Depth=1, Valid_bits_per_item=16 */'\
  241. ; uncompface; } | icontopbm | ee -")
  242. (if (gnus-image-type-available-p 'pbm)
  243. 'gnus-display-x-face-in-from
  244. "{ echo \
  245. '/* Format_version=1, Width=48, Height=48, Depth=1, Valid_bits_per_item=16 */'\
  246. ; uncompface; } | icontopbm | display -"))
  247. "*String or function to be executed to display an X-Face header.
  248. If it is a string, the command will be executed in a sub-shell
  249. asynchronously. The compressed face will be piped to this command."
  250. :type `(choice string
  251. (function-item gnus-display-x-face-in-from)
  252. function)
  253. :version "21.1"
  254. :group 'gnus-picon
  255. :group 'gnus-article-washing)
  256. (defcustom gnus-article-x-face-too-ugly nil
  257. "Regexp matching posters whose face shouldn't be shown automatically."
  258. :type '(choice regexp (const nil))
  259. :group 'gnus-article-washing)
  260. (defcustom gnus-article-banner-alist nil
  261. "Banner alist for stripping.
  262. For example,
  263. ((egroups . \"^[ \\t\\n]*-------------------+\\\\( \\\\(e\\\\|Yahoo! \\\\)Groups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))"
  264. :version "21.1"
  265. :type '(repeat (cons symbol regexp))
  266. :group 'gnus-article-washing)
  267. (gnus-define-group-parameter
  268. banner
  269. :variable-document
  270. "Alist of regexps (to match group names) and banner."
  271. :variable-group gnus-article-washing
  272. :parameter-type
  273. '(choice :tag "Banner"
  274. :value nil
  275. (const :tag "Remove signature" signature)
  276. (symbol :tag "Item in `gnus-article-banner-alist'" none)
  277. regexp
  278. (const :tag "None" nil))
  279. :parameter-document
  280. "If non-nil, specify how to remove `banners' from articles.
  281. Symbol `signature' means to remove signatures delimited by
  282. `gnus-signature-separator'. Any other symbol is used to look up a
  283. regular expression to match the banner in `gnus-article-banner-alist'.
  284. A string is used as a regular expression to match the banner
  285. directly.")
  286. (defcustom gnus-article-address-banner-alist nil
  287. "Alist of mail addresses and banners.
  288. Each element has the form (ADDRESS . BANNER), where ADDRESS is a regexp
  289. to match a mail address in the From: header, BANNER is one of a symbol
  290. `signature', an item in `gnus-article-banner-alist', a regexp and nil.
  291. If ADDRESS matches author's mail address, it will remove things like
  292. advertisements. For example:
  293. \((\"@yoo-hoo\\\\.co\\\\.jp\\\\\\='\" . \"\\n_+\\nDo You Yoo-hoo!\\\\?\\n.*\\n.*\\n\"))
  294. "
  295. :type '(repeat
  296. (cons
  297. (regexp :tag "Address")
  298. (choice :tag "Banner" :value nil
  299. (const :tag "Remove signature" signature)
  300. (symbol :tag "Item in `gnus-article-banner-alist'" none)
  301. regexp
  302. (const :tag "None" nil))))
  303. :version "22.1"
  304. :group 'gnus-article-washing)
  305. (defmacro gnus-emphasis-custom-with-format (&rest body)
  306. `(let ((format "\
  307. \\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\
  308. \\(\\([-,.;:!?\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)"))
  309. ,@body))
  310. (defun gnus-emphasis-custom-value-to-external (value)
  311. (gnus-emphasis-custom-with-format
  312. (if (consp (car value))
  313. (list (format format (car (car value)) (cdr (car value)))
  314. 2
  315. (if (nth 1 value) 2 3)
  316. (nth 2 value))
  317. value)))
  318. (defun gnus-emphasis-custom-value-to-internal (value)
  319. (gnus-emphasis-custom-with-format
  320. (let ((regexp (concat "\\`"
  321. (format (regexp-quote format)
  322. "\\([^()]+\\)" "\\([^()]+\\)")
  323. "\\'"))
  324. pattern)
  325. (if (string-match regexp (setq pattern (car value)))
  326. (list (cons (match-string 1 pattern) (match-string 2 pattern))
  327. (= (nth 2 value) 2)
  328. (nth 3 value))
  329. value))))
  330. (defcustom gnus-emphasis-alist
  331. (let ((types
  332. '(("\\*" "\\*" bold nil 2)
  333. ("_" "_" underline)
  334. ("/" "/" italic)
  335. ("_/" "/_" underline-italic)
  336. ("_\\*" "\\*_" underline-bold)
  337. ("\\*/" "/\\*" bold-italic)
  338. ("_\\*/" "/\\*_" underline-bold-italic))))
  339. (nconc
  340. (gnus-emphasis-custom-with-format
  341. (mapcar (lambda (spec)
  342. (list (format format (car spec) (cadr spec))
  343. (or (nth 3 spec) 2)
  344. (or (nth 4 spec) 3)
  345. (intern (format "gnus-emphasis-%s" (nth 2 spec)))))
  346. types))
  347. '(;; I've never seen anyone use this strikethru convention whereas I've
  348. ;; several times seen it triggered by normal text. --Stef
  349. ;; Miles suggests that this form is sometimes used but for italics,
  350. ;; so maybe we should map it to `italic'.
  351. ;; ("\\(\\s-\\|^\\)\\(-\\(\\(\\w\\|-[^-]\\)+\\)-\\)\\(\\s-\\|[?!.,;]\\)"
  352. ;; 2 3 gnus-emphasis-strikethru)
  353. ("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)"
  354. 2 3 gnus-emphasis-underline))))
  355. "*Alist that says how to fontify certain phrases.
  356. Each item looks like this:
  357. (\"_\\\\(\\\\w+\\\\)_\" 0 1 \\='underline)
  358. The first element is a regular expression to be matched. The second
  359. is a number that says what regular expression grouping used to find
  360. the entire emphasized word. The third is a number that says what
  361. regexp grouping should be displayed and highlighted. The fourth
  362. is the face used for highlighting."
  363. :type
  364. '(repeat
  365. (menu-choice
  366. :format "%[Customizing Style%]\n%v"
  367. :indent 2
  368. (group :tag "Default"
  369. :value ("" 0 0 default)
  370. :value-create
  371. (lambda (widget)
  372. (let ((value (widget-get
  373. (cadr (widget-get (widget-get widget :parent)
  374. :args))
  375. :value)))
  376. (if (not (eq (nth 2 value) 'default))
  377. (widget-put
  378. widget
  379. :value
  380. (gnus-emphasis-custom-value-to-external value))))
  381. (widget-group-value-create widget))
  382. regexp
  383. (integer :format "Match group: %v")
  384. (integer :format "Emphasize group: %v")
  385. face)
  386. (group :tag "Simple"
  387. :value (("_" . "_") nil default)
  388. (cons :format "%v"
  389. (regexp :format "Start regexp: %v")
  390. (regexp :format "End regexp: %v"))
  391. (boolean :format "Show start and end patterns: %[%v%]\n"
  392. :on " On " :off " Off ")
  393. face)))
  394. :get (lambda (symbol)
  395. (mapcar 'gnus-emphasis-custom-value-to-internal
  396. (default-value symbol)))
  397. :set (lambda (symbol value)
  398. (set-default symbol (mapcar 'gnus-emphasis-custom-value-to-external
  399. value)))
  400. :group 'gnus-article-emphasis)
  401. (defcustom gnus-emphasize-whitespace-regexp "^[ \t]+\\|[ \t]*\n"
  402. "A regexp to describe whitespace which should not be emphasized.
  403. Typical values are \"^[ \\t]+\\\\|[ \\t]*\\n\" and \"[ \\t]+\\\\|[ \\t]*\\n\".
  404. The former avoids underlining of leading and trailing whitespace,
  405. and the latter avoids underlining any whitespace at all."
  406. :version "21.1"
  407. :group 'gnus-article-emphasis
  408. :type 'regexp)
  409. (defface gnus-emphasis-bold '((t (:bold t)))
  410. "Face used for displaying strong emphasized text (*word*)."
  411. :group 'gnus-article-emphasis)
  412. (defface gnus-emphasis-italic '((t (:italic t)))
  413. "Face used for displaying italic emphasized text (/word/)."
  414. :group 'gnus-article-emphasis)
  415. (defface gnus-emphasis-underline '((t (:underline t)))
  416. "Face used for displaying underlined emphasized text (_word_)."
  417. :group 'gnus-article-emphasis)
  418. (defface gnus-emphasis-underline-bold '((t (:bold t :underline t)))
  419. "Face used for displaying underlined bold emphasized text (_*word*_)."
  420. :group 'gnus-article-emphasis)
  421. (defface gnus-emphasis-underline-italic '((t (:italic t :underline t)))
  422. "Face used for displaying underlined italic emphasized text (_/word/_)."
  423. :group 'gnus-article-emphasis)
  424. (defface gnus-emphasis-bold-italic '((t (:bold t :italic t)))
  425. "Face used for displaying bold italic emphasized text (/*word*/)."
  426. :group 'gnus-article-emphasis)
  427. (defface gnus-emphasis-underline-bold-italic
  428. '((t (:bold t :italic t :underline t)))
  429. "Face used for displaying underlined bold italic emphasized text.
  430. Example: (_/*word*/_)."
  431. :group 'gnus-article-emphasis)
  432. (defface gnus-emphasis-strikethru (if (featurep 'xemacs)
  433. '((t (:strikethru t)))
  434. '((t (:strike-through t))))
  435. "Face used for displaying strike-through text (-word-)."
  436. :group 'gnus-article-emphasis)
  437. (defface gnus-emphasis-highlight-words
  438. '((t (:background "black" :foreground "yellow")))
  439. "Face used for displaying highlighted words."
  440. :group 'gnus-article-emphasis)
  441. (defcustom gnus-article-time-format "%a, %d %b %Y %T %Z"
  442. "Format for display of Date headers in article bodies.
  443. See `format-time-string' for the possible values.
  444. The variable can also be function, which should return a complete Date
  445. header. The function is called with one argument, the time, which can
  446. be fed to `format-time-string'."
  447. :type '(choice string function)
  448. :link '(custom-manual "(gnus)Article Date")
  449. :group 'gnus-article-washing)
  450. (defcustom gnus-save-all-headers t
  451. "*If non-nil, don't remove any headers before saving.
  452. This will be overridden by the `:headers' property that the symbol of
  453. the saver function, which is specified by `gnus-default-article-saver',
  454. might have."
  455. :group 'gnus-article-saving
  456. :type 'boolean)
  457. (defcustom gnus-prompt-before-saving 'always
  458. "*This variable says how much prompting is to be done when saving articles.
  459. If it is nil, no prompting will be done, and the articles will be
  460. saved to the default files. If this variable is `always', each and
  461. every article that is saved will be preceded by a prompt, even when
  462. saving large batches of articles. If this variable is neither nil not
  463. `always', there the user will be prompted once for a file name for
  464. each invocation of the saving commands."
  465. :group 'gnus-article-saving
  466. :type '(choice (item always)
  467. (item :tag "never" nil)
  468. (sexp :tag "once" :format "%t\n" :value t)))
  469. (defcustom gnus-article-show-cursor nil
  470. "If non-nil, show the cursor in the Article buffer even when not selected."
  471. :version "25.1"
  472. :group 'gnus-article
  473. :type 'bool)
  474. (defcustom gnus-saved-headers gnus-visible-headers
  475. "Headers to keep if `gnus-save-all-headers' is nil.
  476. If `gnus-save-all-headers' is non-nil, this variable will be ignored.
  477. If that variable is nil, however, all headers that match this regexp
  478. will be kept while the rest will be deleted before saving. This and
  479. `gnus-save-all-headers' will be overridden by the `:headers' property
  480. that the symbol of the saver function, which is specified by
  481. `gnus-default-article-saver', might have."
  482. :group 'gnus-article-saving
  483. :type 'regexp)
  484. ;; Note that "Rmail format" is mbox since Emacs 23, but Babyl before.
  485. (defcustom gnus-default-article-saver 'gnus-summary-save-in-rmail
  486. "A function to save articles in your favorite format.
  487. The function will be called by way of the `gnus-summary-save-article'
  488. command, and friends such as `gnus-summary-save-article-rmail'.
  489. Gnus provides the following functions:
  490. * gnus-summary-save-in-rmail (Rmail format)
  491. * gnus-summary-save-in-mail (Unix mail format)
  492. * gnus-summary-save-in-folder (MH folder)
  493. * gnus-summary-save-in-file (article format)
  494. * gnus-summary-save-body-in-file (article body)
  495. * gnus-summary-save-in-vm (use VM's folder format)
  496. * gnus-summary-write-to-file (article format -- overwrite)
  497. * gnus-summary-write-body-to-file (article body -- overwrite)
  498. * gnus-summary-save-in-pipe (article format)
  499. The symbol of each function may have the following properties:
  500. * :decode
  501. The value non-nil means save decoded articles. This is meaningful
  502. only with `gnus-summary-save-in-file', `gnus-summary-save-body-in-file',
  503. `gnus-summary-write-to-file', `gnus-summary-write-body-to-file', and
  504. `gnus-summary-save-in-pipe'.
  505. * :function
  506. The value specifies an alternative function which appends, not
  507. overwrites, articles to a file. This implies that when saving many
  508. articles at a time, `gnus-prompt-before-saving' is bound to t and all
  509. articles are saved in a single file. This is meaningful only with
  510. `gnus-summary-write-to-file' and `gnus-summary-write-body-to-file'.
  511. * :headers
  512. The value specifies the symbol of a variable of which the value
  513. specifies headers to be saved. If it is omitted,
  514. `gnus-save-all-headers' and `gnus-saved-headers' control what
  515. headers should be saved."
  516. :group 'gnus-article-saving
  517. :type '(radio (function-item gnus-summary-save-in-rmail)
  518. (function-item gnus-summary-save-in-mail)
  519. (function-item gnus-summary-save-in-folder)
  520. (function-item gnus-summary-save-in-file)
  521. (function-item gnus-summary-save-body-in-file)
  522. (function-item gnus-summary-save-in-vm)
  523. (function-item gnus-summary-write-to-file)
  524. (function-item gnus-summary-write-body-to-file)
  525. (function-item gnus-summary-save-in-pipe)
  526. (function)))
  527. (defcustom gnus-article-save-coding-system
  528. (or (and (mm-coding-system-p 'utf-8) 'utf-8)
  529. (and (mm-coding-system-p 'iso-2022-7bit) 'iso-2022-7bit)
  530. (and (mm-coding-system-p 'emacs-mule) 'emacs-mule)
  531. (and (mm-coding-system-p 'escape-quoted) 'escape-quoted))
  532. "Coding system used to save decoded articles to a file.
  533. The recommended coding systems are `utf-8', `iso-2022-7bit' and so on,
  534. which can safely encode any characters in text. This is used by the
  535. commands including:
  536. * gnus-summary-save-article-file
  537. * gnus-summary-save-article-body-file
  538. * gnus-summary-write-article-file
  539. * gnus-summary-write-article-body-file
  540. and the functions to which you may set `gnus-default-article-saver':
  541. * gnus-summary-save-in-file
  542. * gnus-summary-save-body-in-file
  543. * gnus-summary-write-to-file
  544. * gnus-summary-write-body-to-file
  545. Those commands and functions save just text displayed in the article
  546. buffer to a file if the value of this variable is non-nil. Note that
  547. buttonized MIME parts will be lost in a saved file in that case.
  548. Otherwise, raw articles will be saved."
  549. :group 'gnus-article-saving
  550. :type `(choice
  551. :format "%{%t%}:\n %[Value Menu%] %v"
  552. (const :tag "Save raw articles" nil)
  553. ,@(delq nil
  554. (mapcar
  555. (lambda (arg) (if (mm-coding-system-p (nth 3 arg)) arg))
  556. '((const :tag "UTF-8" utf-8)
  557. (const :tag "iso-2022-7bit" iso-2022-7bit)
  558. (const :tag "Emacs internal" emacs-mule)
  559. (const :tag "escape-quoted" escape-quoted))))
  560. (symbol :tag "Coding system")))
  561. (defcustom gnus-rmail-save-name 'gnus-plain-save-name
  562. "A function generating a file name to save articles in Rmail format.
  563. The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE."
  564. :group 'gnus-article-saving
  565. :type 'function)
  566. (defcustom gnus-mail-save-name 'gnus-plain-save-name
  567. "A function generating a file name to save articles in Unix mail format.
  568. The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE."
  569. :group 'gnus-article-saving
  570. :type 'function)
  571. (defcustom gnus-folder-save-name 'gnus-folder-save-name
  572. "A function generating a file name to save articles in MH folder.
  573. The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER."
  574. :group 'gnus-article-saving
  575. :type 'function)
  576. (defcustom gnus-file-save-name 'gnus-numeric-save-name
  577. "A function generating a file name to save articles in article format.
  578. The function is called with NEWSGROUP, HEADERS, and optional
  579. LAST-FILE."
  580. :group 'gnus-article-saving
  581. :type 'function)
  582. (defcustom gnus-split-methods
  583. '((gnus-article-archive-name)
  584. (gnus-article-nndoc-name))
  585. "*Variable used to suggest where articles are to be saved.
  586. For instance, if you would like to save articles related to Gnus in
  587. the file \"gnus-stuff\", and articles related to VM in \"vm-stuff\",
  588. you could set this variable to something like:
  589. ((\"^Subject:.*gnus\\|^Newsgroups:.*gnus\" \"gnus-stuff\")
  590. (\"^Subject:.*vm\\|^Xref:.*vm\" \"vm-stuff\"))
  591. This variable is an alist where the key is the match and the
  592. value is a list of possible files to save in if the match is
  593. non-nil.
  594. If the match is a string, it is used as a regexp match on the
  595. article. If the match is a symbol, that symbol will be funcalled
  596. from the buffer of the article to be saved with the newsgroup as the
  597. parameter. If it is a list, it will be evalled in the same buffer.
  598. If this form or function returns a string, this string will be used as a
  599. possible file name; and if it returns a non-nil list, that list will be
  600. used as possible file names."
  601. :group 'gnus-article-saving
  602. :type '(repeat (choice (list :value (fun) function)
  603. (cons :value ("" "") regexp (repeat string))
  604. (sexp :value nil))))
  605. (defcustom gnus-page-delimiter "^\^L"
  606. "*Regexp describing what to use as article page delimiters.
  607. The default value is \"^\^L\", which is a form linefeed at the
  608. beginning of a line."
  609. :type 'regexp
  610. :group 'gnus-article-various)
  611. (defcustom gnus-article-mode-line-format "Gnus: %g %S%m"
  612. "*The format specification for the article mode line.
  613. See `gnus-summary-mode-line-format' for a closer description.
  614. The following additional specs are available:
  615. %w The article washing status.
  616. %m The number of MIME parts in the article."
  617. :version "24.1"
  618. :type 'string
  619. :group 'gnus-article-various)
  620. (defcustom gnus-article-mode-hook nil
  621. "*A hook for Gnus article mode."
  622. :type 'hook
  623. :group 'gnus-article-various)
  624. (when (featurep 'xemacs)
  625. ;; Extracted from gnus-xmas-define in order to preserve user settings
  626. (when (fboundp 'turn-off-scroll-in-place)
  627. (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place))
  628. ;; Extracted from gnus-xmas-redefine in order to preserve user settings
  629. (add-hook 'gnus-article-mode-hook 'gnus-xmas-article-menu-add))
  630. (defcustom gnus-article-menu-hook nil
  631. "*Hook run after the creation of the article mode menu."
  632. :type 'hook
  633. :group 'gnus-article-various)
  634. (defcustom gnus-article-prepare-hook nil
  635. "*A hook called after an article has been prepared in the article buffer."
  636. :type 'hook
  637. :group 'gnus-article-various)
  638. (defcustom gnus-copy-article-ignored-headers nil
  639. "List of headers to be removed when copying an article.
  640. Each element is a regular expression."
  641. :version "23.1" ;; No Gnus
  642. :type '(repeat regexp)
  643. :group 'gnus-article-various)
  644. (make-obsolete-variable 'gnus-article-hide-pgp-hook nil
  645. "Gnus 5.10 (Emacs 22.1)")
  646. (defface gnus-button
  647. '((t (:weight bold)))
  648. "Face used for highlighting a button in the article buffer."
  649. :group 'gnus-article-buttons)
  650. (defcustom gnus-article-button-face 'gnus-button
  651. "Face used for highlighting buttons in the article buffer.
  652. An article button is a piece of text that you can activate by pressing
  653. `RET' or `mouse-2' above it."
  654. :type 'face
  655. :group 'gnus-article-buttons)
  656. (defcustom gnus-article-mouse-face 'highlight
  657. "Face used for mouse highlighting in the article buffer.
  658. Article buttons will be displayed in this face when the cursor is
  659. above them."
  660. :type 'face
  661. :group 'gnus-article-buttons)
  662. (defcustom gnus-signature-face 'gnus-signature
  663. "Face used for highlighting a signature in the article buffer.
  664. Obsolete; use the face `gnus-signature' for customizations instead."
  665. :type 'face
  666. :group 'gnus-article-highlight
  667. :group 'gnus-article-signature)
  668. (defface gnus-signature
  669. '((t
  670. (:italic t)))
  671. "Face used for highlighting a signature in the article buffer."
  672. :group 'gnus-article-highlight
  673. :group 'gnus-article-signature)
  674. ;; backward-compatibility alias
  675. (put 'gnus-signature-face 'face-alias 'gnus-signature)
  676. (put 'gnus-signature-face 'obsolete-face "22.1")
  677. (defface gnus-header-from
  678. '((((class color)
  679. (background dark))
  680. (:foreground "PaleGreen1"))
  681. (((class color)
  682. (background light))
  683. (:foreground "red3"))
  684. (t
  685. (:italic t)))
  686. "Face used for displaying from headers."
  687. :group 'gnus-article-headers
  688. :group 'gnus-article-highlight)
  689. ;; backward-compatibility alias
  690. (put 'gnus-header-from-face 'face-alias 'gnus-header-from)
  691. (put 'gnus-header-from-face 'obsolete-face "22.1")
  692. (defface gnus-header-subject
  693. '((((class color)
  694. (background dark))
  695. (:foreground "SeaGreen1"))
  696. (((class color)
  697. (background light))
  698. (:foreground "red4"))
  699. (t
  700. (:bold t :italic t)))
  701. "Face used for displaying subject headers."
  702. :group 'gnus-article-headers
  703. :group 'gnus-article-highlight)
  704. ;; backward-compatibility alias
  705. (put 'gnus-header-subject-face 'face-alias 'gnus-header-subject)
  706. (put 'gnus-header-subject-face 'obsolete-face "22.1")
  707. (defface gnus-header-newsgroups
  708. '((((class color)
  709. (background dark))
  710. (:foreground "yellow" :italic t))
  711. (((class color)
  712. (background light))
  713. (:foreground "MidnightBlue" :italic t))
  714. (t
  715. (:italic t)))
  716. "Face used for displaying newsgroups headers.
  717. In the default setup this face is only used for crossposted
  718. articles."
  719. :group 'gnus-article-headers
  720. :group 'gnus-article-highlight)
  721. ;; backward-compatibility alias
  722. (put 'gnus-header-newsgroups-face 'face-alias 'gnus-header-newsgroups)
  723. (put 'gnus-header-newsgroups-face 'obsolete-face "22.1")
  724. (defface gnus-header-name
  725. '((((class color)
  726. (background dark))
  727. (:foreground "SpringGreen2"))
  728. (((class color)
  729. (background light))
  730. (:foreground "maroon"))
  731. (t
  732. (:bold t)))
  733. "Face used for displaying header names."
  734. :group 'gnus-article-headers
  735. :group 'gnus-article-highlight)
  736. ;; backward-compatibility alias
  737. (put 'gnus-header-name-face 'face-alias 'gnus-header-name)
  738. (put 'gnus-header-name-face 'obsolete-face "22.1")
  739. (defface gnus-header-content
  740. '((((class color)
  741. (background dark))
  742. (:foreground "SpringGreen1" :italic t))
  743. (((class color)
  744. (background light))
  745. (:foreground "indianred4" :italic t))
  746. (t
  747. (:italic t))) "Face used for displaying header content."
  748. :group 'gnus-article-headers
  749. :group 'gnus-article-highlight)
  750. ;; backward-compatibility alias
  751. (put 'gnus-header-content-face 'face-alias 'gnus-header-content)
  752. (put 'gnus-header-content-face 'obsolete-face "22.1")
  753. (defcustom gnus-header-face-alist
  754. '(("From" nil gnus-header-from)
  755. ("Subject" nil gnus-header-subject)
  756. ("Newsgroups:.*," nil gnus-header-newsgroups)
  757. ("" gnus-header-name gnus-header-content))
  758. "*Controls highlighting of article headers.
  759. An alist of the form (HEADER NAME CONTENT).
  760. HEADER is a regular expression which should match the name of a
  761. header and NAME and CONTENT are either face names or nil.
  762. The name of each header field will be displayed using the face
  763. specified by the first element in the list where HEADER matches
  764. the header name and NAME is non-nil. Similarly, the content will
  765. be displayed by the first non-nil matching CONTENT face."
  766. :group 'gnus-article-headers
  767. :group 'gnus-article-highlight
  768. :type '(repeat (list (regexp :tag "Header")
  769. (choice :tag "Name"
  770. (item :tag "skip" nil)
  771. (face :value default))
  772. (choice :tag "Content"
  773. (item :tag "skip" nil)
  774. (face :value default)))))
  775. (defcustom gnus-face-properties-alist (if (featurep 'xemacs)
  776. '((xface . (:face gnus-x-face)))
  777. '((pbm . (:face gnus-x-face))
  778. (png . nil)))
  779. "Alist of image types and properties applied to Face and X-Face images.
  780. Here are examples:
  781. ;; Specify the altitude of Face images in the From header.
  782. \(setq gnus-face-properties-alist
  783. \\='((pbm . (:face gnus-x-face :ascent 80))
  784. (png . (:ascent 80))))
  785. ;; Show Face images as pressed buttons.
  786. \(setq gnus-face-properties-alist
  787. \\='((pbm . (:face gnus-x-face :relief -2))
  788. (png . (:relief -2))))
  789. See the manual for the valid properties for various image types.
  790. Currently, `pbm' is used for X-Face images and `png' is used for Face
  791. images in Emacs. Only the `:face' property is effective on the `xface'
  792. image type in XEmacs if it is built with the libcompface library."
  793. :version "23.1" ;; No Gnus
  794. :group 'gnus-article-headers
  795. :type '(repeat (cons :format "%v" (symbol :tag "Image type") plist)))
  796. (defcustom gnus-article-decode-hook
  797. '(article-decode-charset article-decode-encoded-words
  798. article-decode-group-name article-decode-idna-rhs)
  799. "*Hook run to decode charsets in articles."
  800. :group 'gnus-article-headers
  801. :type 'hook)
  802. (defcustom gnus-display-mime-function 'gnus-display-mime
  803. "Function to display MIME articles."
  804. :group 'gnus-article-mime
  805. :type 'function)
  806. (defvar gnus-decode-header-function 'mail-decode-encoded-word-region
  807. "Function used to decode headers.")
  808. (defvar gnus-decode-address-function 'mail-decode-encoded-address-region
  809. "Function used to decode addresses.")
  810. (defvar gnus-article-dumbquotes-map
  811. '((?\200 "EUR")
  812. (?\202 ",")
  813. (?\203 "f")
  814. (?\204 ",,")
  815. (?\205 "...")
  816. (?\213 "<")
  817. (?\214 "OE")
  818. (?\221 "`")
  819. (?\222 "'")
  820. (?\223 "``")
  821. (?\224 "\"")
  822. (?\225 "*")
  823. (?\226 "-")
  824. (?\227 "--")
  825. (?\230 "~")
  826. (?\231 "(TM)")
  827. (?\233 ">")
  828. (?\234 "oe")
  829. (?\264 "'"))
  830. "Table for MS-to-Latin1 translation.")
  831. (defcustom gnus-ignored-mime-types nil
  832. "List of MIME types that should be ignored by Gnus."
  833. :version "21.1"
  834. :group 'gnus-article-mime
  835. :type '(repeat regexp))
  836. (defcustom gnus-unbuttonized-mime-types '(".*/.*")
  837. "List of MIME types that should not be given buttons when rendered inline.
  838. See also `gnus-buttonized-mime-types' which may override this variable.
  839. This variable is only used when `gnus-inhibit-mime-unbuttonizing' is nil."
  840. :version "21.1"
  841. :group 'gnus-article-mime
  842. :type '(repeat regexp))
  843. (defcustom gnus-buttonized-mime-types nil
  844. "List of MIME types that should be given buttons when rendered inline.
  845. If set, this variable overrides `gnus-unbuttonized-mime-types'.
  846. To see e.g. security buttons you could set this to
  847. `(\"multipart/signed\")'. You could also add \"multipart/alternative\" to
  848. this list to display radio buttons that allow you to choose one of two
  849. media types those mails include. See also `mm-discouraged-alternatives'.
  850. This variable is only used when `gnus-inhibit-mime-unbuttonizing' is nil."
  851. :version "22.1"
  852. :group 'gnus-article-mime
  853. :type '(repeat regexp))
  854. (defcustom gnus-inhibit-mime-unbuttonizing nil
  855. "If non-nil, all MIME parts get buttons.
  856. When nil (the default value), then some MIME parts do not get buttons,
  857. as described by the variables `gnus-buttonized-mime-types' and
  858. `gnus-unbuttonized-mime-types'."
  859. :version "22.1"
  860. :group 'gnus-article-mime
  861. :type 'boolean)
  862. (defcustom gnus-body-boundary-delimiter "_"
  863. "String used to delimit header and body.
  864. This variable is used by `gnus-article-treat-body-boundary' which can
  865. be controlled by `gnus-treat-body-boundary'."
  866. :version "22.1"
  867. :group 'gnus-article-various
  868. :type '(choice (item :tag "None" :value nil)
  869. string))
  870. (defcustom gnus-picon-databases '("/usr/lib/picon" "/usr/local/faces"
  871. "/usr/share/picons")
  872. "Defines the location of the faces database.
  873. For information on obtaining this database of pretty pictures, please
  874. see http://www.cs.indiana.edu/picons/ftp/index.html"
  875. :version "22.1"
  876. :type '(repeat directory)
  877. :link '(url-link :tag "download"
  878. "http://www.cs.indiana.edu/picons/ftp/index.html")
  879. :link '(custom-manual "(gnus)Picons")
  880. :group 'gnus-picon)
  881. (defun gnus-picons-installed-p ()
  882. "Say whether picons are installed on your machine."
  883. (let ((installed nil))
  884. (dolist (database gnus-picon-databases)
  885. (when (file-exists-p database)
  886. (setq installed t)))
  887. installed))
  888. (defcustom gnus-article-mime-part-function nil
  889. "Function called with a MIME handle as the argument.
  890. This is meant for people who want to do something automatic based
  891. on parts -- for instance, adding Vcard info to a database."
  892. :group 'gnus-article-mime
  893. :type '(choice (const nil)
  894. function))
  895. (defcustom gnus-mime-multipart-functions nil
  896. "An alist of MIME types to functions to display them."
  897. :version "21.1"
  898. :group 'gnus-article-mime
  899. :type '(repeat (cons :format "%v" (string :tag "MIME type") function)))
  900. (defcustom gnus-article-date-headers '(combined-lapsed)
  901. "A list of Date header formats to display.
  902. Valid formats are `ut' (Universal Time), `local' (local time
  903. zone), `english' (readable English), `lapsed' (elapsed time),
  904. `combined-lapsed' (both the original date and the elapsed time),
  905. `original' (the original date header), `iso8601' (ISO8601
  906. format), and `user-defined' (a user-defined format defined by the
  907. `gnus-article-time-format' variable).
  908. You have as many date headers as you want in the article buffer.
  909. Some of these headers are updated automatically. See
  910. `gnus-article-update-date-headers' for details."
  911. :version "24.1"
  912. :group 'gnus-article-headers
  913. :type '(set
  914. (const :tag "Universal time (UT)" ut)
  915. (const :tag "Local time zone" local)
  916. (const :tag "Readable English" english)
  917. (const :tag "Elapsed time" lapsed)
  918. (const :tag "Original and elapsed time" combined-lapsed)
  919. (const :tag "Original date header" original)
  920. (const :tag "ISO8601 format" iso8601)
  921. (const :tag "User-defined" user-defined)))
  922. (defcustom gnus-article-update-date-headers nil
  923. "A number that says how often to update the date header (in seconds).
  924. If nil, don't update it at all."
  925. :version "24.1"
  926. :group 'gnus-article-headers
  927. :type '(choice
  928. (item :tag "Don't update" :value nil)
  929. integer))
  930. (defcustom gnus-article-mime-match-handle-function 'undisplayed-alternative
  931. "Function called with a MIME handle as the argument.
  932. This is meant for people who want to view first matched part.
  933. For `undisplayed-alternative' (default), the first undisplayed
  934. part or alternative part is used. For `undisplayed', the first
  935. undisplayed part is used. For a function, the first part which
  936. the function return t is used. For nil, the first part is
  937. used."
  938. :version "21.1"
  939. :group 'gnus-article-mime
  940. :type '(choice
  941. (item :tag "first" :value nil)
  942. (item :tag "undisplayed" :value undisplayed)
  943. (item :tag "undisplayed or alternative"
  944. :value undisplayed-alternative)
  945. (function)))
  946. (defcustom gnus-mime-action-alist
  947. '(("save to file" . gnus-mime-save-part)
  948. ("save and strip" . gnus-mime-save-part-and-strip)
  949. ("replace with file" . gnus-mime-replace-part)
  950. ("delete part" . gnus-mime-delete-part)
  951. ("display as text" . gnus-mime-inline-part)
  952. ("view the part" . gnus-mime-view-part)
  953. ("pipe to command" . gnus-mime-pipe-part)
  954. ("toggle display" . gnus-article-press-button)
  955. ("toggle display" . gnus-article-view-part-as-charset)
  956. ("view as type" . gnus-mime-view-part-as-type)
  957. ("view internally" . gnus-mime-view-part-internally)
  958. ("view externally" . gnus-mime-view-part-externally))
  959. "An alist of actions that run on the MIME attachment."
  960. :group 'gnus-article-mime
  961. :type '(repeat (cons (string :tag "name")
  962. (function))))
  963. (defcustom gnus-auto-select-part 1
  964. "Advance to next MIME part when deleting or stripping parts.
  965. When 0, point will be placed on the same part as before. When
  966. positive (negative), move point forward (backwards) this many
  967. parts. When nil, redisplay article."
  968. :version "23.1" ;; No Gnus
  969. :group 'gnus-article-mime
  970. :type '(choice (const nil :tag "Redisplay article.")
  971. (const 1 :tag "Next part.")
  972. (const 0 :tag "Current part.")
  973. integer))
  974. ;;;
  975. ;;; The treatment variables
  976. ;;;
  977. (defvar gnus-part-display-hook nil
  978. "Hook called on parts that are to receive treatment.")
  979. (defvar gnus-article-treat-custom
  980. '(choice (const :tag "Off" nil)
  981. (const :tag "On" t)
  982. (const :tag "Header" head)
  983. (const :tag "First" first)
  984. (const :tag "Last" last)
  985. (integer :tag "Less")
  986. (repeat :tag "Groups" regexp)
  987. (sexp :tag "Predicate")))
  988. (defvar gnus-article-treat-head-custom
  989. '(choice (const :tag "Off" nil)
  990. (const :tag "Header" head)))
  991. (defvar gnus-article-treat-types '("text/plain" "text/x-verbatim"
  992. "text/x-patch" "text/html")
  993. "Part types eligible for treatment.")
  994. (defvar gnus-inhibit-treatment nil
  995. "Whether to inhibit treatment.")
  996. (defcustom gnus-treat-highlight-signature '(or t (typep "text/x-vcard"))
  997. "Highlight the signature.
  998. Valid values are nil, t, `head', `first', `last', an integer or a
  999. predicate. See Info node `(gnus)Customizing Articles'."
  1000. :group 'gnus-article-treat
  1001. :link '(custom-manual "(gnus)Customizing Articles")
  1002. :type gnus-article-treat-custom)
  1003. (put 'gnus-treat-highlight-signature 'highlight t)
  1004. (defcustom gnus-treat-buttonize '(and 100000 (typep "text/plain"))
  1005. "Add buttons.
  1006. Valid values are nil, t, `head', `first', `last', an integer or a
  1007. predicate. See Info node `(gnus)Customizing Articles'."
  1008. :group 'gnus-article-treat
  1009. :link '(custom-manual "(gnus)Customizing Articles")
  1010. :type gnus-article-treat-custom)
  1011. (put 'gnus-treat-buttonize 'highlight t)
  1012. (defcustom gnus-treat-buttonize-head 'head
  1013. "Add buttons to the head.
  1014. Valid values are nil, t, `head', `first', `last', an integer or a
  1015. predicate. See Info node `(gnus)Customizing Articles'."
  1016. :group 'gnus-article-treat
  1017. :link '(custom-manual "(gnus)Customizing Articles")
  1018. :type gnus-article-treat-head-custom)
  1019. (put 'gnus-treat-buttonize-head 'highlight t)
  1020. (defcustom gnus-treat-date 'head
  1021. "Display dates according to the `gnus-article-date-headers' variable.
  1022. Valid values are nil, t, `head', `first', `last', an integer or a
  1023. predicate. See Info node `(gnus)Customizing Articles'."
  1024. :version "24.1"
  1025. :group 'gnus-article-treat
  1026. :link '(custom-manual "(gnus)Customizing Articles")
  1027. :type gnus-article-treat-head-custom)
  1028. (defcustom gnus-treat-emphasize 50000
  1029. "Emphasize text.
  1030. Valid values are nil, t, `head', `first', `last', an integer or a
  1031. predicate. See Info node `(gnus)Customizing Articles'."
  1032. :group 'gnus-article-treat
  1033. :link '(custom-manual "(gnus)Customizing Articles")
  1034. :type gnus-article-treat-custom)
  1035. (put 'gnus-treat-emphasize 'highlight t)
  1036. (defcustom gnus-treat-strip-cr nil
  1037. "Remove carriage returns.
  1038. Valid values are nil, t, `head', `first', `last', an integer or a
  1039. predicate. See Info node `(gnus)Customizing Articles'."
  1040. :version "22.1"
  1041. :group 'gnus-article-treat
  1042. :link '(custom-manual "(gnus)Customizing Articles")
  1043. :type gnus-article-treat-custom)
  1044. (defcustom gnus-treat-unsplit-urls nil
  1045. "Remove newlines from within URLs.
  1046. Valid values are nil, t, `head', `first', `last', an integer or a
  1047. predicate. See Info node `(gnus)Customizing Articles'."
  1048. :version "22.1"
  1049. :group 'gnus-article-treat
  1050. :link '(custom-manual "(gnus)Customizing Articles")
  1051. :type gnus-article-treat-custom)
  1052. (defcustom gnus-treat-leading-whitespace nil
  1053. "Remove leading whitespace in headers.
  1054. Valid values are nil, t, `head', `first', `last', an integer or a
  1055. predicate. See Info node `(gnus)Customizing Articles'."
  1056. :version "22.1"
  1057. :group 'gnus-article-treat
  1058. :link '(custom-manual "(gnus)Customizing Articles")
  1059. :type gnus-article-treat-custom)
  1060. (defcustom gnus-treat-hide-headers 'head
  1061. "Hide headers.
  1062. Valid values are nil, t, `head', `first', `last', an integer or a
  1063. predicate. See Info node `(gnus)Customizing Articles'."
  1064. :group 'gnus-article-treat
  1065. :link '(custom-manual "(gnus)Customizing Articles")
  1066. :type gnus-article-treat-head-custom)
  1067. (defcustom gnus-treat-hide-boring-headers nil
  1068. "Hide boring headers.
  1069. Valid values are nil, t, `head', `first', `last', an integer or a
  1070. predicate. See Info node `(gnus)Customizing Articles'."
  1071. :group 'gnus-article-treat
  1072. :link '(custom-manual "(gnus)Customizing Articles")
  1073. :type gnus-article-treat-head-custom)
  1074. (defcustom gnus-treat-hide-signature nil
  1075. "Hide the signature.
  1076. Valid values are nil, t, `head', `first', `last', an integer or a
  1077. predicate. See Info node `(gnus)Customizing Articles'."
  1078. :group 'gnus-article-treat
  1079. :link '(custom-manual "(gnus)Customizing Articles")
  1080. :type gnus-article-treat-custom)
  1081. (defcustom gnus-treat-fill-article nil
  1082. "Fill the article.
  1083. Valid values are nil, t, `head', `first', `last', an integer or a
  1084. predicate. See Info node `(gnus)Customizing Articles'."
  1085. :group 'gnus-article-treat
  1086. :link '(custom-manual "(gnus)Customizing Articles")
  1087. :type gnus-article-treat-custom)
  1088. (defcustom gnus-treat-hide-citation nil
  1089. "Hide cited text.
  1090. Valid values are nil, t, `head', `first', `last', an integer or a
  1091. predicate. See Info node `(gnus)Customizing Articles'.
  1092. See `gnus-article-highlight-citation' for variables used to
  1093. control what it hides."
  1094. :group 'gnus-article-treat
  1095. :link '(custom-manual "(gnus)Customizing Articles")
  1096. :type gnus-article-treat-custom)
  1097. (defcustom gnus-treat-hide-citation-maybe nil
  1098. "Hide cited text according to certain conditions.
  1099. Valid values are nil, t, `head', `first', `last', an integer or a
  1100. predicate. See Info node `(gnus)Customizing Articles'.
  1101. See `gnus-cite-hide-percentage' and `gnus-cite-hide-absolute' for
  1102. how to control what it hides."
  1103. :group 'gnus-article-treat
  1104. :link '(custom-manual "(gnus)Customizing Articles")
  1105. :type gnus-article-treat-custom)
  1106. (defcustom gnus-treat-strip-list-identifiers 'head
  1107. "Strip list identifiers from `gnus-list-identifiers'.
  1108. Valid values are nil, t, `head', `first', `last', an integer or a
  1109. predicate. See Info node `(gnus)Customizing Articles'."
  1110. :version "21.1"
  1111. :group 'gnus-article-treat
  1112. :link '(custom-manual "(gnus)Customizing Articles")
  1113. :type gnus-article-treat-custom)
  1114. (gnus-define-group-parameter
  1115. list-identifier
  1116. :variable-document
  1117. "Alist of regexps and correspondent identifiers."
  1118. :variable-group gnus-article-washing
  1119. :parameter-type
  1120. '(choice :tag "Identifier"
  1121. :value nil
  1122. (symbol :tag "Item in `gnus-list-identifiers'" none)
  1123. regexp
  1124. (const :tag "None" nil))
  1125. :parameter-document
  1126. "If non-nil, specify how to remove `identifiers' from articles' subject.
  1127. Any symbol is used to look up a regular expression to match the
  1128. banner in `gnus-list-identifiers'. A string is used as a regular
  1129. expression to match the identifier directly.")
  1130. (make-obsolete-variable 'gnus-treat-strip-pgp nil
  1131. "Gnus 5.10 (Emacs 22.1)")
  1132. (defcustom gnus-treat-strip-pem nil
  1133. "Strip PEM signatures.
  1134. Valid values are nil, t, `head', `first', `last', an integer or a
  1135. predicate. See Info node `(gnus)Customizing Articles'."
  1136. :group 'gnus-article-treat
  1137. :link '(custom-manual "(gnus)Customizing Articles")
  1138. :type gnus-article-treat-custom)
  1139. (defcustom gnus-treat-strip-banner t
  1140. "Strip banners from articles.
  1141. The banner to be stripped is specified in the `banner' group parameter.
  1142. Valid values are nil, t, `head', `first', `last', an integer or a
  1143. predicate. See Info node `(gnus)Customizing Articles'."
  1144. :group 'gnus-article-treat
  1145. :link '(custom-manual "(gnus)Customizing Articles")
  1146. :type gnus-article-treat-custom)
  1147. (defcustom gnus-treat-highlight-headers 'head
  1148. "Highlight the headers.
  1149. Valid values are nil, t, `head', `first', `last', an integer or a
  1150. predicate. See Info node `(gnus)Customizing Articles'."
  1151. :group 'gnus-article-treat
  1152. :link '(custom-manual "(gnus)Customizing Articles")
  1153. :type gnus-article-treat-head-custom)
  1154. (put 'gnus-treat-highlight-headers 'highlight t)
  1155. (defcustom gnus-treat-highlight-citation t
  1156. "Highlight cited text.
  1157. Valid values are nil, t, `head', `first', `last', an integer or a
  1158. predicate. See Info node `(gnus)Customizing Articles'."
  1159. :group 'gnus-article-treat
  1160. :link '(custom-manual "(gnus)Customizing Articles")
  1161. :type gnus-article-treat-custom)
  1162. (put 'gnus-treat-highlight-citation 'highlight t)
  1163. (defcustom gnus-treat-strip-headers-in-body t
  1164. "Strip the X-No-Archive header line from the beginning of the body.
  1165. Valid values are nil, t, `head', `first', `last', an integer or a
  1166. predicate. See Info node `(gnus)Customizing Articles'."
  1167. :version "21.1"
  1168. :group 'gnus-article-treat
  1169. :link '(custom-manual "(gnus)Customizing Articles")
  1170. :type gnus-article-treat-custom)
  1171. (defcustom gnus-treat-strip-trailing-blank-lines nil
  1172. "Strip trailing blank lines.
  1173. Valid values are nil, t, `head', `first', `last', an integer or a
  1174. predicate. See Info node `(gnus)Customi

Large files files are truncated, but you can click here to view the full file