Mercurial > emacs
annotate lisp/gnus/gnus-cite.el @ 63763:121f7f14ce00
(Equality Predicates): Clarify meaning of equal.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 25 Jun 2005 14:09:07 +0000 |
parents | 53e7abe8917f |
children | 18a818a2ee7c b7da78284d4c |
rev | line source |
---|---|
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1 ;;; gnus-cite.el --- parse citations in articles for Gnus |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
2 |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
4 ;; 2005 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
5 ;; Free Software Foundation, Inc. |
17493 | 6 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
7 ;; Author: Per Abhiddenware |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
8 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
10 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
11 ;; GNU Emacs is free software; you can redistribute it and/or modify |
17493 | 12 ;; it under the terms of the GNU General Public License as published by |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;;; Code: | |
29 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
31 |
17493 | 32 (require 'gnus) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
33 (require 'gnus-range) |
17493 | 34 (require 'gnus-art) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
35 (require 'message) ; for message-cite-prefix-regexp |
17493 | 36 |
37 ;;; Customization: | |
38 | |
39 (defgroup gnus-cite nil | |
40 "Citation." | |
41 :prefix "gnus-cite-" | |
42 :link '(custom-manual "(gnus)Article Highlighting") | |
43 :group 'gnus-article) | |
44 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
45 (defcustom gnus-cited-opened-text-button-line-format "%(%{[-]%}%)\n" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
46 "Format of opened cited text buttons." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
47 :group 'gnus-cite |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
48 :type 'string) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
49 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
50 (defcustom gnus-cited-closed-text-button-line-format "%(%{[+]%}%)\n" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
51 "Format of closed cited text buttons." |
17493 | 52 :group 'gnus-cite |
53 :type 'string) | |
54 | |
55 (defcustom gnus-cited-lines-visible nil | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
56 "The number of lines of hidden cited text to remain visible. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
57 Or a pair (cons) of numbers which are the number of lines at the top |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
58 and bottom of the text, respectively, to remain visible." |
17493 | 59 :group 'gnus-cite |
60 :type '(choice (const :tag "none" nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
61 integer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
62 (cons :tag "Top and Bottom" integer integer))) |
17493 | 63 |
64 (defcustom gnus-cite-parse-max-size 25000 | |
65 "Maximum article size (in bytes) where parsing citations is allowed. | |
66 Set it to nil to parse all articles." | |
67 :group 'gnus-cite | |
68 :type '(choice (const :tag "all" nil) | |
69 integer)) | |
70 | |
71 (defcustom gnus-cite-max-prefix 20 | |
72 "Maximum possible length for a citation prefix." | |
73 :group 'gnus-cite | |
74 :type 'integer) | |
75 | |
76 (defcustom gnus-supercite-regexp | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
77 (concat "^\\(" message-cite-prefix-regexp "\\)? *" |
17493 | 78 ">>>>> +\"\\([^\"\n]+\\)\" +==") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
79 "*Regexp matching normal Supercite attribution lines. |
17493 | 80 The first grouping must match prefixes added by other packages." |
81 :group 'gnus-cite | |
82 :type 'regexp) | |
83 | |
84 (defcustom gnus-supercite-secondary-regexp "^.*\"\\([^\"\n]+\\)\" +==" | |
85 "Regexp matching mangled Supercite attribution lines. | |
86 The first regexp group should match the Supercite attribution." | |
87 :group 'gnus-cite | |
88 :type 'regexp) | |
89 | |
90 (defcustom gnus-cite-minimum-match-count 2 | |
91 "Minimum number of identical prefixes before we believe it's a citation." | |
92 :group 'gnus-cite | |
93 :type 'integer) | |
94 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
95 ;; Some Microsoft products put in a citation that extends to the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
96 ;; remainder of the message: |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
97 ;; |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
98 ;; -----Original Message----- |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
99 ;; From: ... |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
100 ;; To: ... |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
101 ;; Sent: ... [date, in non-RFC-2822 format] |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
102 ;; Subject: ... |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
103 ;; |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
104 ;; Cited message, with no prefixes |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
105 ;; |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
106 ;; The four headers are always the same. But note they are prone to |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
107 ;; folding without additional indentation. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
108 ;; |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
109 ;; Others use "----- Original Message -----" instead, and properly quote |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
110 ;; the body using "> ". This style is handled without special cases. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
111 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
112 (defcustom gnus-cite-attribution-prefix |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
113 "In article\\|in <\\|On \\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),\\|----- ?Original Message ?-----" |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
114 "*Regexp matching the beginning of an attribution line." |
17493 | 115 :group 'gnus-cite |
116 :type 'regexp) | |
117 | |
118 (defcustom gnus-cite-attribution-suffix | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
119 "\\(\\(wrote\\|writes\\|said\\|says\\|>\\)\\(:\\|\\.\\.\\.\\)\\|----- ?Original Message ?-----\\)[ \t]*$" |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
120 "*Regexp matching the end of an attribution line. |
17493 | 121 The text matching the first grouping will be used as a button." |
122 :group 'gnus-cite | |
123 :type 'regexp) | |
124 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
125 (defcustom gnus-cite-unsightly-citation-regexp |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
126 "^-----Original Message-----\nFrom: \\(.+\n\\)+\n" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
127 "Regexp matching Microsoft-type rest-of-message citations." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57856
diff
changeset
|
128 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
129 :group 'gnus-cite |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
130 :type 'regexp) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
131 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
132 (defcustom gnus-cite-ignore-quoted-from t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
133 "Non-nil means don't regard lines beginning with \">From \" as cited text. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
134 Those lines may have been quoted by MTAs in order not to mix up with |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
135 the envelope From line." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57856
diff
changeset
|
136 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
137 :group 'gnus-cite |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
138 :type 'boolean) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
139 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
140 (defface gnus-cite-attribution '((t (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
141 "Face used for attribution lines." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
142 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
143 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
144 (put 'gnus-cite-attribution-face 'face-alias 'gnus-cite-attribution) |
17493 | 145 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
146 (defcustom gnus-cite-attribution-face 'gnus-cite-attribution |
17493 | 147 "Face used for attribution lines. |
148 It is merged with the face for the cited text belonging to the attribution." | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57856
diff
changeset
|
149 :version "22.1" |
17493 | 150 :group 'gnus-cite |
151 :type 'face) | |
152 | |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
153 (defface gnus-cite-1 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
154 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
155 (:foreground "light blue")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
156 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
157 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
158 (:foreground "MidnightBlue")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
159 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
160 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
161 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
162 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
163 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
164 (put 'gnus-cite-face-1 'face-alias 'gnus-cite-1) |
17493 | 165 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
166 (defface gnus-cite-2 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
167 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
168 (:foreground "light cyan")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
169 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
170 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
171 (:foreground "firebrick")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
172 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
173 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
174 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
175 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
176 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
177 (put 'gnus-cite-face-2 'face-alias 'gnus-cite-2) |
17493 | 178 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
179 (defface gnus-cite-3 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
180 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
181 (:foreground "light yellow")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
182 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
183 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
184 (:foreground "dark green")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
185 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
186 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
187 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
188 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
189 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
190 (put 'gnus-cite-face-3 'face-alias 'gnus-cite-3) |
17493 | 191 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
192 (defface gnus-cite-4 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
193 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
194 (:foreground "light pink")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
195 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
196 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
197 (:foreground "OrangeRed")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
198 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
199 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
200 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
201 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
202 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
203 (put 'gnus-cite-face-4 'face-alias 'gnus-cite-4) |
17493 | 204 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
205 (defface gnus-cite-5 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
206 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
207 (:foreground "pale green")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
208 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
209 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
210 (:foreground "dark khaki")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
211 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
212 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
213 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
214 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
215 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
216 (put 'gnus-cite-face-5 'face-alias 'gnus-cite-5) |
17493 | 217 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
218 (defface gnus-cite-6 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
219 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
220 (:foreground "beige")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
221 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
222 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
223 (:foreground "dark violet")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
224 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
225 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
226 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
227 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
228 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
229 (put 'gnus-cite-face-6 'face-alias 'gnus-cite-6) |
17493 | 230 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
231 (defface gnus-cite-7 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
232 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
233 (:foreground "orange")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
234 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
235 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
236 (:foreground "SteelBlue4")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
237 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
238 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
239 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
240 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
241 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
242 (put 'gnus-cite-face-7 'face-alias 'gnus-cite-7) |
17493 | 243 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
244 (defface gnus-cite-8 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
245 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
246 (:foreground "magenta")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
247 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
248 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
249 (:foreground "magenta")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
250 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
251 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
252 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
253 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
254 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
255 (put 'gnus-cite-face-8 'face-alias 'gnus-cite-8) |
17493 | 256 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
257 (defface gnus-cite-9 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
258 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
259 (:foreground "violet")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
260 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
261 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
262 (:foreground "violet")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
263 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
264 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
265 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
266 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
267 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
268 (put 'gnus-cite-face-9 'face-alias 'gnus-cite-9) |
17493 | 269 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
270 (defface gnus-cite-10 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
271 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
272 (:foreground "medium purple")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
273 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
274 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
275 (:foreground "medium purple")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
276 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
277 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
278 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
279 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
280 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
281 (put 'gnus-cite-face-10 'face-alias 'gnus-cite-10) |
17493 | 282 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
283 (defface gnus-cite-11 '((((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
284 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
285 (:foreground "turquoise")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
286 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
287 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
288 (:foreground "turquoise")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
289 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
290 (:italic t))) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
291 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
292 :group 'gnus-cite) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
293 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
294 (put 'gnus-cite-face-11 'face-alias 'gnus-cite-11) |
17493 | 295 |
296 (defcustom gnus-cite-face-list | |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
297 '(gnus-cite-1 gnus-cite-2 gnus-cite-3 gnus-cite-4 gnus-cite-5 gnus-cite-6 |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
298 gnus-cite-7 gnus-cite-8 gnus-cite-9 gnus-cite-10 gnus-cite-11) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
299 "*List of faces used for highlighting citations. |
17493 | 300 |
301 When there are citations from multiple articles in the same message, | |
302 Gnus will try to give each citation from each article its own face. | |
303 This should make it easier to see who wrote what." | |
304 :group 'gnus-cite | |
305 :type '(repeat face)) | |
306 | |
307 (defcustom gnus-cite-hide-percentage 50 | |
308 "Only hide excess citation if above this percentage of the body." | |
309 :group 'gnus-cite | |
310 :type 'number) | |
311 | |
312 (defcustom gnus-cite-hide-absolute 10 | |
313 "Only hide excess citation if above this number of lines in the body." | |
314 :group 'gnus-cite | |
315 :type 'integer) | |
316 | |
45202
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
317 (defcustom gnus-cite-blank-line-after-header t |
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
318 "If non-nil, put a blank line between the citation header and the button." |
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
319 :group 'gnus-cite |
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
320 :type 'boolean) |
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
321 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
322 ;; This has to go here because its default value depends on |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
323 ;; gnus-cite-face-list. |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
324 (defcustom gnus-article-boring-faces (cons 'gnus-signature gnus-cite-face-list) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
325 "List of faces that are not worth reading. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
326 If an article has more pages below the one you are looking at, but |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
327 nothing on those pages is a word of at least three letters that is not |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
328 in a boring face, then the pages will be skipped." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
329 :type '(repeat face) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
330 :group 'gnus-article-hiding) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
331 |
17493 | 332 ;;; Internal Variables: |
333 | |
334 (defvar gnus-cite-article nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
335 (defvar gnus-cite-overlay-list nil) |
17493 | 336 |
337 (defvar gnus-cite-prefix-alist nil) | |
338 ;; Alist of citation prefixes. | |
339 ;; The cdr is a list of lines with that prefix. | |
340 | |
341 (defvar gnus-cite-attribution-alist nil) | |
342 ;; Alist of attribution lines. | |
343 ;; The car is a line number. | |
344 ;; The cdr is the prefix for the citation started by that line. | |
345 | |
346 (defvar gnus-cite-loose-prefix-alist nil) | |
347 ;; Alist of citation prefixes that have no matching attribution. | |
348 ;; The cdr is a list of lines with that prefix. | |
349 | |
350 (defvar gnus-cite-loose-attribution-alist nil) | |
351 ;; Alist of attribution lines that have no matching citation. | |
352 ;; Each member has the form (WROTE IN PREFIX TAG), where | |
353 ;; WROTE: is the attribution line number | |
354 ;; IN: is the line number of the previous line if part of the same attribution, | |
355 ;; PREFIX: Is the citation prefix of the attribution line(s), and | |
356 ;; TAG: Is a Supercite tag, if any. | |
357 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
358 (defvar gnus-cited-opened-text-button-line-format-alist |
17493 | 359 `((?b (marker-position beg) ?d) |
360 (?e (marker-position end) ?d) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
361 (?n (count-lines beg end) ?d) |
17493 | 362 (?l (- end beg) ?d))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
363 (defvar gnus-cited-opened-text-button-line-format-spec nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
364 (defvar gnus-cited-closed-text-button-line-format-alist |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
365 gnus-cited-opened-text-button-line-format-alist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
366 (defvar gnus-cited-closed-text-button-line-format-spec nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
367 |
17493 | 368 |
369 ;;; Commands: | |
370 | |
371 (defun gnus-article-highlight-citation (&optional force) | |
372 "Highlight cited text. | |
373 Each citation in the article will be highlighted with a different face. | |
374 The faces are taken from `gnus-cite-face-list'. | |
375 Attribution lines are highlighted with the same face as the | |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
376 corresponding citation merged with the face `gnus-cite-attribution'. |
17493 | 377 |
378 Text is considered cited if at least `gnus-cite-minimum-match-count' | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
379 lines matches `message-cite-prefix-regexp' with the same prefix. |
17493 | 380 |
381 Lines matching `gnus-cite-attribution-suffix' and perhaps | |
382 `gnus-cite-attribution-prefix' are considered attribution lines." | |
383 (interactive (list 'force)) | |
384 (save-excursion | |
385 (set-buffer gnus-article-buffer) | |
386 (gnus-cite-parse-maybe force) | |
387 (let ((buffer-read-only nil) | |
388 (alist gnus-cite-prefix-alist) | |
389 (faces gnus-cite-face-list) | |
390 (inhibit-point-motion-hooks t) | |
391 face entry prefix skip numbers number face-alist) | |
392 ;; Loop through citation prefixes. | |
393 (while alist | |
394 (setq entry (car alist) | |
395 alist (cdr alist) | |
396 prefix (car entry) | |
397 numbers (cdr entry) | |
398 face (car faces) | |
399 faces (or (cdr faces) gnus-cite-face-list) | |
400 face-alist (cons (cons prefix face) face-alist)) | |
401 (while numbers | |
402 (setq number (car numbers) | |
403 numbers (cdr numbers)) | |
404 (and (not (assq number gnus-cite-attribution-alist)) | |
405 (not (assq number gnus-cite-loose-attribution-alist)) | |
406 (gnus-cite-add-face number prefix face)))) | |
407 ;; Loop through attribution lines. | |
408 (setq alist gnus-cite-attribution-alist) | |
409 (while alist | |
410 (setq entry (car alist) | |
411 alist (cdr alist) | |
412 number (car entry) | |
413 prefix (cdr entry) | |
414 skip (gnus-cite-find-prefix number) | |
415 face (cdr (assoc prefix face-alist))) | |
416 ;; Add attribution button. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
417 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
418 (forward-line (1- number)) |
17493 | 419 (when (re-search-forward gnus-cite-attribution-suffix |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
420 (gnus-point-at-eol) |
17493 | 421 t) |
422 (gnus-article-add-button (match-beginning 1) (match-end 1) | |
423 'gnus-cite-toggle prefix)) | |
424 ;; Highlight attribution line. | |
425 (gnus-cite-add-face number skip face) | |
426 (gnus-cite-add-face number skip gnus-cite-attribution-face)) | |
427 ;; Loop through attribution lines. | |
428 (setq alist gnus-cite-loose-attribution-alist) | |
429 (while alist | |
430 (setq entry (car alist) | |
431 alist (cdr alist) | |
432 number (car entry) | |
433 skip (gnus-cite-find-prefix number)) | |
434 (gnus-cite-add-face number skip gnus-cite-attribution-face))))) | |
435 | |
436 (defun gnus-dissect-cited-text () | |
437 "Dissect the article buffer looking for cited text." | |
438 (save-excursion | |
439 (set-buffer gnus-article-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
440 (gnus-cite-parse-maybe nil t) |
17493 | 441 (let ((alist gnus-cite-prefix-alist) |
442 prefix numbers number marks m) | |
443 ;; Loop through citation prefixes. | |
444 (while alist | |
445 (setq numbers (pop alist) | |
446 prefix (pop numbers)) | |
447 (while numbers | |
448 (setq number (pop numbers)) | |
449 (goto-char (point-min)) | |
450 (forward-line number) | |
451 (push (cons (point-marker) "") marks) | |
452 (while (and numbers | |
453 (= (1- number) (car numbers))) | |
454 (setq number (pop numbers))) | |
455 (goto-char (point-min)) | |
456 (forward-line (1- number)) | |
457 (push (cons (point-marker) prefix) marks))) | |
458 ;; Skip to the beginning of the body. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
459 (article-goto-body) |
17493 | 460 (push (cons (point-marker) "") marks) |
461 ;; Find the end of the body. | |
462 (goto-char (point-max)) | |
463 (gnus-article-search-signature) | |
464 (push (cons (point-marker) "") marks) | |
465 ;; Sort the marks. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
466 (setq marks (sort marks 'car-less-than-car)) |
17493 | 467 (let ((omarks marks)) |
468 (setq marks nil) | |
469 (while (cdr omarks) | |
470 (if (= (caar omarks) (caadr omarks)) | |
471 (progn | |
472 (unless (equal (cdar omarks) "") | |
473 (push (car omarks) marks)) | |
474 (unless (equal (cdadr omarks) "") | |
475 (push (cadr omarks) marks)) | |
476 (unless (and (equal (cdar omarks) "") | |
477 (equal (cdadr omarks) "") | |
478 (not (cddr omarks))) | |
479 (setq omarks (cdr omarks)))) | |
480 (push (car omarks) marks)) | |
481 (setq omarks (cdr omarks))) | |
482 (when (car omarks) | |
483 (push (car omarks) marks)) | |
484 (setq marks (setq m (nreverse marks))) | |
485 (while (cddr m) | |
486 (if (and (equal (cdadr m) "") | |
487 (equal (cdar m) (cdaddr m)) | |
488 (goto-char (caadr m)) | |
489 (forward-line 1) | |
490 (= (point) (caaddr m))) | |
491 (setcdr m (cdddr m)) | |
492 (setq m (cdr m)))) | |
493 marks)))) | |
494 | |
495 (defun gnus-article-fill-cited-article (&optional force width) | |
496 "Do word wrapping in the current article. | |
497 If WIDTH (the numerical prefix), use that text width when filling." | |
498 (interactive (list t current-prefix-arg)) | |
499 (save-excursion | |
500 (set-buffer gnus-article-buffer) | |
501 (let ((buffer-read-only nil) | |
502 (inhibit-point-motion-hooks t) | |
503 (marks (gnus-dissect-cited-text)) | |
504 (adaptive-fill-mode nil) | |
505 (filladapt-mode nil) | |
506 (fill-column (if width (prefix-numeric-value width) fill-column))) | |
507 (save-restriction | |
508 (while (cdr marks) | |
509 (narrow-to-region (caar marks) (caadr marks)) | |
510 (let ((adaptive-fill-regexp | |
511 (concat "^" (regexp-quote (cdar marks)) " *")) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
512 (fill-prefix |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
513 (if (string= (cdar marks) "") "" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
514 (concat (cdar marks) " "))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
515 use-hard-newlines) |
17493 | 516 (fill-region (point-min) (point-max))) |
517 (set-marker (caar marks) nil) | |
518 (setq marks (cdr marks))) | |
519 (when marks | |
520 (set-marker (caar marks) nil)) | |
521 ;; All this information is now incorrect. | |
522 (setq gnus-cite-prefix-alist nil | |
523 gnus-cite-attribution-alist nil | |
524 gnus-cite-loose-prefix-alist nil | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
525 gnus-cite-loose-attribution-alist nil |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
526 gnus-cite-article nil))))) |
17493 | 527 |
528 (defun gnus-article-hide-citation (&optional arg force) | |
529 "Toggle hiding of all cited text except attribution lines. | |
530 See the documentation for `gnus-article-highlight-citation'. | |
531 If given a negative prefix, always show; if given a positive prefix, | |
532 always hide." | |
533 (interactive (append (gnus-article-hidden-arg) (list 'force))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
534 (gnus-set-format 'cited-opened-text-button t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
535 (gnus-set-format 'cited-closed-text-button t) |
17493 | 536 (save-excursion |
537 (set-buffer gnus-article-buffer) | |
538 (let ((buffer-read-only nil) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
539 marks |
17493 | 540 (inhibit-point-motion-hooks t) |
541 (props (nconc (list 'article-type 'cite) | |
542 gnus-hidden-properties)) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
543 (point (point-min)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
544 found beg end start) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45202
diff
changeset
|
545 (while (setq point |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45202
diff
changeset
|
546 (text-property-any point (point-max) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
547 'gnus-callback |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
548 'gnus-article-toggle-cited-text)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
549 (setq found t) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
550 (goto-char point) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
551 (gnus-article-toggle-cited-text |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
552 (get-text-property point 'gnus-data) arg) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
553 (forward-line 1) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
554 (setq point (point))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
555 (unless found |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
556 (setq marks (gnus-dissect-cited-text)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
557 (while marks |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
558 (setq beg nil |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
559 end nil) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
560 (while (and marks (string= (cdar marks) "")) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
561 (setq marks (cdr marks))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
562 (when marks |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
563 (setq beg (caar marks))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
564 (while (and marks (not (string= (cdar marks) ""))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
565 (setq marks (cdr marks))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
566 (when marks |
17493 | 567 (setq end (caar marks))) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
568 ;; Skip past lines we want to leave visible. |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
569 (when (and beg end gnus-cited-lines-visible) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
570 (goto-char beg) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
571 (forward-line (if (consp gnus-cited-lines-visible) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
572 (car gnus-cited-lines-visible) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
573 gnus-cited-lines-visible)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
574 (if (>= (point) end) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
575 (setq beg nil) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
576 (setq beg (point-marker)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
577 (when (consp gnus-cited-lines-visible) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
578 (goto-char end) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
579 (forward-line (- (cdr gnus-cited-lines-visible))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
580 (if (<= (point) beg) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
581 (setq beg nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
582 (setq end (point-marker)))))) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
583 (when (and beg end) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
584 (gnus-add-wash-type 'cite) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
585 ;; We use markers for the end-points to facilitate later |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
586 ;; wrapping and mangling of text. |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
587 (setq beg (set-marker (make-marker) beg) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
588 end (set-marker (make-marker) end)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
589 (gnus-add-text-properties-when 'article-type nil beg end props) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
590 (goto-char beg) |
45202
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
591 (when (and gnus-cite-blank-line-after-header |
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
592 (not (save-excursion (search-backward "\n\n" nil t)))) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
593 (insert "\n")) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
594 (put-text-property |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
595 (setq start (point-marker)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
596 (progn |
17493 | 597 (gnus-article-add-button |
598 (point) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
599 (progn (eval gnus-cited-closed-text-button-line-format-spec) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
600 (point)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
601 `gnus-article-toggle-cited-text |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
602 (list (cons beg end) start)) |
17493 | 603 (point)) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
604 'article-type 'annotation) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
605 (set-marker beg (point)))))))) |
17493 | 606 |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
607 (defun gnus-article-toggle-cited-text (args &optional arg) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
608 "Toggle hiding the text in REGION. |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
609 ARG can be nil or a number. Positive means hide, negative |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
610 means show, nil means toggle." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
611 (let* ((region (car args)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
612 (beg (car region)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
613 (end (cdr region)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
614 (start (cadr args)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
615 (hidden |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
616 (text-property-any beg (1- end) 'article-type 'cite)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
617 (inhibit-point-motion-hooks t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
618 buffer-read-only) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
619 (when (or (null arg) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
620 (zerop arg) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
621 (and (> arg 0) (not hidden)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
622 (and (< arg 0) hidden)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
623 (if hidden |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
624 (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
625 ;; Can't remove 'cite from g-a-wash-types here because |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
626 ;; multiple citations may be hidden -jas |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
627 (gnus-remove-text-properties-when |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
628 'article-type 'cite beg end |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
629 (cons 'article-type (cons 'cite |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
630 gnus-hidden-properties)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
631 (gnus-add-wash-type 'cite) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
632 (gnus-add-text-properties-when |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45202
diff
changeset
|
633 'article-type nil beg end |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
634 (cons 'article-type (cons 'cite |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
635 gnus-hidden-properties)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
636 (let ((gnus-article-mime-handle-alist-1 gnus-article-mime-handle-alist)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
637 (gnus-set-mode-line 'article)) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
638 (save-excursion |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
639 (goto-char start) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
640 (gnus-delete-line) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
641 (put-text-property |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
642 (point) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
643 (progn |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
644 (gnus-article-add-button |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
645 (point) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
646 (progn (eval |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
647 (if hidden |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
648 gnus-cited-opened-text-button-line-format-spec |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
649 gnus-cited-closed-text-button-line-format-spec)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
650 (point)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
651 `gnus-article-toggle-cited-text |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
652 args) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
653 (point)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
654 'article-type 'annotation))))) |
17493 | 655 |
656 (defun gnus-article-hide-citation-maybe (&optional arg force) | |
657 "Toggle hiding of cited text that has an attribution line. | |
658 If given a negative prefix, always show; if given a positive prefix, | |
659 always hide. | |
660 This will do nothing unless at least `gnus-cite-hide-percentage' | |
661 percent and at least `gnus-cite-hide-absolute' lines of the body is | |
662 cited text with attributions. When called interactively, these two | |
663 variables are ignored. | |
664 See also the documentation for `gnus-article-highlight-citation'." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
665 (interactive (append (gnus-article-hidden-arg) '(force))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
666 (with-current-buffer gnus-article-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
667 (gnus-delete-wash-type 'cite) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
668 (unless (gnus-article-check-hidden-text 'cite arg) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
669 (save-excursion |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
670 (gnus-cite-parse-maybe force) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
671 (article-goto-body) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
672 (let ((start (point)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
673 (atts gnus-cite-attribution-alist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
674 (buffer-read-only nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
675 (inhibit-point-motion-hooks t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
676 (hidden 0) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
677 total) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
678 (goto-char (point-max)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
679 (gnus-article-search-signature) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
680 (setq total (count-lines start (point))) |
17493 | 681 (while atts |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
682 (setq hidden (+ hidden (length (cdr (assoc (cdar atts) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
683 gnus-cite-prefix-alist)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
684 atts (cdr atts))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
685 (when (or force |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
686 (and (> (* 100 hidden) (* gnus-cite-hide-percentage total)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
687 (> hidden gnus-cite-hide-absolute))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
688 (gnus-add-wash-type 'cite) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
689 (setq atts gnus-cite-attribution-alist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
690 (while atts |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
691 (setq total (cdr (assoc (cdar atts) gnus-cite-prefix-alist)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
692 atts (cdr atts)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
693 (while total |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
694 (setq hidden (car total) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
695 total (cdr total)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
696 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
697 (forward-line (1- hidden)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
698 (unless (assq hidden gnus-cite-attribution-alist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
699 (gnus-add-text-properties |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
700 (point) (progn (forward-line 1) (point)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
701 (nconc (list 'article-type 'cite) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
702 gnus-hidden-properties))))))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
703 (gnus-set-mode-line 'article))) |
17493 | 704 |
705 (defun gnus-article-hide-citation-in-followups () | |
706 "Hide cited text in non-root articles." | |
707 (interactive) | |
708 (save-excursion | |
709 (set-buffer gnus-article-buffer) | |
710 (let ((article (cdr gnus-article-current))) | |
711 (unless (save-excursion | |
712 (set-buffer gnus-summary-buffer) | |
713 (gnus-article-displayed-root-p article)) | |
714 (gnus-article-hide-citation))))) | |
715 | |
716 ;;; Internal functions: | |
717 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
718 (defun gnus-cite-parse-maybe (&optional force no-overlay) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
719 "Always parse the buffer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
720 (gnus-cite-localize) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
721 ;;Reset parser information. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
722 (setq gnus-cite-prefix-alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
723 gnus-cite-attribution-alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
724 gnus-cite-loose-prefix-alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
725 gnus-cite-loose-attribution-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
726 (unless no-overlay |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
727 (gnus-cite-delete-overlays)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
728 ;; Parse if not too large. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
729 (if (and gnus-cite-parse-max-size |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
730 (> (buffer-size) gnus-cite-parse-max-size)) |
17493 | 731 () |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
732 (setq gnus-cite-article (cons (car gnus-article-current) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
733 (cdr gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
734 (gnus-cite-parse-wrapper))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
735 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
736 (defun gnus-cite-delete-overlays () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
737 (dolist (overlay gnus-cite-overlay-list) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
738 (ignore-errors |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
739 (when (or (not (gnus-overlay-end overlay)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
740 (and (>= (gnus-overlay-end overlay) (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
741 (<= (gnus-overlay-end overlay) (point-max)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
742 (setq gnus-cite-overlay-list (delete overlay gnus-cite-overlay-list)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
743 (ignore-errors |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
744 (gnus-delete-overlay overlay)))))) |
17493 | 745 |
746 (defun gnus-cite-parse-wrapper () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
747 ;; Wrap chopped gnus-cite-parse. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
748 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
749 (let ((inhibit-point-motion-hooks t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
750 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
751 (gnus-cite-parse-attributions)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
752 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
753 (gnus-cite-parse)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
754 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
755 (gnus-cite-connect-attributions)))) |
17493 | 756 |
757 (defun gnus-cite-parse () | |
758 ;; Parse and connect citation prefixes and attribution lines. | |
759 | |
760 ;; Parse current buffer searching for citation prefixes. | |
761 (let ((line (1+ (count-lines (point-min) (point)))) | |
762 (case-fold-search t) | |
763 (max (save-excursion | |
764 (goto-char (point-max)) | |
765 (gnus-article-search-signature) | |
766 (point))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
767 (prefix-regexp (concat "^\\(" message-cite-prefix-regexp "\\)")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
768 alist entry start begin end numbers prefix guess-limit) |
17493 | 769 ;; Get all potential prefixes in `alist'. |
770 (while (< (point) max) | |
771 ;; Each line. | |
772 (setq begin (point) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
773 guess-limit (progn (skip-chars-forward "^> \t\r\n") (point)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
774 end (gnus-point-at-bol 2) |
17493 | 775 start end) |
776 (goto-char begin) | |
777 ;; Ignore standard Supercite attribution prefix. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
778 (when (and (< guess-limit (+ begin gnus-cite-max-prefix)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
779 (looking-at gnus-supercite-regexp)) |
17493 | 780 (if (match-end 1) |
781 (setq end (1+ (match-end 1))) | |
782 (setq end (1+ begin)))) | |
783 ;; Ignore very long prefixes. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
784 (when (> end (+ begin gnus-cite-max-prefix)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
785 (setq end (+ begin gnus-cite-max-prefix))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
786 ;; Ignore quoted envelope From_. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
787 (when (and gnus-cite-ignore-quoted-from |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
788 (prog2 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
789 (setq case-fold-search nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
790 (looking-at ">From ") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
791 (setq case-fold-search t))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
792 (setq end (1+ begin))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
793 (while (re-search-forward prefix-regexp (1- end) t) |
17493 | 794 ;; Each prefix. |
795 (setq end (match-end 0) | |
796 prefix (buffer-substring begin end)) | |
797 (gnus-set-text-properties 0 (length prefix) nil prefix) | |
798 (setq entry (assoc prefix alist)) | |
799 (if entry | |
800 (setcdr entry (cons line (cdr entry))) | |
801 (push (list prefix line) alist)) | |
802 (goto-char begin)) | |
803 (goto-char start) | |
804 (setq line (1+ line))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
805 ;; Horrible special case for some Microsoft mailers. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
806 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
807 (when (re-search-forward gnus-cite-unsightly-citation-regexp max t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
808 (setq begin (count-lines (point-min) (point))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
809 (setq end (count-lines (point-min) max)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
810 (setq entry nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
811 (while (< begin end) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
812 (push begin entry) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
813 (setq begin (1+ begin))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
814 (push (cons "" entry) alist)) |
17493 | 815 ;; We got all the potential prefixes. Now create |
816 ;; `gnus-cite-prefix-alist' containing the oldest prefix for each | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
817 ;; line that appears at least `gnus-cite-minimum-match-count' |
17493 | 818 ;; times. First sort them by length. Longer is older. |
819 (setq alist (sort alist (lambda (a b) | |
820 (> (length (car a)) (length (car b)))))) | |
821 (while alist | |
822 (setq entry (car alist) | |
823 prefix (car entry) | |
824 numbers (cdr entry) | |
825 alist (cdr alist)) | |
826 (cond ((null numbers) | |
827 ;; No lines with this prefix that wasn't also part of | |
828 ;; a longer prefix. | |
829 ) | |
830 ((< (length numbers) gnus-cite-minimum-match-count) | |
831 ;; Too few lines with this prefix. We keep it a bit | |
832 ;; longer in case it is an exact match for an attribution | |
833 ;; line, but we don't remove the line from other | |
834 ;; prefixes. | |
835 (push entry gnus-cite-prefix-alist)) | |
836 (t | |
837 (push entry | |
838 gnus-cite-prefix-alist) | |
839 ;; Remove articles from other prefixes. | |
840 (let ((loop alist) | |
841 current) | |
842 (while loop | |
843 (setq current (car loop) | |
844 loop (cdr loop)) | |
845 (setcdr current | |
846 (gnus-set-difference (cdr current) numbers))))))))) | |
847 | |
848 (defun gnus-cite-parse-attributions () | |
849 (let (al-alist) | |
850 ;; Parse attributions | |
851 (while (re-search-forward gnus-cite-attribution-suffix (point-max) t) | |
852 (let* ((start (match-beginning 0)) | |
853 (end (match-end 0)) | |
854 (wrote (count-lines (point-min) end)) | |
855 (prefix (gnus-cite-find-prefix wrote)) | |
856 ;; Check previous line for an attribution leader. | |
857 (tag (progn | |
858 (beginning-of-line 1) | |
859 (when (looking-at gnus-supercite-secondary-regexp) | |
860 (buffer-substring (match-beginning 1) | |
861 (match-end 1))))) | |
862 (in (progn | |
863 (goto-char start) | |
864 (and (re-search-backward gnus-cite-attribution-prefix | |
865 (save-excursion | |
866 (beginning-of-line 0) | |
867 (point)) | |
868 t) | |
869 (not (re-search-forward gnus-cite-attribution-suffix | |
870 start t)) | |
871 (count-lines (point-min) (1+ (point))))))) | |
872 (when (eq wrote in) | |
873 (setq in nil)) | |
874 (goto-char end) | |
875 ;; don't add duplicates | |
876 (let ((al (buffer-substring (save-excursion (beginning-of-line 0) | |
877 (1+ (point))) | |
878 end))) | |
879 (if (not (assoc al al-alist)) | |
880 (progn | |
881 (push (list wrote in prefix tag) | |
882 gnus-cite-loose-attribution-alist) | |
883 (push (cons al t) al-alist)))))))) | |
884 | |
885 (defun gnus-cite-connect-attributions () | |
886 ;; Connect attributions to citations | |
887 | |
888 ;; No citations have been connected to attribution lines yet. | |
889 (setq gnus-cite-loose-prefix-alist (append gnus-cite-prefix-alist nil)) | |
890 | |
891 ;; Parse current buffer searching for attribution lines. | |
892 ;; Find exact supercite citations. | |
893 (gnus-cite-match-attributions 'small nil | |
894 (lambda (prefix tag) | |
895 (when tag | |
896 (concat "\\`" | |
897 (regexp-quote prefix) "[ \t]*" | |
898 (regexp-quote tag) ">")))) | |
899 ;; Find loose supercite citations after attributions. | |
900 (gnus-cite-match-attributions 'small t | |
901 (lambda (prefix tag) | |
902 (when tag | |
903 (concat "\\<" | |
904 (regexp-quote tag) | |
905 "\\>")))) | |
906 ;; Find loose supercite citations anywhere. | |
907 (gnus-cite-match-attributions 'small nil | |
908 (lambda (prefix tag) | |
909 (when tag | |
910 (concat "\\<" | |
911 (regexp-quote tag) | |
912 "\\>")))) | |
913 ;; Find nested citations after attributions. | |
914 (gnus-cite-match-attributions 'small-if-unique t | |
915 (lambda (prefix tag) | |
916 (concat "\\`" (regexp-quote prefix) ".+"))) | |
917 ;; Find nested citations anywhere. | |
918 (gnus-cite-match-attributions 'small nil | |
919 (lambda (prefix tag) | |
920 (concat "\\`" (regexp-quote prefix) ".+"))) | |
921 ;; Remove loose prefixes with too few lines. | |
922 (let ((alist gnus-cite-loose-prefix-alist) | |
923 entry) | |
924 (while alist | |
925 (setq entry (car alist) | |
926 alist (cdr alist)) | |
927 (when (< (length (cdr entry)) gnus-cite-minimum-match-count) | |
928 (setq gnus-cite-prefix-alist | |
929 (delq entry gnus-cite-prefix-alist) | |
930 gnus-cite-loose-prefix-alist | |
931 (delq entry gnus-cite-loose-prefix-alist))))) | |
932 ;; Find flat attributions. | |
933 (gnus-cite-match-attributions 'first t nil) | |
934 ;; Find any attributions (are we getting desperate yet?). | |
935 (gnus-cite-match-attributions 'first nil nil)) | |
936 | |
937 (defun gnus-cite-match-attributions (sort after fun) | |
938 ;; Match all loose attributions and citations (SORT AFTER FUN) . | |
939 ;; | |
940 ;; If SORT is `small', the citation with the shortest prefix will be | |
941 ;; used, if it is `first' the first prefix will be used, if it is | |
942 ;; `small-if-unique' the shortest prefix will be used if the | |
943 ;; attribution line does not share its own prefix with other | |
944 ;; loose attribution lines, otherwise the first prefix will be used. | |
945 ;; | |
946 ;; If AFTER is non-nil, only citations after the attribution line | |
947 ;; will be considered. | |
948 ;; | |
949 ;; If FUN is non-nil, it will be called with the arguments (WROTE | |
950 ;; PREFIX TAG) and expected to return a regular expression. Only | |
951 ;; citations whose prefix matches the regular expression will be | |
952 ;; considered. | |
953 ;; | |
954 ;; WROTE is the attribution line number. | |
955 ;; PREFIX is the attribution line prefix. | |
956 ;; TAG is the Supercite tag on the attribution line. | |
957 (let ((atts gnus-cite-loose-attribution-alist) | |
958 (case-fold-search t) | |
959 att wrote in prefix tag regexp limit smallest best size) | |
960 (while atts | |
961 (setq att (car atts) | |
962 atts (cdr atts) | |
963 wrote (nth 0 att) | |
964 in (nth 1 att) | |
965 prefix (nth 2 att) | |
966 tag (nth 3 att) | |
967 regexp (if fun (funcall fun prefix tag) "") | |
968 size (cond ((eq sort 'small) t) | |
969 ((eq sort 'first) nil) | |
970 (t (< (length (gnus-cite-find-loose prefix)) 2))) | |
971 limit (if after wrote -1) | |
972 smallest 1000000 | |
973 best nil) | |
974 (let ((cites gnus-cite-loose-prefix-alist) | |
975 cite candidate numbers first compare) | |
976 (while cites | |
977 (setq cite (car cites) | |
978 cites (cdr cites) | |
979 candidate (car cite) | |
980 numbers (cdr cite) | |
981 first (apply 'min numbers) | |
982 compare (if size (length candidate) first)) | |
983 (and (> first limit) | |
984 regexp | |
985 (string-match regexp candidate) | |
986 (< compare smallest) | |
987 (setq best cite | |
988 smallest compare)))) | |
989 (if (null best) | |
990 () | |
991 (setq gnus-cite-loose-attribution-alist | |
992 (delq att gnus-cite-loose-attribution-alist)) | |
993 (push (cons wrote (car best)) gnus-cite-attribution-alist) | |
994 (when in | |
995 (push (cons in (car best)) gnus-cite-attribution-alist)) | |
996 (when (memq best gnus-cite-loose-prefix-alist) | |
997 (let ((loop gnus-cite-prefix-alist) | |
998 (numbers (cdr best)) | |
999 current) | |
1000 (setq gnus-cite-loose-prefix-alist | |
1001 (delq best gnus-cite-loose-prefix-alist)) | |
1002 (while loop | |
1003 (setq current (car loop) | |
1004 loop (cdr loop)) | |
1005 (if (eq current best) | |
1006 () | |
1007 (setcdr current (gnus-set-difference (cdr current) numbers)) | |
1008 (when (null (cdr current)) | |
1009 (setq gnus-cite-loose-prefix-alist | |
1010 (delq current gnus-cite-loose-prefix-alist) | |
1011 atts (delq current atts))))))))))) | |
1012 | |
1013 (defun gnus-cite-find-loose (prefix) | |
1014 ;; Return a list of loose attribution lines prefixed by PREFIX. | |
1015 (let* ((atts gnus-cite-loose-attribution-alist) | |
1016 att line lines) | |
1017 (while atts | |
1018 (setq att (car atts) | |
1019 line (car att) | |
1020 atts (cdr atts)) | |
1021 (when (string-equal (gnus-cite-find-prefix line) prefix) | |
1022 (push line lines))) | |
1023 lines)) | |
1024 | |
1025 (defun gnus-cite-add-face (number prefix face) | |
1026 ;; At line NUMBER, ignore PREFIX and add FACE to the rest of the line. | |
1027 (when face | |
1028 (let ((inhibit-point-motion-hooks t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1029 from to overlay) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1030 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1031 (when (zerop (forward-line (1- number))) |
17493 | 1032 (forward-char (length prefix)) |
1033 (skip-chars-forward " \t") | |
1034 (setq from (point)) | |
1035 (end-of-line 1) | |
1036 (skip-chars-backward " \t") | |
1037 (setq to (point)) | |
1038 (when (< from to) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1039 (push (setq overlay (gnus-make-overlay from to)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1040 gnus-cite-overlay-list) |
62860
88e7e662d067
(gnus-cite-add-face): Set overlay's evaporate property.
Richard M. Stallman <rms@gnu.org>
parents:
62755
diff
changeset
|
1041 (gnus-overlay-put overlay 'evaporate t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1042 (gnus-overlay-put overlay 'face face)))))) |
17493 | 1043 |
1044 (defun gnus-cite-toggle (prefix) | |
1045 (save-excursion | |
1046 (set-buffer gnus-article-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1047 (gnus-cite-parse-maybe nil t) |
17493 | 1048 (let ((buffer-read-only nil) |
1049 (numbers (cdr (assoc prefix gnus-cite-prefix-alist))) | |
1050 (inhibit-point-motion-hooks t) | |
1051 number) | |
1052 (while numbers | |
1053 (setq number (car numbers) | |
1054 numbers (cdr numbers)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1055 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1056 (forward-line (1- number)) |
17493 | 1057 (cond ((get-text-property (point) 'invisible) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1058 ;; Can't remove 'cite from g-a-wash-types here because |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1059 ;; multiple citations may be hidden -jas |
17493 | 1060 (remove-text-properties (point) (progn (forward-line 1) (point)) |
1061 gnus-hidden-properties)) | |
1062 ((assq number gnus-cite-attribution-alist)) | |
1063 (t | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1064 (gnus-add-wash-type 'cite) |
17493 | 1065 (gnus-add-text-properties |
1066 (point) (progn (forward-line 1) (point)) | |
1067 (nconc (list 'article-type 'cite) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1068 gnus-hidden-properties)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1069 (let ((gnus-article-mime-handle-alist-1 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1070 gnus-article-mime-handle-alist)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1071 (gnus-set-mode-line 'article)))))) |
17493 | 1072 |
1073 (defun gnus-cite-find-prefix (line) | |
1074 ;; Return citation prefix for LINE. | |
1075 (let ((alist gnus-cite-prefix-alist) | |
1076 (prefix "") | |
1077 entry) | |
1078 (while alist | |
1079 (setq entry (car alist) | |
1080 alist (cdr alist)) | |
1081 (when (memq line (cdr entry)) | |
1082 (setq prefix (car entry)))) | |
1083 prefix)) | |
1084 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1085 (defun gnus-cite-localize () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1086 "Make the citation variables local to the article buffer." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1087 (let ((vars '(gnus-cite-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1088 gnus-cite-overlay-list gnus-cite-prefix-alist |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1089 gnus-cite-attribution-alist gnus-cite-loose-prefix-alist |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1090 gnus-cite-loose-attribution-alist))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1091 (while vars |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1092 (make-local-variable (pop vars))))) |
17493 | 1093 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1094 (defun gnus-cited-line-p () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1095 "Say whether the current line is a cited line." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1096 (save-excursion |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1097 (beginning-of-line) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1098 (let ((found nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1099 (dolist (prefix (mapcar 'car gnus-cite-prefix-alist)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1100 (when (string= (buffer-substring (point) (+ (length prefix) (point))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1101 prefix) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1102 (setq found t))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1103 found))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1104 |
17493 | 1105 (gnus-ems-redefine) |
1106 | |
1107 (provide 'gnus-cite) | |
1108 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1109 ;; Local Variables: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1110 ;; coding: iso-8859-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1111 ;; End: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1112 |
52401 | 1113 ;;; arch-tag: 1997b044-6067-471e-8c8f-dc903093098a |
17493 | 1114 ;;; gnus-cite.el ends here |