(spam-stat-test-directory): Skip 0 length files.
[gnus] / lisp / gnus-cite.el
1 ;;; gnus-cite.el --- parse citations in articles for Gnus
2
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 ;;        Free Software Foundation, Inc.
5
6 ;; Author: Per Abhiddenware
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;;; Code:
28
29 (eval-when-compile (require 'cl))
30
31 (require 'gnus)
32 (require 'gnus-range)
33 (require 'message)      ; for message-cite-prefix-regexp
34
35 ;;; Customization:
36
37 (defgroup gnus-cite nil
38   "Citation."
39   :prefix "gnus-cite-"
40   :link '(custom-manual "(gnus)Article Highlighting")
41   :group 'gnus-article)
42
43 (defcustom gnus-cited-opened-text-button-line-format "%(%{[-]%}%)\n"
44   "Format of opened cited text buttons."
45   :group 'gnus-cite
46   :type 'string)
47
48 (defcustom gnus-cited-closed-text-button-line-format "%(%{[+]%}%)\n"
49   "Format of closed cited text buttons."
50   :group 'gnus-cite
51   :type 'string)
52
53 (defcustom gnus-cited-lines-visible nil
54   "The number of lines of hidden cited text to remain visible.
55 Or a pair (cons) of numbers which are the number of lines at the top
56 and bottom of the text, respectively, to remain visible."
57   :group 'gnus-cite
58   :type '(choice (const :tag "none" nil)
59                  integer
60                  (cons :tag "Top and Bottom" integer integer)))
61
62 (defcustom gnus-cite-parse-max-size 25000
63   "Maximum article size (in bytes) where parsing citations is allowed.
64 Set it to nil to parse all articles."
65   :group 'gnus-cite
66   :type '(choice (const :tag "all" nil)
67                  integer))
68
69 (defcustom gnus-cite-max-prefix 20
70   "Maximum possible length for a citation prefix."
71   :group 'gnus-cite
72   :type 'integer)
73
74 (defcustom gnus-supercite-regexp
75   (concat "^\\(" message-cite-prefix-regexp "\\)? *"
76           ">>>>> +\"\\([^\"\n]+\\)\" +==")
77   "*Regexp matching normal Supercite attribution lines.
78 The first grouping must match prefixes added by other packages."
79   :group 'gnus-cite
80   :type 'regexp)
81
82 (defcustom gnus-supercite-secondary-regexp "^.*\"\\([^\"\n]+\\)\" +=="
83   "Regexp matching mangled Supercite attribution lines.
84 The first regexp group should match the Supercite attribution."
85   :group 'gnus-cite
86   :type 'regexp)
87
88 (defcustom gnus-cite-minimum-match-count 2
89   "Minimum number of identical prefixes before we believe it's a citation."
90   :group 'gnus-cite
91   :type 'integer)