Mercurial > emacs
annotate lisp/gnus/gnus-cite.el @ 112451:98ad7c9e56a3
gnus-html.el (gnus-html-image-fetched): Don't kill the temporary buffer after being called. It's apparently being killed by url.el, and killing it made point move to end-of-buffer in a random buffer.
shr.el (shr-image-fetched): Ditto.
shr.el (shr-image-fetched): Avoid having point move in the article buffer.
gnus-html.el (gnus-html-image-fetched): Kill the buffer anyway, and fix the bug in url-http.el instead.
shr.el (shr-image-fetched): Ditto.
gravatar.el (gravatar-retrieve): Be silent when retrieving.
gnus-gravatar.el (gnus-gravatar-insert): Don't move point around in the article buffer.
(gnus-gravatar-insert): Use blank space from the current buffer to avoid breaking text properties. This makes X-Sent updating work again.
gnus-art.el (gnus-article-read-summary-keys): Don't call disabled commands.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Mon, 24 Jan 2011 04:10:19 +0000 |
parents | 417b1e4d63cd |
children |
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 |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, |
112218
376148b31b5e
Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
4 ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
17493 | 5 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
6 ;; Author: Per Abhiddenware |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
7 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
8 ;; 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
|
9 |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
17493 | 11 ;; it under the terms of the GNU General Public License as published by |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; (at your option) any later version. |
17493 | 14 |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
17493 | 22 |
23 ;;; Commentary: | |
24 | |
25 ;;; Code: | |
26 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
27 (eval-when-compile (require 'cl)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
28 (eval-when-compile |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
29 (when (featurep 'xemacs) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
30 (require 'easy-mmode))) ; for `define-minor-mode' |
19521
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) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
145 (put 'gnus-cite-attribution-face 'obsolete-face "22.1") |
17493 | 146 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
147 (defcustom gnus-cite-attribution-face 'gnus-cite-attribution |
17493 | 148 "Face used for attribution lines. |
149 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
|
150 :version "22.1" |
17493 | 151 :group 'gnus-cite |
152 :type 'face) | |
153 | |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
154 (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
|
155 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
156 (: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
|
157 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
158 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
159 (:foreground "MidnightBlue")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
160 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
161 (: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
|
162 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
163 :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
|
164 ;; 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
|
165 (put 'gnus-cite-face-1 'face-alias 'gnus-cite-1) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
166 (put 'gnus-cite-face-1 'obsolete-face "22.1") |
17493 | 167 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
168 (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
|
169 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
170 (: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
|
171 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
172 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
173 (:foreground "firebrick")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
174 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
175 (: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
|
176 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
177 :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
|
178 ;; 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
|
179 (put 'gnus-cite-face-2 'face-alias 'gnus-cite-2) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
180 (put 'gnus-cite-face-2 'obsolete-face "22.1") |
17493 | 181 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
182 (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
|
183 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
184 (: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
|
185 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
186 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
187 (: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
|
188 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
189 (: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
|
190 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
191 :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
|
192 ;; 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
|
193 (put 'gnus-cite-face-3 'face-alias 'gnus-cite-3) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
194 (put 'gnus-cite-face-3 'obsolete-face "22.1") |
17493 | 195 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
196 (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
|
197 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
198 (: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
|
199 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
200 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
201 (:foreground "OrangeRed")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
202 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
203 (: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
|
204 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
205 :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
|
206 ;; 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
|
207 (put 'gnus-cite-face-4 'face-alias 'gnus-cite-4) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
208 (put 'gnus-cite-face-4 'obsolete-face "22.1") |
17493 | 209 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
210 (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
|
211 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
212 (: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
|
213 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
214 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
215 (: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
|
216 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
217 (: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
|
218 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
219 :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
|
220 ;; 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
|
221 (put 'gnus-cite-face-5 'face-alias 'gnus-cite-5) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
222 (put 'gnus-cite-face-5 'obsolete-face "22.1") |
17493 | 223 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
224 (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
|
225 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
226 (:foreground "beige")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
227 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
228 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
229 (: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
|
230 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
231 (: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
|
232 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
233 :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
|
234 ;; 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
|
235 (put 'gnus-cite-face-6 'face-alias 'gnus-cite-6) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
236 (put 'gnus-cite-face-6 'obsolete-face "22.1") |
17493 | 237 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
238 (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
|
239 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
240 (:foreground "orange")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
241 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
242 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
243 (:foreground "SteelBlue4")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
244 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
245 (: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
|
246 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
247 :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
|
248 ;; 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
|
249 (put 'gnus-cite-face-7 'face-alias 'gnus-cite-7) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
250 (put 'gnus-cite-face-7 'obsolete-face "22.1") |
17493 | 251 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
252 (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
|
253 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
254 (:foreground "magenta")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
255 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
256 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
257 (:foreground "magenta")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
258 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
259 (: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
|
260 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
261 :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
|
262 ;; 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
|
263 (put 'gnus-cite-face-8 'face-alias 'gnus-cite-8) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
264 (put 'gnus-cite-face-8 'obsolete-face "22.1") |
17493 | 265 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
266 (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
|
267 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
268 (:foreground "violet")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
269 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
270 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
271 (:foreground "violet")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
272 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
273 (: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
|
274 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
275 :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
|
276 ;; 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
|
277 (put 'gnus-cite-face-9 'face-alias 'gnus-cite-9) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
278 (put 'gnus-cite-face-9 'obsolete-face "22.1") |
17493 | 279 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
280 (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
|
281 (background dark)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
282 (:foreground "plum1")) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
283 (((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 light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
285 (: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
|
286 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
287 (: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
|
288 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
289 :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
|
290 ;; 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
|
291 (put 'gnus-cite-face-10 'face-alias 'gnus-cite-10) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
292 (put 'gnus-cite-face-10 'obsolete-face "22.1") |
17493 | 293 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
294 (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
|
295 (background dark)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
296 (:foreground "turquoise")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
297 (((class color) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
298 (background light)) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
299 (:foreground "turquoise")) |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
300 (t |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62860
diff
changeset
|
301 (: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
|
302 "Citation face." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
303 :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
|
304 ;; 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
|
305 (put 'gnus-cite-face-11 'face-alias 'gnus-cite-11) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
306 (put 'gnus-cite-face-11 'obsolete-face "22.1") |
17493 | 307 |
308 (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
|
309 '(gnus-cite-1 gnus-cite-2 gnus-cite-3 gnus-cite-4 gnus-cite-5 gnus-cite-6 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
310 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
|
311 "*List of faces used for highlighting citations. |
17493 | 312 |
313 When there are citations from multiple articles in the same message, | |
314 Gnus will try to give each citation from each article its own face. | |
315 This should make it easier to see who wrote what." | |
316 :group 'gnus-cite | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
317 :type '(repeat face) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
318 :set (lambda (symbol value) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
319 (prog1 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
320 (custom-set-default symbol value) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
321 (if (boundp 'gnus-message-max-citation-depth) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
322 (setq gnus-message-max-citation-depth (length value))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
323 (if (boundp 'gnus-message-citation-keywords) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
324 (setq gnus-message-citation-keywords |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
325 `((gnus-message-search-citation-line |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
326 ,@(let ((list nil) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
327 (count 1)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
328 (dolist (face value (nreverse list)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
329 (push (list count (list 'quote face) 'prepend t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
330 list) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
331 (setq count (1+ count))))))))))) |
17493 | 332 |
333 (defcustom gnus-cite-hide-percentage 50 | |
334 "Only hide excess citation if above this percentage of the body." | |
335 :group 'gnus-cite | |
336 :type 'number) | |
337 | |
338 (defcustom gnus-cite-hide-absolute 10 | |
339 "Only hide excess citation if above this number of lines in the body." | |
340 :group 'gnus-cite | |
341 :type 'integer) | |
342 | |
45202
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
343 (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
|
344 "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
|
345 :group 'gnus-cite |
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
346 :type 'boolean) |
79139aa0f18c
(gnus-cite-blank-line-after-header): New variable.
Miles Bader <miles@gnu.org>
parents:
42475
diff
changeset
|
347 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
348 ;; 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
|
349 ;; 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
|
350 (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
|
351 "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
|
352 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
|
353 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
|
354 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
|
355 :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
|
356 :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
|
357 |
17493 | 358 ;;; Internal Variables: |
359 | |
360 (defvar gnus-cite-article nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
361 (defvar gnus-cite-overlay-list nil) |
17493 | 362 |
363 (defvar gnus-cite-prefix-alist nil) | |
364 ;; Alist of citation prefixes. | |
365 ;; The cdr is a list of lines with that prefix. | |
366 | |
367 (defvar gnus-cite-attribution-alist nil) | |
368 ;; Alist of attribution lines. | |
369 ;; The car is a line number. | |
370 ;; The cdr is the prefix for the citation started by that line. | |
371 | |
372 (defvar gnus-cite-loose-prefix-alist nil) | |
373 ;; Alist of citation prefixes that have no matching attribution. | |
374 ;; The cdr is a list of lines with that prefix. | |
375 | |
376 (defvar gnus-cite-loose-attribution-alist nil) | |
377 ;; Alist of attribution lines that have no matching citation. | |
378 ;; Each member has the form (WROTE IN PREFIX TAG), where | |
379 ;; WROTE: is the attribution line number | |
380 ;; IN: is the line number of the previous line if part of the same attribution, | |
381 ;; PREFIX: Is the citation prefix of the attribution line(s), and | |
382 ;; TAG: Is a Supercite tag, if any. | |
383 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
384 (defvar gnus-cited-opened-text-button-line-format-alist |
17493 | 385 `((?b (marker-position beg) ?d) |
386 (?e (marker-position end) ?d) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
387 (?n (count-lines beg end) ?d) |
17493 | 388 (?l (- end beg) ?d))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
389 (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
|
390 (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
|
391 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
|
392 (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
|
393 |
17493 | 394 |
395 ;;; Commands: | |
396 | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
397 (defun gnus-article-highlight-citation (&optional force same-buffer) |
17493 | 398 "Highlight cited text. |
399 Each citation in the article will be highlighted with a different face. | |
400 The faces are taken from `gnus-cite-face-list'. | |
401 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
|
402 corresponding citation merged with the face `gnus-cite-attribution'. |
17493 | 403 |
404 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
|
405 lines matches `message-cite-prefix-regexp' with the same prefix. |
17493 | 406 |
407 Lines matching `gnus-cite-attribution-suffix' and perhaps | |
408 `gnus-cite-attribution-prefix' are considered attribution lines." | |
409 (interactive (list 'force)) | |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
410 (with-current-buffer (if same-buffer (current-buffer) gnus-article-buffer) |
17493 | 411 (gnus-cite-parse-maybe force) |
412 (let ((buffer-read-only nil) | |
413 (alist gnus-cite-prefix-alist) | |
414 (faces gnus-cite-face-list) | |
415 (inhibit-point-motion-hooks t) | |
416 face entry prefix skip numbers number face-alist) | |
417 ;; Loop through citation prefixes. | |
418 (while alist | |
419 (setq entry (car alist) | |
420 alist (cdr alist) | |
421 prefix (car entry) | |
422 numbers (cdr entry) | |
423 face (car faces) | |
424 faces (or (cdr faces) gnus-cite-face-list) | |
425 face-alist (cons (cons prefix face) face-alist)) | |
426 (while numbers | |
427 (setq number (car numbers) | |
428 numbers (cdr numbers)) | |
429 (and (not (assq number gnus-cite-attribution-alist)) | |
430 (not (assq number gnus-cite-loose-attribution-alist)) | |
431 (gnus-cite-add-face number prefix face)))) | |
432 ;; Loop through attribution lines. | |
433 (setq alist gnus-cite-attribution-alist) | |
434 (while alist | |
435 (setq entry (car alist) | |
436 alist (cdr alist) | |
437 number (car entry) | |
438 prefix (cdr entry) | |
439 skip (gnus-cite-find-prefix number) | |
440 face (cdr (assoc prefix face-alist))) | |
441 ;; Add attribution button. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
442 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
443 (forward-line (1- number)) |
17493 | 444 (when (re-search-forward gnus-cite-attribution-suffix |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
445 (point-at-eol) |
17493 | 446 t) |
447 (gnus-article-add-button (match-beginning 1) (match-end 1) | |
448 'gnus-cite-toggle prefix)) | |
449 ;; Highlight attribution line. | |
450 (gnus-cite-add-face number skip face) | |
451 (gnus-cite-add-face number skip gnus-cite-attribution-face)) | |
452 ;; Loop through attribution lines. | |
453 (setq alist gnus-cite-loose-attribution-alist) | |
454 (while alist | |
455 (setq entry (car alist) | |
456 alist (cdr alist) | |
457 number (car entry) | |
458 skip (gnus-cite-find-prefix number)) | |
459 (gnus-cite-add-face number skip gnus-cite-attribution-face))))) | |
460 | |
461 (defun gnus-dissect-cited-text () | |
462 "Dissect the article buffer looking for cited text." | |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
463 (with-current-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
|
464 (gnus-cite-parse-maybe nil t) |
17493 | 465 (let ((alist gnus-cite-prefix-alist) |
466 prefix numbers number marks m) | |
467 ;; Loop through citation prefixes. | |
468 (while alist | |
469 (setq numbers (pop alist) | |
470 prefix (pop numbers)) | |
471 (while numbers | |
472 (setq number (pop numbers)) | |
473 (goto-char (point-min)) | |
474 (forward-line number) | |
475 (push (cons (point-marker) "") marks) | |
476 (while (and numbers | |
477 (= (1- number) (car numbers))) | |
478 (setq number (pop numbers))) | |
479 (goto-char (point-min)) | |
480 (forward-line (1- number)) | |
481 (push (cons (point-marker) prefix) marks))) | |
482 ;; 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
|
483 (article-goto-body) |
17493 | 484 (push (cons (point-marker) "") marks) |
485 ;; Find the end of the body. | |
486 (goto-char (point-max)) | |
487 (gnus-article-search-signature) | |
488 (push (cons (point-marker) "") marks) | |
489 ;; Sort the marks. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
490 (setq marks (sort marks 'car-less-than-car)) |
17493 | 491 (let ((omarks marks)) |
492 (setq marks nil) | |
493 (while (cdr omarks) | |
494 (if (= (caar omarks) (caadr omarks)) | |
495 (progn | |
496 (unless (equal (cdar omarks) "") | |
497 (push (car omarks) marks)) | |
498 (unless (equal (cdadr omarks) "") | |
499 (push (cadr omarks) marks)) | |
500 (unless (and (equal (cdar omarks) "") | |
501 (equal (cdadr omarks) "") | |
502 (not (cddr omarks))) | |
503 (setq omarks (cdr omarks)))) | |
504 (push (car omarks) marks)) | |
505 (setq omarks (cdr omarks))) | |
506 (when (car omarks) | |
507 (push (car omarks) marks)) | |
508 (setq marks (setq m (nreverse marks))) | |
509 (while (cddr m) | |
510 (if (and (equal (cdadr m) "") | |
511 (equal (cdar m) (cdaddr m)) | |
512 (goto-char (caadr m)) | |
513 (forward-line 1) | |
514 (= (point) (caaddr m))) | |
515 (setcdr m (cdddr m)) | |
516 (setq m (cdr m)))) | |
517 marks)))) | |
518 | |
111269
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
519 (defun gnus-article-fill-cited-long-lines () |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
520 (gnus-article-fill-cited-article nil t)) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
521 |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
522 (defun gnus-article-fill-cited-article (&optional width long-lines) |
17493 | 523 "Do word wrapping in the current article. |
111269
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
524 If WIDTH (the numerical prefix), use that text width when |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
525 filling. If LONG-LINES, only fill sections that have lines |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
526 longer than the frame width." |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
527 (interactive "P") |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
528 (with-current-buffer gnus-article-buffer |
17493 | 529 (let ((buffer-read-only nil) |
530 (inhibit-point-motion-hooks t) | |
531 (marks (gnus-dissect-cited-text)) | |
532 (adaptive-fill-mode nil) | |
533 (filladapt-mode nil) | |
534 (fill-column (if width (prefix-numeric-value width) fill-column))) | |
535 (save-restriction | |
536 (while (cdr marks) | |
537 (narrow-to-region (caar marks) (caadr marks)) | |
538 (let ((adaptive-fill-regexp | |
539 (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
|
540 (fill-prefix |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
541 (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
|
542 (concat (cdar marks) " "))) |
111269
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
543 (do-fill (not long-lines)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
544 use-hard-newlines) |
111269
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
545 (unless do-fill |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
546 (setq do-fill (gnus-article-foldable-buffer (cdar marks)))) |
111317
bdfd83386e2d
gnus-cite.el (gnus-article-fill-cited-article): Make fill work properly for XEmacs as well.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111313
diff
changeset
|
547 ;; Note: the XEmacs version of `fill-region' inserts a newline |
bdfd83386e2d
gnus-cite.el (gnus-article-fill-cited-article): Make fill work properly for XEmacs as well.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111313
diff
changeset
|
548 ;; unless the region ends with a newline. |
111269
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
549 (when do-fill |
111312
0c7c9736f766
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111269
diff
changeset
|
550 (if (not long-lines) |
0c7c9736f766
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111269
diff
changeset
|
551 (fill-region (point-min) (point-max)) |
0c7c9736f766
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111269
diff
changeset
|
552 (goto-char (point-min)) |
0c7c9736f766
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111269
diff
changeset
|
553 (while (not (eobp)) |
0c7c9736f766
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111269
diff
changeset
|
554 (end-of-line) |
111317
bdfd83386e2d
gnus-cite.el (gnus-article-fill-cited-article): Make fill work properly for XEmacs as well.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111313
diff
changeset
|
555 (when (prog1 |
bdfd83386e2d
gnus-cite.el (gnus-article-fill-cited-article): Make fill work properly for XEmacs as well.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111313
diff
changeset
|
556 (> (current-column) (window-width)) |
bdfd83386e2d
gnus-cite.el (gnus-article-fill-cited-article): Make fill work properly for XEmacs as well.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111313
diff
changeset
|
557 (forward-line 1)) |
111312
0c7c9736f766
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111269
diff
changeset
|
558 (save-restriction |
111317
bdfd83386e2d
gnus-cite.el (gnus-article-fill-cited-article): Make fill work properly for XEmacs as well.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111313
diff
changeset
|
559 (narrow-to-region (line-beginning-position 0) (point)) |
bdfd83386e2d
gnus-cite.el (gnus-article-fill-cited-article): Make fill work properly for XEmacs as well.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111313
diff
changeset
|
560 (fill-region (point-min) (point-max)))))))) |
17493 | 561 (set-marker (caar marks) nil) |
562 (setq marks (cdr marks))) | |
563 (when marks | |
564 (set-marker (caar marks) nil)) | |
565 ;; All this information is now incorrect. | |
566 (setq gnus-cite-prefix-alist nil | |
567 gnus-cite-attribution-alist nil | |
568 gnus-cite-loose-prefix-alist nil | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
569 gnus-cite-loose-attribution-alist nil |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
570 gnus-cite-article nil))))) |
17493 | 571 |
111269
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
572 (defun gnus-article-foldable-buffer (prefix) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
573 (let ((do-fill nil) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
574 columns) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
575 (goto-char (point-min)) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
576 (while (not (eobp)) |
111313
1d510dd4f336
gnus-sum.el (gnus-print-buffer): Rewrite to use with-temp-buffer.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111312
diff
changeset
|
577 (unless (> (length prefix) (- (point-max) (point))) |
1d510dd4f336
gnus-sum.el (gnus-print-buffer): Rewrite to use with-temp-buffer.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111312
diff
changeset
|
578 (forward-char (length prefix))) |
111269
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
579 (skip-chars-forward " \t") |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
580 (unless (eolp) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
581 (let ((elem (assq (current-column) columns))) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
582 (unless elem |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
583 (setq elem (cons (current-column) 0)) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
584 (push elem columns)) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
585 (setcdr elem (1+ (cdr elem))))) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
586 (end-of-line) |
111317
bdfd83386e2d
gnus-cite.el (gnus-article-fill-cited-article): Make fill work properly for XEmacs as well.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111313
diff
changeset
|
587 (when (> (current-column) (window-width)) |
111269
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
588 (setq do-fill t)) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
589 (forward-line 1)) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
590 (and do-fill |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
591 ;; We know know that there are long lines here, but does this look |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
592 ;; like code? Check for ragged edges on the left. |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
593 (< (length columns) 3)))) |
3d7a1caabf14
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
594 |
17493 | 595 (defun gnus-article-hide-citation (&optional arg force) |
596 "Toggle hiding of all cited text except attribution lines. | |
597 See the documentation for `gnus-article-highlight-citation'. | |
598 If given a negative prefix, always show; if given a positive prefix, | |
599 always hide." | |
600 (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
|
601 (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
|
602 (gnus-set-format 'cited-closed-text-button t) |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
603 (with-current-buffer gnus-article-buffer |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
604 (let ((buffer-read-only nil) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
605 marks |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
606 (inhibit-point-motion-hooks t) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
607 (props (nconc (list 'article-type 'cite) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
608 gnus-hidden-properties)) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
609 (point (point-min)) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
610 found beg end start) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
611 (while (setq point |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
612 (text-property-any point (point-max) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
613 'gnus-callback |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
614 'gnus-article-toggle-cited-text)) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
615 (setq found t) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
616 (goto-char point) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
617 (gnus-article-toggle-cited-text |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
618 (get-text-property point 'gnus-data) arg) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
619 (forward-line 1) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
620 (setq point (point))) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
621 (unless found |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
622 (setq marks (gnus-dissect-cited-text)) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
623 (while marks |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
624 (setq beg nil |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
625 end nil) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
626 (while (and marks (string= (cdar marks) "")) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
627 (setq marks (cdr marks))) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
628 (when marks |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
629 (setq beg (caar marks))) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
630 (while (and marks (not (string= (cdar marks) ""))) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
631 (setq marks (cdr marks))) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
632 (when marks |
17493 | 633 (setq end (caar marks))) |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
634 ;; Skip past lines we want to leave visible. |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
635 (when (and beg end gnus-cited-lines-visible) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
636 (goto-char beg) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
637 (forward-line (if (consp gnus-cited-lines-visible) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
638 (car gnus-cited-lines-visible) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
639 gnus-cited-lines-visible)) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
640 (if (>= (point) end) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
641 (setq beg nil) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
642 (setq beg (point-marker)) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
643 (when (consp gnus-cited-lines-visible) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
644 (goto-char end) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
645 (forward-line (- (cdr gnus-cited-lines-visible))) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
646 (if (<= (point) beg) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
647 (setq beg nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
648 (setq end (point-marker)))))) |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
649 (when (and beg end) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
650 (gnus-add-wash-type 'cite) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
651 ;; We use markers for the end-points to facilitate later |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
652 ;; wrapping and mangling of text. |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
653 (setq beg (set-marker (make-marker) beg) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
654 end (set-marker (make-marker) end)) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
655 (gnus-add-text-properties-when 'article-type nil beg end props) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
656 (goto-char beg) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
657 (when (and gnus-cite-blank-line-after-header |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
658 (not (save-excursion (search-backward "\n\n" nil t)))) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
659 (insert "\n")) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
660 (put-text-property |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
661 (setq start (point-marker)) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
662 (progn |
17493 | 663 (gnus-article-add-button |
664 (point) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
665 (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
|
666 (point)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
667 `gnus-article-toggle-cited-text |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
668 (list (cons beg end) start)) |
17493 | 669 (point)) |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
670 'article-type 'annotation) |
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
671 (set-marker beg (point)))))))) |
17493 | 672 |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
673 (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
|
674 "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
|
675 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
|
676 means show, nil means toggle." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
677 (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
|
678 (beg (car region)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
679 (end (cdr region)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
680 (start (cadr args)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
681 (hidden |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
682 (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
|
683 (inhibit-point-motion-hooks t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
684 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
|
685 (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
|
686 (zerop arg) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
687 (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
|
688 (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
|
689 (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
|
690 (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
691 ;; 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
|
692 ;; 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
|
693 (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
|
694 '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
|
695 (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
|
696 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
|
697 (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
|
698 (gnus-add-text-properties-when |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45202
diff
changeset
|
699 '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
|
700 (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
|
701 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
|
702 (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
|
703 (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
|
704 (save-excursion |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
705 (goto-char start) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
706 (gnus-delete-line) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
707 (put-text-property |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
708 (point) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
709 (progn |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
710 (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
|
711 (point) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
712 (progn (eval |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
713 (if hidden |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
714 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
|
715 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
|
716 (point)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
717 `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
|
718 args) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
719 (point)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33374
diff
changeset
|
720 'article-type 'annotation))))) |
17493 | 721 |
722 (defun gnus-article-hide-citation-maybe (&optional arg force) | |
723 "Toggle hiding of cited text that has an attribution line. | |
724 If given a negative prefix, always show; if given a positive prefix, | |
725 always hide. | |
726 This will do nothing unless at least `gnus-cite-hide-percentage' | |
727 percent and at least `gnus-cite-hide-absolute' lines of the body is | |
728 cited text with attributions. When called interactively, these two | |
729 variables are ignored. | |
730 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
|
731 (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
|
732 (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
|
733 (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
|
734 (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
|
735 (save-excursion |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
736 (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
|
737 (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
|
738 (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
|
739 (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
|
740 (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
|
741 (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
|
742 (hidden 0) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
743 total) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
744 (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
|
745 (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
|
746 (setq total (count-lines start (point))) |
17493 | 747 (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
|
748 (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
|
749 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
|
750 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
|
751 (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
|
752 (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
|
753 (> 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
|
754 (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
|
755 (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
|
756 (while atts |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
757 (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
|
758 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
|
759 (while total |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
760 (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
|
761 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
|
762 (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
|
763 (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
|
764 (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
|
765 (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
|
766 (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
|
767 (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
|
768 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
|
769 (gnus-set-mode-line 'article))) |
17493 | 770 |
771 (defun gnus-article-hide-citation-in-followups () | |
772 "Hide cited text in non-root articles." | |
773 (interactive) | |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
774 (with-current-buffer gnus-article-buffer |
17493 | 775 (let ((article (cdr gnus-article-current))) |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
776 (unless (with-current-buffer gnus-summary-buffer |
17493 | 777 (gnus-article-displayed-root-p article)) |
778 (gnus-article-hide-citation))))) | |
779 | |
780 ;;; Internal functions: | |
781 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
782 (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
|
783 "Always parse the buffer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
784 (gnus-cite-localize) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
785 ;;Reset parser information. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
786 (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
|
787 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
|
788 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
|
789 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
|
790 (unless no-overlay |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
791 (gnus-cite-delete-overlays)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
792 ;; 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
|
793 (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
|
794 (> (buffer-size) gnus-cite-parse-max-size)) |
17493 | 795 () |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
796 (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
|
797 (cdr gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
798 (gnus-cite-parse-wrapper))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
799 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
800 (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
|
801 (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
|
802 (ignore-errors |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
803 (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
|
804 (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
|
805 (<= (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
|
806 (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
|
807 (ignore-errors |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
808 (gnus-delete-overlay overlay)))))) |
17493 | 809 |
810 (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
|
811 ;; 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
|
812 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
813 (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
|
814 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
815 (gnus-cite-parse-attributions)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
816 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
817 (gnus-cite-parse)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
818 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
819 (gnus-cite-connect-attributions)))) |
17493 | 820 |
821 (defun gnus-cite-parse () | |
822 ;; Parse and connect citation prefixes and attribution lines. | |
823 | |
824 ;; Parse current buffer searching for citation prefixes. | |
825 (let ((line (1+ (count-lines (point-min) (point)))) | |
826 (case-fold-search t) | |
827 (max (save-excursion | |
828 (goto-char (point-max)) | |
829 (gnus-article-search-signature) | |
830 (point))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
831 (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
|
832 alist entry start begin end numbers prefix guess-limit) |
17493 | 833 ;; Get all potential prefixes in `alist'. |
834 (while (< (point) max) | |
835 ;; Each line. | |
836 (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
|
837 guess-limit (progn (skip-chars-forward "^> \t\r\n") (point)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
838 end (point-at-bol 2) |
17493 | 839 start end) |
840 (goto-char begin) | |
841 ;; 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
|
842 (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
|
843 (looking-at gnus-supercite-regexp)) |
17493 | 844 (if (match-end 1) |
845 (setq end (1+ (match-end 1))) | |
846 (setq end (1+ begin)))) | |
847 ;; 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
|
848 (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
|
849 (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
|
850 ;; 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
|
851 (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
|
852 (prog2 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
853 (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
|
854 (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
|
855 (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
|
856 (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
|
857 (while (re-search-forward prefix-regexp (1- end) t) |
17493 | 858 ;; Each prefix. |
859 (setq end (match-end 0) | |
860 prefix (buffer-substring begin end)) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
861 (set-text-properties 0 (length prefix) nil prefix) |
17493 | 862 (setq entry (assoc prefix alist)) |
863 (if entry | |
864 (setcdr entry (cons line (cdr entry))) | |
865 (push (list prefix line) alist)) | |
866 (goto-char begin)) | |
867 (goto-char start) | |
868 (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
|
869 ;; 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
|
870 (goto-char (point-min)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
871 (setq start t begin nil entry nil) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
872 (while start |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
873 ;; Assume this search ends up at the beginning of a line. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
874 (if (re-search-forward gnus-cite-unsightly-citation-regexp max t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
875 (progn |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
876 (when (number-or-marker-p start) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
877 (setq begin (count-lines (point-min) start) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
878 end (count-lines (point-min) (match-beginning 0)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
879 (setq start (match-end 0))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
880 (when (number-or-marker-p start) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
881 (setq begin (count-lines (point-min) start) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
882 end (count-lines (point-min) max))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
883 (setq start nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
884 (when begin |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
885 (while (< begin end) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
886 ;; Need to do 1+ because we're in the bol. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
887 (push (setq begin (1+ begin)) entry)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
888 (when entry |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
889 (push (cons "" entry) alist)) |
17493 | 890 ;; We got all the potential prefixes. Now create |
891 ;; `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
|
892 ;; line that appears at least `gnus-cite-minimum-match-count' |
17493 | 893 ;; times. First sort them by length. Longer is older. |
894 (setq alist (sort alist (lambda (a b) | |
895 (> (length (car a)) (length (car b)))))) | |
896 (while alist | |
897 (setq entry (car alist) | |
898 prefix (car entry) | |
899 numbers (cdr entry) | |
900 alist (cdr alist)) | |
901 (cond ((null numbers) | |
902 ;; No lines with this prefix that wasn't also part of | |
903 ;; a longer prefix. | |
904 ) | |
905 ((< (length numbers) gnus-cite-minimum-match-count) | |
906 ;; Too few lines with this prefix. We keep it a bit | |
907 ;; longer in case it is an exact match for an attribution | |
908 ;; line, but we don't remove the line from other | |
909 ;; prefixes. | |
910 (push entry gnus-cite-prefix-alist)) | |
911 (t | |
912 (push entry | |
913 gnus-cite-prefix-alist) | |
914 ;; Remove articles from other prefixes. | |
915 (let ((loop alist) | |
916 current) | |
917 (while loop | |
918 (setq current (car loop) | |
919 loop (cdr loop)) | |
920 (setcdr current | |
921 (gnus-set-difference (cdr current) numbers))))))))) | |
922 | |
923 (defun gnus-cite-parse-attributions () | |
924 (let (al-alist) | |
925 ;; Parse attributions | |
926 (while (re-search-forward gnus-cite-attribution-suffix (point-max) t) | |
927 (let* ((start (match-beginning 0)) | |
928 (end (match-end 0)) | |
929 (wrote (count-lines (point-min) end)) | |
930 (prefix (gnus-cite-find-prefix wrote)) | |
931 ;; Check previous line for an attribution leader. | |
932 (tag (progn | |
933 (beginning-of-line 1) | |
934 (when (looking-at gnus-supercite-secondary-regexp) | |
935 (buffer-substring (match-beginning 1) | |
936 (match-end 1))))) | |
937 (in (progn | |
938 (goto-char start) | |
939 (and (re-search-backward gnus-cite-attribution-prefix | |
940 (save-excursion | |
941 (beginning-of-line 0) | |
942 (point)) | |
943 t) | |
944 (not (re-search-forward gnus-cite-attribution-suffix | |
945 start t)) | |
946 (count-lines (point-min) (1+ (point))))))) | |
947 (when (eq wrote in) | |
948 (setq in nil)) | |
949 (goto-char end) | |
950 ;; don't add duplicates | |
951 (let ((al (buffer-substring (save-excursion (beginning-of-line 0) | |
952 (1+ (point))) | |
953 end))) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
954 (when (not (assoc al al-alist)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
955 (push (list wrote in prefix tag) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
956 gnus-cite-loose-attribution-alist) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
957 (push (cons al t) al-alist))))))) |
17493 | 958 |
959 (defun gnus-cite-connect-attributions () | |
960 ;; Connect attributions to citations | |
961 | |
962 ;; No citations have been connected to attribution lines yet. | |
963 (setq gnus-cite-loose-prefix-alist (append gnus-cite-prefix-alist nil)) | |
964 | |
965 ;; Parse current buffer searching for attribution lines. | |
966 ;; Find exact supercite citations. | |
967 (gnus-cite-match-attributions 'small nil | |
968 (lambda (prefix tag) | |
969 (when tag | |
970 (concat "\\`" | |
971 (regexp-quote prefix) "[ \t]*" | |
972 (regexp-quote tag) ">")))) | |
973 ;; Find loose supercite citations after attributions. | |
974 (gnus-cite-match-attributions 'small t | |
975 (lambda (prefix tag) | |
976 (when tag | |
977 (concat "\\<" | |
978 (regexp-quote tag) | |
979 "\\>")))) | |
980 ;; Find loose supercite citations anywhere. | |
981 (gnus-cite-match-attributions 'small nil | |
982 (lambda (prefix tag) | |
983 (when tag | |
984 (concat "\\<" | |
985 (regexp-quote tag) | |
986 "\\>")))) | |
987 ;; Find nested citations after attributions. | |
988 (gnus-cite-match-attributions 'small-if-unique t | |
989 (lambda (prefix tag) | |
990 (concat "\\`" (regexp-quote prefix) ".+"))) | |
991 ;; Find nested citations anywhere. | |
992 (gnus-cite-match-attributions 'small nil | |
993 (lambda (prefix tag) | |
994 (concat "\\`" (regexp-quote prefix) ".+"))) | |
995 ;; Remove loose prefixes with too few lines. | |
996 (let ((alist gnus-cite-loose-prefix-alist) | |
997 entry) | |
998 (while alist | |
999 (setq entry (car alist) | |
1000 alist (cdr alist)) | |
1001 (when (< (length (cdr entry)) gnus-cite-minimum-match-count) | |
1002 (setq gnus-cite-prefix-alist | |
1003 (delq entry gnus-cite-prefix-alist) | |
1004 gnus-cite-loose-prefix-alist | |
1005 (delq entry gnus-cite-loose-prefix-alist))))) | |
1006 ;; Find flat attributions. | |
1007 (gnus-cite-match-attributions 'first t nil) | |
1008 ;; Find any attributions (are we getting desperate yet?). | |
1009 (gnus-cite-match-attributions 'first nil nil)) | |
1010 | |
1011 (defun gnus-cite-match-attributions (sort after fun) | |
1012 ;; Match all loose attributions and citations (SORT AFTER FUN) . | |
1013 ;; | |
1014 ;; If SORT is `small', the citation with the shortest prefix will be | |
1015 ;; used, if it is `first' the first prefix will be used, if it is | |
1016 ;; `small-if-unique' the shortest prefix will be used if the | |
1017 ;; attribution line does not share its own prefix with other | |
1018 ;; loose attribution lines, otherwise the first prefix will be used. | |
1019 ;; | |
1020 ;; If AFTER is non-nil, only citations after the attribution line | |
1021 ;; will be considered. | |
1022 ;; | |
1023 ;; If FUN is non-nil, it will be called with the arguments (WROTE | |
1024 ;; PREFIX TAG) and expected to return a regular expression. Only | |
1025 ;; citations whose prefix matches the regular expression will be | |
1026 ;; considered. | |
1027 ;; | |
1028 ;; WROTE is the attribution line number. | |
1029 ;; PREFIX is the attribution line prefix. | |
1030 ;; TAG is the Supercite tag on the attribution line. | |
1031 (let ((atts gnus-cite-loose-attribution-alist) | |
1032 (case-fold-search t) | |
1033 att wrote in prefix tag regexp limit smallest best size) | |
1034 (while atts | |
1035 (setq att (car atts) | |
1036 atts (cdr atts) | |
1037 wrote (nth 0 att) | |
1038 in (nth 1 att) | |
1039 prefix (nth 2 att) | |
1040 tag (nth 3 att) | |
1041 regexp (if fun (funcall fun prefix tag) "") | |
1042 size (cond ((eq sort 'small) t) | |
1043 ((eq sort 'first) nil) | |
1044 (t (< (length (gnus-cite-find-loose prefix)) 2))) | |
1045 limit (if after wrote -1) | |
1046 smallest 1000000 | |
1047 best nil) | |
1048 (let ((cites gnus-cite-loose-prefix-alist) | |
1049 cite candidate numbers first compare) | |
1050 (while cites | |
1051 (setq cite (car cites) | |
1052 cites (cdr cites) | |
1053 candidate (car cite) | |
1054 numbers (cdr cite) | |
1055 first (apply 'min numbers) | |
1056 compare (if size (length candidate) first)) | |
1057 (and (> first limit) | |
1058 regexp | |
1059 (string-match regexp candidate) | |
1060 (< compare smallest) | |
1061 (setq best cite | |
1062 smallest compare)))) | |
1063 (if (null best) | |
1064 () | |
1065 (setq gnus-cite-loose-attribution-alist | |
1066 (delq att gnus-cite-loose-attribution-alist)) | |
1067 (push (cons wrote (car best)) gnus-cite-attribution-alist) | |
1068 (when in | |
1069 (push (cons in (car best)) gnus-cite-attribution-alist)) | |
1070 (when (memq best gnus-cite-loose-prefix-alist) | |
1071 (let ((loop gnus-cite-prefix-alist) | |
1072 (numbers (cdr best)) | |
1073 current) | |
1074 (setq gnus-cite-loose-prefix-alist | |
1075 (delq best gnus-cite-loose-prefix-alist)) | |
1076 (while loop | |
1077 (setq current (car loop) | |
1078 loop (cdr loop)) | |
1079 (if (eq current best) | |
1080 () | |
1081 (setcdr current (gnus-set-difference (cdr current) numbers)) | |
1082 (when (null (cdr current)) | |
1083 (setq gnus-cite-loose-prefix-alist | |
1084 (delq current gnus-cite-loose-prefix-alist) | |
1085 atts (delq current atts))))))))))) | |
1086 | |
1087 (defun gnus-cite-find-loose (prefix) | |
1088 ;; Return a list of loose attribution lines prefixed by PREFIX. | |
1089 (let* ((atts gnus-cite-loose-attribution-alist) | |
1090 att line lines) | |
1091 (while atts | |
1092 (setq att (car atts) | |
1093 line (car att) | |
1094 atts (cdr atts)) | |
1095 (when (string-equal (gnus-cite-find-prefix line) prefix) | |
1096 (push line lines))) | |
1097 lines)) | |
1098 | |
1099 (defun gnus-cite-add-face (number prefix face) | |
1100 ;; At line NUMBER, ignore PREFIX and add FACE to the rest of the line. | |
1101 (when face | |
1102 (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
|
1103 from to overlay) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1104 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1105 (when (zerop (forward-line (1- number))) |
17493 | 1106 (forward-char (length prefix)) |
1107 (skip-chars-forward " \t") | |
1108 (setq from (point)) | |
1109 (end-of-line 1) | |
1110 (skip-chars-backward " \t") | |
1111 (setq to (point)) | |
1112 (when (< from to) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1113 (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
|
1114 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
|
1115 (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
|
1116 (gnus-overlay-put overlay 'face face)))))) |
17493 | 1117 |
1118 (defun gnus-cite-toggle (prefix) | |
110089
a718416592e8
Fix up some byte-compiler warnings.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
110073
diff
changeset
|
1119 (with-current-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
|
1120 (gnus-cite-parse-maybe nil t) |
17493 | 1121 (let ((buffer-read-only nil) |
1122 (numbers (cdr (assoc prefix gnus-cite-prefix-alist))) | |
1123 (inhibit-point-motion-hooks t) | |
1124 number) | |
1125 (while numbers | |
1126 (setq number (car numbers) | |
1127 numbers (cdr numbers)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1128 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1129 (forward-line (1- number)) |
17493 | 1130 (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
|
1131 ;; 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
|
1132 ;; multiple citations may be hidden -jas |
17493 | 1133 (remove-text-properties (point) (progn (forward-line 1) (point)) |
1134 gnus-hidden-properties)) | |
1135 ((assq number gnus-cite-attribution-alist)) | |
1136 (t | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1137 (gnus-add-wash-type 'cite) |
17493 | 1138 (gnus-add-text-properties |
1139 (point) (progn (forward-line 1) (point)) | |
1140 (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
|
1141 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
|
1142 (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
|
1143 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
|
1144 (gnus-set-mode-line 'article)))))) |
17493 | 1145 |
1146 (defun gnus-cite-find-prefix (line) | |
1147 ;; Return citation prefix for LINE. | |
1148 (let ((alist gnus-cite-prefix-alist) | |
1149 (prefix "") | |
1150 entry) | |
1151 (while alist | |
1152 (setq entry (car alist) | |
1153 alist (cdr alist)) | |
1154 (when (memq line (cdr entry)) | |
1155 (setq prefix (car entry)))) | |
1156 prefix)) | |
1157 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1158 (defun gnus-cite-localize () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1159 "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
|
1160 (let ((vars '(gnus-cite-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1161 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
|
1162 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
|
1163 gnus-cite-loose-attribution-alist))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1164 (while vars |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1165 (make-local-variable (pop vars))))) |
17493 | 1166 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1167 (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
|
1168 "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
|
1169 (save-excursion |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1170 (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
|
1171 (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
|
1172 (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
|
1173 (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
|
1174 prefix) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1175 (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
|
1176 found))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1177 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1178 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1179 ;; Highlighting of different citation levels in message-mode. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1180 ;; - message-cite-prefix will be overridden if this is enabled. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1181 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1182 (defvar gnus-message-max-citation-depth |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1183 (length gnus-cite-face-list) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1184 "Maximum supported level of citation.") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1185 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1186 (defvar gnus-message-cite-prefix-regexp |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1187 (concat "^\\(?:" message-cite-prefix-regexp "\\)")) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1188 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1189 (defun gnus-message-search-citation-line (limit) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1190 "Search for a cited line and set match data accordingly. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1191 Returns nil if there is no such line before LIMIT, t otherwise." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1192 (when (re-search-forward gnus-message-cite-prefix-regexp limit t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1193 (let ((cdepth (min (length (apply 'concat |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1194 (split-string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1195 (match-string-no-properties 0) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1196 "[ \t [:alnum:]]+"))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1197 gnus-message-max-citation-depth)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1198 (mlist (make-list (* (1+ gnus-message-max-citation-depth) 2) nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1199 (start (point-at-bol)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1200 (end (point-at-eol))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1201 (setcar mlist start) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1202 (setcar (cdr mlist) end) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1203 (setcar (nthcdr (* cdepth 2) mlist) start) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1204 (setcar (nthcdr (1+ (* cdepth 2)) mlist) end) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1205 (set-match-data mlist)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1206 t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1207 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1208 (defvar gnus-message-citation-keywords |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1209 ;; eval-when-compile ;; This breaks in XEmacs |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1210 `((gnus-message-search-citation-line |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1211 ,@(let ((list nil) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1212 (count 1)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1213 ;; (require 'gnus-cite) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1214 (dolist (face gnus-cite-face-list (nreverse list)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1215 (push (list count (list 'quote face) 'prepend t) list) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1216 (setq count (1+ count)))))) ;; |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1217 "Keywords for highlighting different levels of message citations.") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1218 |
86154 | 1219 (defvar font-lock-defaults-computed) |
1220 (defvar font-lock-keywords) | |
1221 (defvar font-lock-set-defaults) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1222 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1223 (eval-and-compile |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1224 (unless (featurep 'xemacs) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1225 (autoload 'font-lock-set-defaults "font-lock"))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1226 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1227 (define-minor-mode gnus-message-citation-mode |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1228 "Toggle `gnus-message-citation-mode' in current buffer. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1229 This buffer local minor mode provides additional font-lock support for |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1230 nested citations. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1231 With prefix ARG, turn `gnus-message-citation-mode' on if and only if ARG |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1232 is positive. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1233 Automatically turn `font-lock-mode' on when `gnus-message-citation-mode' |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1234 is turned on." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1235 nil ;; init-value |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1236 "" ;; lighter |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1237 nil ;; keymap |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1238 (when (eq major-mode 'message-mode) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1239 (let ((defaults (car (if (featurep 'xemacs) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1240 (get 'message-mode 'font-lock-defaults) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1241 font-lock-defaults))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1242 default keywords) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1243 (while defaults |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1244 (setq default (if (consp defaults) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1245 (pop defaults) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1246 (prog1 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1247 defaults |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1248 (setq defaults nil)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1249 (if gnus-message-citation-mode |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1250 ;; `gnus-message-citation-keywords' should be the last |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1251 ;; elements of the keywords because the others are unlikely |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1252 ;; to have the OVERRIDE flags -- XEmacs applies a keyword |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1253 ;; having no OVERRIDE flag to matched text even if it has |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1254 ;; already other faces, while Emacs doesn't. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1255 (set (make-local-variable default) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1256 (append (default-value default) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1257 gnus-message-citation-keywords)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1258 (kill-local-variable default)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1259 ;; Force `font-lock-set-defaults' to update `font-lock-keywords'. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1260 (if (featurep 'xemacs) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1261 (progn |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1262 (require 'font-lock) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1263 (setq font-lock-defaults-computed nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1264 font-lock-keywords nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1265 (setq font-lock-set-defaults nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1266 (font-lock-set-defaults) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1267 (cond ((symbol-value 'font-lock-mode) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1268 (font-lock-fontify-buffer)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1269 (gnus-message-citation-mode |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1270 (font-lock-mode 1))))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1271 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1272 (defun turn-on-gnus-message-citation-mode () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1273 "Turn on `gnus-message-citation-mode'." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1274 (gnus-message-citation-mode 1)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1275 (defun turn-off-gnus-message-citation-mode () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1276 "Turn off `gnus-message-citation-mode'." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1277 (gnus-message-citation-mode -1)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1278 |
17493 | 1279 (gnus-ems-redefine) |
1280 | |
1281 (provide 'gnus-cite) | |
1282 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1283 ;; Local Variables: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1284 ;; coding: iso-8859-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1285 ;; End: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1286 |
17493 | 1287 ;;; gnus-cite.el ends here |