Mercurial > emacs
annotate lisp/gnus/gnus-art.el @ 41446:4d04ea305201
Fix typo in comment.
author | Pavel Janík <Pavel@Janik.cz> |
---|---|
date | Sat, 24 Nov 2001 17:10:39 +0000 |
parents | 65ef5b3fc045 |
children | 0f4506820432 |
rev | line source |
---|---|
17493 | 1 ;;; gnus-art.el --- article mode commands for Gnus |
39335
65ef5b3fc045
(gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents:
38861
diff
changeset
|
2 |
65ef5b3fc045
(gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents:
38861
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 |
65ef5b3fc045
(gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents:
38861
diff
changeset
|
4 ;; Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 7 ;; Keywords: news |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;;; Code: | |
29 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
31 |
17493 | 32 (require 'gnus) |
33 (require 'gnus-sum) | |
34 (require 'gnus-spec) | |
35 (require 'gnus-int) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
36 (require 'mm-bodies) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
37 (require 'mail-parse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
38 (require 'mm-decode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
39 (require 'mm-view) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
40 (require 'wid-edit) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
41 (require 'mm-uu) |
17493 | 42 |
43 (defgroup gnus-article nil | |
44 "Article display." | |
45 :link '(custom-manual "(gnus)The Article Buffer") | |
46 :group 'gnus) | |
47 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
48 (defgroup gnus-article-treat nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
49 "Treating article parts." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
50 :link '(custom-manual "(gnus)Article Hiding") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
51 :group 'gnus-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
52 |
17493 | 53 (defgroup gnus-article-hiding nil |
54 "Hiding article parts." | |
55 :link '(custom-manual "(gnus)Article Hiding") | |
56 :group 'gnus-article) | |
57 | |
58 (defgroup gnus-article-highlight nil | |
59 "Article highlighting." | |
60 :link '(custom-manual "(gnus)Article Highlighting") | |
61 :group 'gnus-article | |
62 :group 'gnus-visual) | |
63 | |
64 (defgroup gnus-article-signature nil | |
65 "Article signatures." | |
66 :link '(custom-manual "(gnus)Article Signature") | |
67 :group 'gnus-article) | |
68 | |
69 (defgroup gnus-article-headers nil | |
70 "Article headers." | |
71 :link '(custom-manual "(gnus)Hiding Headers") | |
72 :group 'gnus-article) | |
73 | |
74 (defgroup gnus-article-washing nil | |
75 "Special commands on articles." | |
76 :link '(custom-manual "(gnus)Article Washing") | |
77 :group 'gnus-article) | |
78 | |
79 (defgroup gnus-article-emphasis nil | |
80 "Fontisizing articles." | |
81 :link '(custom-manual "(gnus)Article Fontisizing") | |
82 :group 'gnus-article) | |
83 | |
84 (defgroup gnus-article-saving nil | |
85 "Saving articles." | |
86 :link '(custom-manual "(gnus)Saving Articles") | |
87 :group 'gnus-article) | |
88 | |
89 (defgroup gnus-article-mime nil | |
90 "Worshiping the MIME wonder." | |
91 :link '(custom-manual "(gnus)Using MIME") | |
92 :group 'gnus-article) | |
93 | |
94 (defgroup gnus-article-buttons nil | |
95 "Pushable buttons in the article buffer." | |
96 :link '(custom-manual "(gnus)Article Buttons") | |
97 :group 'gnus-article) | |
98 | |
99 (defgroup gnus-article-various nil | |
100 "Other article options." | |
101 :link '(custom-manual "(gnus)Misc Article") | |
102 :group 'gnus-article) | |
103 | |
104 (defcustom gnus-ignored-headers | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
105 '("^Path:" "^Expires:" "^Date-Received:" "^References:" "^Xref:" "^Lines:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
106 "^Relay-Version:" "^Message-ID:" "^Approved:" "^Sender:" "^Received:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
107 "^X-UIDL:" "^MIME-Version:" "^Return-Path:" "^In-Reply-To:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
108 "^Content-Type:" "^Content-Transfer-Encoding:" "^X-WebTV-Signature:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
109 "^X-MimeOLE:" "^X-MSMail-Priority:" "^X-Priority:" "^X-Loop:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
110 "^X-Authentication-Warning:" "^X-MIME-Autoconverted:" "^X-Face:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
111 "^X-Attribution:" "^X-Originating-IP:" "^Delivered-To:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
112 "^NNTP-[-A-Za-z]+:" "^Distribution:" "^X-no-archive:" "^X-Trace:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
113 "^X-Complaints-To:" "^X-NNTP-Posting-Host:" "^X-Orig.*:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
114 "^Abuse-Reports-To:" "^Cache-Post-Path:" "^X-Article-Creation-Date:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
115 "^X-Poster:" "^X-Mail2News-Path:" "^X-Server-Date:" "^X-Cache:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
116 "^Originator:" "^X-Problems-To:" "^X-Auth-User:" "^X-Post-Time:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
117 "^X-Admin:" "^X-UID:" "^Resent-[-A-Za-z]+:" "^X-Mailing-List:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
118 "^Precedence:" "^Original-[-A-Za-z]+:" "^X-filename:" "^X-Orcpt:" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
119 "^Old-Received:" "^X-Pgp" "^X-Auth:" "^X-From-Line:" |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
120 "^X-Gnus-Article-Number:" "^X-Majordomo:" "^X-Url:" "^X-Sender:" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
121 "^MBOX-Line" "^Priority:" "^X-Pgp" "^X400-[-A-Za-z]+:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
122 "^Status:" "^X-Gnus-Mail-Source:" "^Cancel-Lock:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
123 "^X-FTN" "^X-EXP32-SerialNo:" "^Encoding:" "^Importance:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
124 "^Autoforwarded:" "^Original-Encoded-Information-Types:" "^X-Ya-Pop3:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
125 "^X-Face-Version:" "^X-Vms-To:" "^X-ML-NAME:" "^X-ML-COUNT:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
126 "^Mailing-List:" "^X-finfo:" "^X-md5sum:" "^X-md5sum-Origin:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
127 "^X-Sun-Charset:" "^X-Accept-Language:" "^X-Envelope-Sender:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
128 "^List-[A-Za-z]+:" "^X-Listprocessor-Version:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
129 "^X-Received:" "^X-Distribute:" "^X-Sequence:" "^X-Juno-Line-Breaks:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
130 "^X-Notes-Item:" "^X-MS-TNEF-Correlator:" "^x-uunet-gateway:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
131 "^X-Received:" "^Content-length:" "X-precedence:") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
132 "*All headers that start with this regexp will be hidden. |
17493 | 133 This variable can also be a list of regexps of headers to be ignored. |
134 If `gnus-visible-headers' is non-nil, this variable will be ignored." | |
135 :type '(choice :custom-show nil | |
136 regexp | |
137 (repeat regexp)) | |
138 :group 'gnus-article-hiding) | |
139 | |
140 (defcustom gnus-visible-headers | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
141 "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^[BGF]?Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-From:\\|^X-Sent:" |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
142 "*All headers that do not match this regexp will be hidden. |
17493 | 143 This variable can also be a list of regexp of headers to remain visible. |
144 If this variable is non-nil, `gnus-ignored-headers' will be ignored." | |
145 :type '(repeat :value-to-internal (lambda (widget value) | |
146 (custom-split-regexp-maybe value)) | |
147 :match (lambda (widget value) | |
148 (or (stringp value) | |
149 (widget-editable-list-match widget value))) | |
150 regexp) | |
151 :group 'gnus-article-hiding) | |
152 | |
153 (defcustom gnus-sorted-header-list | |
154 '("^From:" "^Subject:" "^Summary:" "^Keywords:" "^Newsgroups:" | |
155 "^Followup-To:" "^To:" "^Cc:" "^Date:" "^Organization:") | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
156 "*This variable is a list of regular expressions. |
17493 | 157 If it is non-nil, headers that match the regular expressions will |
158 be placed first in the article buffer in the sequence specified by | |
159 this list." | |
160 :type '(repeat regexp) | |
161 :group 'gnus-article-hiding) | |
162 | |
163 (defcustom gnus-boring-article-headers '(empty followup-to reply-to) | |
164 "Headers that are only to be displayed if they have interesting data. | |
165 Possible values in this list are `empty', `newsgroups', `followup-to', | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
166 `reply-to', `date', `long-to', and `many-to'." |
17493 | 167 :type '(set (const :tag "Headers with no content." empty) |
168 (const :tag "Newsgroups with only one group." newsgroups) | |
169 (const :tag "Followup-to identical to newsgroups." followup-to) | |
170 (const :tag "Reply-to identical to from." reply-to) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
171 (const :tag "Date less than four days old." date) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
172 (const :tag "Very long To and/or Cc header." long-to) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
173 (const :tag "Multiple To and/or Cc headers." many-to)) |
17493 | 174 :group 'gnus-article-hiding) |
175 | |
176 (defcustom gnus-signature-separator '("^-- $" "^-- *$") | |
177 "Regexp matching signature separator. | |
178 This can also be a list of regexps. In that case, it will be checked | |
179 from head to tail looking for a separator. Searches will be done from | |
180 the end of the buffer." | |
181 :type '(repeat string) | |
182 :group 'gnus-article-signature) | |
183 | |
184 (defcustom gnus-signature-limit nil | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
185 "Provide a limit to what is considered a signature. |
17493 | 186 If it is a number, no signature may not be longer (in characters) than |
187 that number. If it is a floating point number, no signature may be | |
188 longer (in lines) than that number. If it is a function, the function | |
189 will be called without any parameters, and if it returns nil, there is | |
190 no signature in the buffer. If it is a string, it will be used as a | |
191 regexp. If it matches, the text in question is not a signature." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
192 :type '(choice (integer :value 200) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
193 (number :value 4.0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
194 (function :value fun) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
195 (regexp :value ".*")) |
17493 | 196 :group 'gnus-article-signature) |
197 | |
198 (defcustom gnus-hidden-properties '(invisible t intangible t) | |
199 "Property list to use for hiding text." | |
200 :type 'sexp | |
201 :group 'gnus-article-hiding) | |
202 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
203 ;; Fixme: This isn't the right thing for mixed graphical and and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
204 ;; non-graphical frames in a session. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
205 ;; gnus-xmas.el overrides this for XEmacs. |
17493 | 206 (defcustom gnus-article-x-face-command |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
207 (if (and (fboundp 'image-type-available-p) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
208 (image-type-available-p 'xbm)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
209 'gnus-article-display-xface |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
210 (if gnus-article-compface-xbm |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
211 "{ echo '/* Width=48, Height=48 */'; uncompface; } | display -" |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
212 "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | \ |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
213 display -")) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
214 "*String or function to be executed to display an X-Face header. |
17493 | 215 If it is a string, the command will be executed in a sub-shell |
216 asynchronously. The compressed face will be piped to this command." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
217 :type '(choice string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
218 (function-item gnus-article-display-xface) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
219 function) |
35759 | 220 :version "21.1" |
17493 | 221 :group 'gnus-article-washing) |
222 | |
223 (defcustom gnus-article-x-face-too-ugly nil | |
224 "Regexp matching posters whose face shouldn't be shown automatically." | |
23361
86b5dc6c12f5
(gnus-article-x-face-too-ugly): Fix type.
Karl Heuer <kwzh@gnu.org>
parents:
22584
diff
changeset
|
225 :type '(choice regexp (const nil)) |
17493 | 226 :group 'gnus-article-washing) |
227 | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
228 (defcustom gnus-article-banner-alist nil |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
229 "Banner alist for stripping. |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
230 For example, |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
231 ((egroups . \"^[ \\t\\n]*-------------------+\\\\( eGroups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))" |
33397 | 232 :version "21.1" |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
233 :type '(repeat (cons symbol regexp)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
234 :group 'gnus-article-washing) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
235 |
17493 | 236 (defcustom gnus-emphasis-alist |
237 (let ((format | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
238 "\\(\\s-\\|^\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\s-\\|[-,;:\"]\\s-\\|[?!.]+\\s-\\|\\s)\\)") |
17493 | 239 (types |
240 '(("_" "_" underline) | |
241 ("/" "/" italic) | |
242 ("\\*" "\\*" bold) | |
243 ("_/" "/_" underline-italic) | |
244 ("_\\*" "\\*_" underline-bold) | |
245 ("\\*/" "/\\*" bold-italic) | |
246 ("_\\*/" "/\\*_" underline-bold-italic)))) | |
247 `(("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)" | |
248 2 3 gnus-emphasis-underline) | |
249 ,@(mapcar | |
250 (lambda (spec) | |
251 (list | |
252 (format format (car spec) (cadr spec)) | |
21486
900aecbf7d38
(gnus-emphasis-alist): Use nth, not caddr.
Karl Heuer <kwzh@gnu.org>
parents:
20119
diff
changeset
|
253 2 3 (intern (format "gnus-emphasis-%s" (nth 2 spec))))) |
17493 | 254 types))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
255 "*Alist that says how to fontify certain phrases. |
17493 | 256 Each item looks like this: |
257 | |
258 (\"_\\\\(\\\\w+\\\\)_\" 0 1 'underline) | |
259 | |
260 The first element is a regular expression to be matched. The second | |
261 is a number that says what regular expression grouping used to find | |
262 the entire emphasized word. The third is a number that says what | |
263 regexp grouping should be displayed and highlighted. The fourth | |
264 is the face used for highlighting." | |
265 :type '(repeat (list :value ("" 0 0 default) | |
266 regexp | |
267 (integer :tag "Match group") | |
268 (integer :tag "Emphasize group") | |
269 face)) | |
270 :group 'gnus-article-emphasis) | |
271 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
272 (defcustom gnus-emphasize-whitespace-regexp "^[ \t]+\\|[ \t]*\n" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
273 "A regexp to describe whitespace which should not be emphasized. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
274 Typical values are \"^[ \\t]+\\\\|[ \\t]*\\n\" and \"[ \\t]+\\\\|[ \\t]*\\n\". |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
275 The former avoids underlining of leading and trailing whitespace, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
276 and the latter avoids underlining any whitespace at all." |
33397 | 277 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
278 :group 'gnus-article-emphasis |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
279 :type 'regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
280 |
17493 | 281 (defface gnus-emphasis-bold '((t (:bold t))) |
282 "Face used for displaying strong emphasized text (*word*)." | |
283 :group 'gnus-article-emphasis) | |
284 | |
285 (defface gnus-emphasis-italic '((t (:italic t))) | |
286 "Face used for displaying italic emphasized text (/word/)." | |
287 :group 'gnus-article-emphasis) | |
288 | |
289 (defface gnus-emphasis-underline '((t (:underline t))) | |
290 "Face used for displaying underlined emphasized text (_word_)." | |
291 :group 'gnus-article-emphasis) | |
292 | |
293 (defface gnus-emphasis-underline-bold '((t (:bold t :underline t))) | |
294 "Face used for displaying underlined bold emphasized text (_*word*_)." | |
295 :group 'gnus-article-emphasis) | |
296 | |
297 (defface gnus-emphasis-underline-italic '((t (:italic t :underline t))) | |
25382
925a1c3dd62a
(gnus-emphasis-underline-italic): Doc fix.
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
298 "Face used for displaying underlined italic emphasized text (_/word/_)." |
17493 | 299 :group 'gnus-article-emphasis) |
300 | |
301 (defface gnus-emphasis-bold-italic '((t (:bold t :italic t))) | |
302 "Face used for displaying bold italic emphasized text (/*word*/)." | |
303 :group 'gnus-article-emphasis) | |
304 | |
305 (defface gnus-emphasis-underline-bold-italic | |
306 '((t (:bold t :italic t :underline t))) | |
307 "Face used for displaying underlined bold italic emphasized text. | |
308 Esample: (_/*word*/_)." | |
309 :group 'gnus-article-emphasis) | |
310 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
311 (defface gnus-emphasis-highlight-words |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
312 '((t (:background "black" :foreground "yellow"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
313 "Face used for displaying highlighted words." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
314 :group 'gnus-article-emphasis) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
315 |
17493 | 316 (defcustom gnus-article-time-format "%a, %b %d %Y %T %Z" |
317 "Format for display of Date headers in article bodies. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
318 See `format-time-string' for the possible values. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
319 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
320 The variable can also be function, which should return a complete Date |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
321 header. The function is called with one argument, the time, which can |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
322 be fed to `format-time-string'." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
323 :type '(choice string symbol) |
17493 | 324 :link '(custom-manual "(gnus)Article Date") |
325 :group 'gnus-article-washing) | |
326 | |
327 (eval-and-compile | |
328 (autoload 'mail-extract-address-components "mail-extr")) | |
329 | |
330 (defcustom gnus-save-all-headers t | |
331 "*If non-nil, don't remove any headers before saving." | |
332 :group 'gnus-article-saving | |
333 :type 'boolean) | |
334 | |
335 (defcustom gnus-prompt-before-saving 'always | |
336 "*This variable says how much prompting is to be done when saving articles. | |
337 If it is nil, no prompting will be done, and the articles will be | |
338 saved to the default files. If this variable is `always', each and | |
339 every article that is saved will be preceded by a prompt, even when | |
340 saving large batches of articles. If this variable is neither nil not | |
341 `always', there the user will be prompted once for a file name for | |
342 each invocation of the saving commands." | |
343 :group 'gnus-article-saving | |
344 :type '(choice (item always) | |
345 (item :tag "never" nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
346 (sexp :tag "once" :format "%t\n" :value t))) |
17493 | 347 |
348 (defcustom gnus-saved-headers gnus-visible-headers | |
349 "Headers to keep if `gnus-save-all-headers' is nil. | |
350 If `gnus-save-all-headers' is non-nil, this variable will be ignored. | |
351 If that variable is nil, however, all headers that match this regexp | |
352 will be kept while the rest will be deleted before saving." | |
353 :group 'gnus-article-saving | |
23361
86b5dc6c12f5
(gnus-article-x-face-too-ugly): Fix type.
Karl Heuer <kwzh@gnu.org>
parents:
22584
diff
changeset
|
354 :type 'regexp) |
17493 | 355 |
356 (defcustom gnus-default-article-saver 'gnus-summary-save-in-rmail | |
357 "A function to save articles in your favourite format. | |
358 The function must be interactively callable (in other words, it must | |
359 be an Emacs command). | |
360 | |
361 Gnus provides the following functions: | |
362 | |
363 * gnus-summary-save-in-rmail (Rmail format) | |
364 * gnus-summary-save-in-mail (Unix mail format) | |
365 * gnus-summary-save-in-folder (MH folder) | |
366 * gnus-summary-save-in-file (article format) | |
367 * gnus-summary-save-in-vm (use VM's folder format) | |
368 * gnus-summary-write-to-file (article format -- overwrite)." | |
369 :group 'gnus-article-saving | |
370 :type '(radio (function-item gnus-summary-save-in-rmail) | |
371 (function-item gnus-summary-save-in-mail) | |
372 (function-item gnus-summary-save-in-folder) | |
373 (function-item gnus-summary-save-in-file) | |
374 (function-item gnus-summary-save-in-vm) | |
375 (function-item gnus-summary-write-to-file))) | |
376 | |
377 (defcustom gnus-rmail-save-name 'gnus-plain-save-name | |
378 "A function generating a file name to save articles in Rmail format. | |
379 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE." | |
380 :group 'gnus-article-saving | |
381 :type 'function) | |
382 | |
383 (defcustom gnus-mail-save-name 'gnus-plain-save-name | |
384 "A function generating a file name to save articles in Unix mail format. | |
385 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE." | |
386 :group 'gnus-article-saving | |
387 :type 'function) | |
388 | |
389 (defcustom gnus-folder-save-name 'gnus-folder-save-name | |
390 "A function generating a file name to save articles in MH folder. | |
391 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER." | |
392 :group 'gnus-article-saving | |
393 :type 'function) | |
394 | |
395 (defcustom gnus-file-save-name 'gnus-numeric-save-name | |
396 "A function generating a file name to save articles in article format. | |
397 The function is called with NEWSGROUP, HEADERS, and optional | |
398 LAST-FILE." | |
399 :group 'gnus-article-saving | |
400 :type 'function) | |
401 | |
402 (defcustom gnus-split-methods | |
403 '((gnus-article-archive-name) | |
404 (gnus-article-nndoc-name)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
405 "*Variable used to suggest where articles are to be saved. |
17493 | 406 For instance, if you would like to save articles related to Gnus in |
407 the file \"gnus-stuff\", and articles related to VM in \"vm-stuff\", | |
408 you could set this variable to something like: | |
409 | |
410 '((\"^Subject:.*gnus\\|^Newsgroups:.*gnus\" \"gnus-stuff\") | |
411 (\"^Subject:.*vm\\|^Xref:.*vm\" \"vm-stuff\")) | |
412 | |
413 This variable is an alist where the where the key is the match and the | |
414 value is a list of possible files to save in if the match is non-nil. | |
415 | |
416 If the match is a string, it is used as a regexp match on the | |
417 article. If the match is a symbol, that symbol will be funcalled | |
418 from the buffer of the article to be saved with the newsgroup as the | |
419 parameter. If it is a list, it will be evaled in the same buffer. | |
420 | |
421 If this form or function returns a string, this string will be used as | |
422 a possible file name; and if it returns a non-nil list, that list will | |
423 be used as possible file names." | |
424 :group 'gnus-article-saving | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
425 :type '(repeat (choice (list :value (fun) function) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
426 (cons :value ("" "") regexp (repeat string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
427 (sexp :value nil)))) |
17493 | 428 |
429 (defcustom gnus-page-delimiter "^\^L" | |
430 "*Regexp describing what to use as article page delimiters. | |
431 The default value is \"^\^L\", which is a form linefeed at the | |
432 beginning of a line." | |
433 :type 'regexp | |
434 :group 'gnus-article-various) | |
435 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
436 (defcustom gnus-article-mode-line-format "Gnus: %g [%w] %S%m" |
17493 | 437 "*The format specification for the article mode line. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
438 See `gnus-summary-mode-line-format' for a closer description. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
439 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
440 The following additional specs are available: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
441 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
442 %w The article washing status. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
443 %m The number of MIME parts in the article." |
17493 | 444 :type 'string |
445 :group 'gnus-article-various) | |
446 | |
447 (defcustom gnus-article-mode-hook nil | |
448 "*A hook for Gnus article mode." | |
449 :type 'hook | |
450 :group 'gnus-article-various) | |
451 | |
452 (defcustom gnus-article-menu-hook nil | |
453 "*Hook run after the creation of the article mode menu." | |
454 :type 'hook | |
455 :group 'gnus-article-various) | |
456 | |
457 (defcustom gnus-article-prepare-hook nil | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
458 "*A hook called after an article has been prepared in the article buffer." |
17493 | 459 :type 'hook |
460 :group 'gnus-article-various) | |
461 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
462 (defcustom gnus-article-hide-pgp-hook nil |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
463 "*A hook called after successfully hiding a PGP signature." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
464 :type 'hook |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
465 :group 'gnus-article-various) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
466 |
17493 | 467 (defcustom gnus-article-button-face 'bold |
468 "Face used for highlighting buttons in the article buffer. | |
469 | |
470 An article button is a piece of text that you can activate by pressing | |
471 `RET' or `mouse-2' above it." | |
472 :type 'face | |
473 :group 'gnus-article-buttons) | |
474 | |
475 (defcustom gnus-article-mouse-face 'highlight | |
476 "Face used for mouse highlighting in the article buffer. | |
477 | |
478 Article buttons will be displayed in this face when the cursor is | |
479 above them." | |
480 :type 'face | |
481 :group 'gnus-article-buttons) | |
482 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
483 (defcustom gnus-signature-face 'gnus-signature-face |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
484 "Face used for highlighting a signature in the article buffer. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
485 Obsolete; use the face `gnus-signature-face' for customizations instead." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
486 :type 'face |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
487 :group 'gnus-article-highlight |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
488 :group 'gnus-article-signature) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
489 |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
490 (defface gnus-signature-face |
32927
c0b62376988c
(gnus-signature-face): Use italics on all terminals that support it.
Jason Rumney <jasonr@gnu.org>
parents:
32210
diff
changeset
|
491 '((t |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
492 (:italic t))) |
17493 | 493 "Face used for highlighting a signature in the article buffer." |
494 :group 'gnus-article-highlight | |
495 :group 'gnus-article-signature) | |
496 | |
497 (defface gnus-header-from-face | |
498 '((((class color) | |
499 (background dark)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
500 (:foreground "spring green")) |
17493 | 501 (((class color) |
502 (background light)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
503 (:foreground "red3")) |
17493 | 504 (t |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
505 (:italic t))) |
17493 | 506 "Face used for displaying from headers." |
507 :group 'gnus-article-headers | |
508 :group 'gnus-article-highlight) | |
509 | |
510 (defface gnus-header-subject-face | |
511 '((((class color) | |
512 (background dark)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
513 (:foreground "SeaGreen3")) |
17493 | 514 (((class color) |
515 (background light)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
516 (:foreground "red4")) |
17493 | 517 (t |
518 (:bold t :italic t))) | |
519 "Face used for displaying subject headers." | |
520 :group 'gnus-article-headers | |
521 :group 'gnus-article-highlight) | |
522 | |
523 (defface gnus-header-newsgroups-face | |
524 '((((class color) | |
525 (background dark)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
526 (:foreground "yellow" :italic t)) |
17493 | 527 (((class color) |
528 (background light)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
529 (:foreground "MidnightBlue" :italic t)) |
17493 | 530 (t |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
531 (:italic t))) |
17493 | 532 "Face used for displaying newsgroups headers." |
533 :group 'gnus-article-headers | |
534 :group 'gnus-article-highlight) | |
535 | |
536 (defface gnus-header-name-face | |
537 '((((class color) | |
538 (background dark)) | |
539 (:foreground "SeaGreen")) | |
540 (((class color) | |
541 (background light)) | |
542 (:foreground "maroon")) | |
543 (t | |
544 (:bold t))) | |
545 "Face used for displaying header names." | |
546 :group 'gnus-article-headers | |
547 :group 'gnus-article-highlight) | |
548 | |
549 (defface gnus-header-content-face | |
550 '((((class color) | |
551 (background dark)) | |
552 (:foreground "forest green" :italic t)) | |
553 (((class color) | |
554 (background light)) | |
555 (:foreground "indianred4" :italic t)) | |
556 (t | |
557 (:italic t))) "Face used for displaying header content." | |
558 :group 'gnus-article-headers | |
559 :group 'gnus-article-highlight) | |
560 | |
561 (defcustom gnus-header-face-alist | |
562 '(("From" nil gnus-header-from-face) | |
563 ("Subject" nil gnus-header-subject-face) | |
564 ("Newsgroups:.*," nil gnus-header-newsgroups-face) | |
565 ("" gnus-header-name-face gnus-header-content-face)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
566 "*Controls highlighting of article header. |
17493 | 567 |
568 An alist of the form (HEADER NAME CONTENT). | |
569 | |
570 HEADER is a regular expression which should match the name of an | |
571 header header and NAME and CONTENT are either face names or nil. | |
572 | |
573 The name of each header field will be displayed using the face | |
574 specified by the first element in the list where HEADER match the | |
575 header name and NAME is non-nil. Similarly, the content will be | |
576 displayed by the first non-nil matching CONTENT face." | |
577 :group 'gnus-article-headers | |
578 :group 'gnus-article-highlight | |
579 :type '(repeat (list (regexp :tag "Header") | |
580 (choice :tag "Name" | |
581 (item :tag "skip" nil) | |
582 (face :value default)) | |
583 (choice :tag "Content" | |
584 (item :tag "skip" nil) | |
585 (face :value default))))) | |
586 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
587 (defcustom gnus-article-decode-hook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
588 '(article-decode-charset article-decode-encoded-words) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
589 "*Hook run to decode charsets in articles." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
590 :group 'gnus-article-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
591 :type 'hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
592 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
593 (defcustom gnus-display-mime-function 'gnus-display-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
594 "Function to display MIME articles." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
595 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
596 :type 'function) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
597 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
598 (defvar gnus-decode-header-function 'mail-decode-encoded-word-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
599 "Function used to decode headers.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
600 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
601 (defvar gnus-article-dumbquotes-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
602 '(("\202" ",") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
603 ("\203" "f") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
604 ("\204" ",,") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
605 ("\205" "...") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
606 ("\213" "<") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
607 ("\214" "OE") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
608 ("\221" "`") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
609 ("\222" "'") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
610 ("\223" "``") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
611 ("\224" "\"") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
612 ("\225" "*") |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
613 ("\226" "-") |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
614 ("\227" "--") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
615 ("\231" "(TM)") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
616 ("\233" ">") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
617 ("\234" "oe") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
618 ("\264" "'")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
619 "Table for MS-to-Latin1 translation.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
620 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
621 (defcustom gnus-ignored-mime-types nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
622 "List of MIME types that should be ignored by Gnus." |
33397 | 623 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
624 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
625 :type '(repeat regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
626 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
627 (defcustom gnus-unbuttonized-mime-types '(".*/.*") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
628 "List of MIME types that should not be given buttons when rendered inline." |
33397 | 629 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
630 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
631 :type '(repeat regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
632 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
633 (defcustom gnus-article-mime-part-function nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
634 "Function called with a MIME handle as the argument. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
635 This is meant for people who want to do something automatic based |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
636 on parts -- for instance, adding Vcard info to a database." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
637 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
638 :type 'function) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
639 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
640 (defcustom gnus-mime-multipart-functions nil |
33397 | 641 "An alist of MIME types to functions to display them." |
642 :version "21.1" | |
643 :group 'gnus-article-mime | |
644 :type 'alist) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
645 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
646 (defcustom gnus-article-date-lapsed-new-header nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
647 "Whether the X-Sent and Date headers can coexist. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
648 When using `gnus-treat-date-lapsed', the \"X-Sent:\" header will |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
649 either replace the old \"Date:\" header (if this variable is nil), or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
650 be added below it (otherwise)." |
33397 | 651 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
652 :group 'gnus-article-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
653 :type 'boolean) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
654 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
655 (defcustom gnus-article-mime-match-handle-function 'undisplayed-alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
656 "Function called with a MIME handle as the argument. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
657 This is meant for people who want to view first matched part. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
658 For `undisplayed-alternative' (default), the first undisplayed |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
659 part or alternative part is used. For `undisplayed', the first |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
660 undisplayed part is used. For a function, the first part which |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
661 the function return `t' is used. For `nil', the first part is |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
662 used." |
33397 | 663 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
664 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
665 :type '(choice |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
666 (item :tag "first" :value nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
667 (item :tag "undisplayed" :value undisplayed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
668 (item :tag "undisplayed or alternative" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
669 :value undisplayed-alternative) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
670 (function))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
671 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
672 (defcustom gnus-mime-action-alist |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
673 '(("save to file" . gnus-mime-save-part) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
674 ("display as text" . gnus-mime-inline-part) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
675 ("view the part" . gnus-mime-view-part) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
676 ("pipe to command" . gnus-mime-pipe-part) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
677 ("toggle display" . gnus-article-press-button) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
678 ("view as type" . gnus-mime-view-part-as-type) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
679 ("internalize type" . gnus-mime-internalize-part) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
680 ("externalize type" . gnus-mime-externalize-part)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
681 "An alist of actions that run on the MIME attachment." |
33397 | 682 :version "21.1" |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
683 :group 'gnus-article-mime |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
684 :type '(repeat (cons (string :tag "name") |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
685 (function)))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
686 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
687 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
688 ;;; The treatment variables |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
689 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
690 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
691 (defvar gnus-part-display-hook nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
692 "Hook called on parts that are to receive treatment.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
693 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
694 (defvar gnus-article-treat-custom |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
695 '(choice (const :tag "Off" nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
696 (const :tag "On" t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
697 (const :tag "Header" head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
698 (const :tag "Last" last) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
699 (integer :tag "Less") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
700 (repeat :tag "Groups" regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
701 (sexp :tag "Predicate"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
702 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
703 (defvar gnus-article-treat-head-custom |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
704 '(choice (const :tag "Off" nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
705 (const :tag "Header" head))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
706 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
707 (defvar gnus-article-treat-types '("text/plain") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
708 "Parts to treat.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
709 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
710 (defvar gnus-inhibit-treatment nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
711 "Whether to inhibit treatment.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
712 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
713 (defcustom gnus-treat-highlight-signature '(or last (typep "text/x-vcard")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
714 "Highlight the signature. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
715 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
716 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
717 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
718 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
719 (put 'gnus-treat-highlight-signature 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
720 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
721 (defcustom gnus-treat-buttonize 100000 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
722 "Add buttons. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
723 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
724 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
725 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
726 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
727 (put 'gnus-treat-buttonize 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
728 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
729 (defcustom gnus-treat-buttonize-head 'head |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
730 "Add buttons to the head. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
731 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
732 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
733 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
734 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
735 (put 'gnus-treat-buttonize-head 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
736 |
34818
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
737 (defcustom gnus-treat-emphasize |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
738 (and (or window-system |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
739 (featurep 'xemacs) |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
740 (>= (string-to-number emacs-version) 21)) |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
741 50000) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
742 "Emphasize text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
743 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
744 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
745 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
746 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
747 (put 'gnus-treat-emphasize 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
748 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
749 (defcustom gnus-treat-strip-cr nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
750 "Remove carriage returns. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
751 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
752 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
753 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
754 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
755 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
756 (defcustom gnus-treat-hide-headers 'head |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
757 "Hide headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
758 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
759 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
760 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
761 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
762 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
763 (defcustom gnus-treat-hide-boring-headers nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
764 "Hide boring headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
765 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
766 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
767 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
768 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
769 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
770 (defcustom gnus-treat-hide-signature nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
771 "Hide the signature. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
772 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
773 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
774 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
775 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
776 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
777 (defcustom gnus-treat-fill-article nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
778 "Fill the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
779 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
780 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
781 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
782 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
783 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
784 (defcustom gnus-treat-hide-citation nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
785 "Hide cited text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
786 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
787 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
788 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
789 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
790 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
791 (defcustom gnus-treat-hide-citation-maybe nil |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
792 "Hide cited text. |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
793 Valid values are nil, t, `head', `last', an integer or a predicate. |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
794 See the manual for details." |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
795 :group 'gnus-article-treat |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
796 :type gnus-article-treat-custom) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
797 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
798 (defcustom gnus-treat-strip-list-identifiers 'head |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
799 "Strip list identifiers from `gnus-list-identifiers`. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
800 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
801 See the manual for details." |
33397 | 802 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
803 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
804 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
805 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
806 (defcustom gnus-treat-strip-pgp t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
807 "Strip PGP signatures. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
808 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
809 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
810 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
811 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
812 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
813 (defcustom gnus-treat-strip-pem nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
814 "Strip PEM signatures. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
815 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
816 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
817 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
818 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
819 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
820 (defcustom gnus-treat-strip-banner t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
821 "Strip banners from articles. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
822 The banner to be stripped is specified in the `banner' group parameter. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
823 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
824 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
825 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
826 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
827 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
828 (defcustom gnus-treat-highlight-headers 'head |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
829 "Highlight the headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
830 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
831 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
832 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
833 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
834 (put 'gnus-treat-highlight-headers 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
835 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
836 (defcustom gnus-treat-highlight-citation t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
837 "Highlight cited text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
838 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
839 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
840 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
841 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
842 (put 'gnus-treat-highlight-citation 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
843 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
844 (defcustom gnus-treat-date-ut nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
845 "Display the Date in UT (GMT). |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
846 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
847 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
848 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
849 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
850 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
851 (defcustom gnus-treat-date-local nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
852 "Display the Date in the local timezone. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
853 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
854 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
855 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
856 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
857 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
858 (defcustom gnus-treat-date-lapsed nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
859 "Display the Date header in a way that says how much time has elapsed. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
860 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
861 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
862 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
863 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
864 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
865 (defcustom gnus-treat-date-original nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
866 "Display the date in the original timezone. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
867 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
868 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
869 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
870 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
871 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
872 (defcustom gnus-treat-date-iso8601 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
873 "Display the date in the ISO8601 format. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
874 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
875 See the manual for details." |
33397 | 876 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
877 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
878 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
879 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
880 (defcustom gnus-treat-date-user-defined nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
881 "Display the date in a user-defined format. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
882 The format is defined by the `gnus-article-time-format' variable. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
883 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
884 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
885 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
886 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
887 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
888 (defcustom gnus-treat-strip-headers-in-body t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
889 "Strip the X-No-Archive header line from the beginning of the body. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
890 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
891 See the manual for details." |
33397 | 892 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
893 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
894 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
895 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
896 (defcustom gnus-treat-strip-trailing-blank-lines nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
897 "Strip trailing blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
898 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
899 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
900 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
901 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
902 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
903 (defcustom gnus-treat-strip-leading-blank-lines nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
904 "Strip leading blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
905 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
906 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
907 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
908 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
909 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
910 (defcustom gnus-treat-strip-multiple-blank-lines nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
911 "Strip multiple blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
912 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
913 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
914 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
915 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
916 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
917 (defcustom gnus-treat-overstrike t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
918 "Treat overstrike highlighting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
919 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
920 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
921 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
922 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
923 (put 'gnus-treat-overstrike 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
924 |
31785 | 925 (defcustom gnus-treat-display-xface |
926 (and (or (and (fboundp 'image-type-available-p) | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
927 (image-type-available-p 'xbm) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
928 (string-match "^0x" (shell-command-to-string "uncompface"))) |
32939
c8119677d63e
Use (featurep 'xemacs) instead of the `gnus-xemacs' variable, as the
Miles Bader <miles@gnu.org>
parents:
32927
diff
changeset
|
929 (and (featurep 'xemacs) (featurep 'xface))) |
31785 | 930 'head) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
931 "Display X-Face headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
932 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
933 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
934 :group 'gnus-article-treat |
35759 | 935 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
936 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
937 (put 'gnus-treat-display-xface 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
938 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
939 (defcustom gnus-treat-display-smileys |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
940 (if (or (and (featurep 'xemacs) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
941 (featurep 'xpm)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
942 (and (fboundp 'image-type-available-p) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
943 (image-type-available-p 'pbm))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
944 t nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
945 "Display smileys. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
946 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
947 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
948 :group 'gnus-article-treat |
35759 | 949 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
950 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
951 (put 'gnus-treat-display-smileys 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
952 |
32939
c8119677d63e
Use (featurep 'xemacs) instead of the `gnus-xemacs' variable, as the
Miles Bader <miles@gnu.org>
parents:
32927
diff
changeset
|
953 (defcustom gnus-treat-display-picons (if (featurep 'xemacs) 'head nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
954 "Display picons. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
955 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
956 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
957 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
958 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
959 (put 'gnus-treat-display-picons 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
960 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
961 (defcustom gnus-treat-capitalize-sentences nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
962 "Capitalize sentence-starting words. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
963 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
964 See the manual for details." |
33397 | 965 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
966 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
967 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
968 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
969 (defcustom gnus-treat-fill-long-lines nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
970 "Fill long lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
971 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
972 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
973 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
974 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
975 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
976 (defcustom gnus-treat-play-sounds nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
977 "Play sounds. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
978 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
979 See the manual for details." |
33397 | 980 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
981 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
982 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
983 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
984 (defcustom gnus-treat-translate nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
985 "Translate articles from one language to another. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
986 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
987 See the manual for details." |
33397 | 988 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
989 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
990 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
991 |
17493 | 992 ;;; Internal variables |
993 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
994 (defvar article-goto-body-goes-to-point-min-p nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
995 (defvar gnus-article-wash-types nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
996 (defvar gnus-article-emphasis-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
997 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
998 (defvar gnus-article-mime-handle-alist-1 nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
999 (defvar gnus-treatment-function-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1000 '((gnus-treat-strip-banner gnus-article-strip-banner) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1001 (gnus-treat-strip-headers-in-body gnus-article-strip-headers-in-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1002 (gnus-treat-highlight-signature gnus-article-highlight-signature) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1003 (gnus-treat-buttonize gnus-article-add-buttons) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1004 (gnus-treat-fill-article gnus-article-fill-cited-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1005 (gnus-treat-fill-long-lines gnus-article-fill-long-lines) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1006 (gnus-treat-strip-cr gnus-article-remove-cr) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1007 (gnus-treat-emphasize gnus-article-emphasize) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1008 (gnus-treat-display-xface gnus-article-display-x-face) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1009 (gnus-treat-hide-headers gnus-article-maybe-hide-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1010 (gnus-treat-hide-boring-headers gnus-article-hide-boring-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1011 (gnus-treat-hide-signature gnus-article-hide-signature) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1012 (gnus-treat-hide-citation gnus-article-hide-citation) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1013 (gnus-treat-hide-citation-maybe gnus-article-hide-citation-maybe) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1014 (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1015 (gnus-treat-strip-pgp gnus-article-hide-pgp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1016 (gnus-treat-strip-pem gnus-article-hide-pem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1017 (gnus-treat-highlight-headers gnus-article-highlight-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1018 (gnus-treat-highlight-citation gnus-article-highlight-citation) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1019 (gnus-treat-highlight-signature gnus-article-highlight-signature) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1020 (gnus-treat-date-ut gnus-article-date-ut) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1021 (gnus-treat-date-local gnus-article-date-local) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1022 (gnus-treat-date-lapsed gnus-article-date-lapsed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1023 (gnus-treat-date-original gnus-article-date-original) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1024 (gnus-treat-date-user-defined gnus-article-date-user) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1025 (gnus-treat-date-iso8601 gnus-article-date-iso8601) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1026 (gnus-treat-strip-trailing-blank-lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1027 gnus-article-remove-trailing-blank-lines) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1028 (gnus-treat-strip-leading-blank-lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1029 gnus-article-strip-leading-blank-lines) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1030 (gnus-treat-strip-multiple-blank-lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1031 gnus-article-strip-multiple-blank-lines) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1032 (gnus-treat-overstrike gnus-article-treat-overstrike) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1033 (gnus-treat-buttonize-head gnus-article-add-buttons-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1034 (gnus-treat-display-smileys gnus-smiley-display) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1035 (gnus-treat-capitalize-sentences gnus-article-capitalize-sentences) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1036 (gnus-treat-display-picons gnus-article-display-picons) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1037 (gnus-treat-play-sounds gnus-earcon-display))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1038 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1039 (defvar gnus-article-mime-handle-alist nil) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1040 (defvar article-lapsed-timer nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1041 (defvar gnus-article-current-summary nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1042 |
17493 | 1043 (defvar gnus-article-mode-syntax-table |
1044 (let ((table (copy-syntax-table text-mode-syntax-table))) | |
1045 (modify-syntax-entry ?- "w" table) | |
1046 (modify-syntax-entry ?> ")" table) | |
1047 (modify-syntax-entry ?< "(" table) | |
1048 table) | |
1049 "Syntax table used in article mode buffers. | |
1050 Initialized from `text-mode-syntax-table.") | |
1051 | |
1052 (defvar gnus-save-article-buffer nil) | |
1053 | |
1054 (defvar gnus-article-mode-line-format-alist | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1055 (nconc '((?w (gnus-article-wash-status) ?s) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1056 (?m (gnus-article-mime-part-status) ?s)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1057 gnus-summary-mode-line-format-alist)) |
17493 | 1058 |
1059 (defvar gnus-number-of-articles-to-be-saved nil) | |
1060 | |
1061 (defvar gnus-inhibit-hiding nil) | |
1062 | |
1063 (defsubst gnus-article-hide-text (b e props) | |
1064 "Set text PROPS on the B to E region, extending `intangible' 1 past B." | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
1065 (gnus-add-text-properties-when 'article-type nil b e props) |
17493 | 1066 (when (memq 'intangible props) |
1067 (put-text-property | |
1068 (max (1- b) (point-min)) | |
1069 b 'intangible (cddr (memq 'intangible props))))) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
1070 |
17493 | 1071 (defsubst gnus-article-unhide-text (b e) |
1072 "Remove hidden text properties from region between B and E." | |
1073 (remove-text-properties b e gnus-hidden-properties) | |
1074 (when (memq 'intangible gnus-hidden-properties) | |
1075 (put-text-property (max (1- b) (point-min)) | |
1076 b 'intangible nil))) | |
1077 | |
1078 (defun gnus-article-hide-text-type (b e type) | |
1079 "Hide text of TYPE between B and E." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1080 (push type gnus-article-wash-types) |
17493 | 1081 (gnus-article-hide-text |
1082 b e (cons 'article-type (cons type gnus-hidden-properties)))) | |
1083 | |
1084 (defun gnus-article-unhide-text-type (b e type) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1085 "Unhide text of TYPE between B and E." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1086 (setq gnus-article-wash-types |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1087 (delq type gnus-article-wash-types)) |
17493 | 1088 (remove-text-properties |
1089 b e (cons 'article-type (cons type gnus-hidden-properties))) | |
1090 (when (memq 'intangible gnus-hidden-properties) | |
1091 (put-text-property (max (1- b) (point-min)) | |
1092 b 'intangible nil))) | |
1093 | |
1094 (defun gnus-article-hide-text-of-type (type) | |
1095 "Hide text of TYPE in the current buffer." | |
1096 (save-excursion | |
1097 (let ((b (point-min)) | |
1098 (e (point-max))) | |
1099 (while (setq b (text-property-any b e 'article-type type)) | |
1100 (add-text-properties b (incf b) gnus-hidden-properties))))) | |
1101 | |
1102 (defun gnus-article-delete-text-of-type (type) | |
1103 "Delete text of TYPE in the current buffer." | |
1104 (save-excursion | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1105 (let ((b (point-min))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1106 (while (setq b (text-property-any b (point-max) 'article-type type)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1107 (delete-region |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1108 b (or (text-property-not-all b (point-max) 'article-type type) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1109 (point-max))))))) |
17493 | 1110 |
1111 (defun gnus-article-delete-invisible-text () | |
1112 "Delete all invisible text in the current buffer." | |
1113 (save-excursion | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1114 (let ((b (point-min))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1115 (while (setq b (text-property-any b (point-max) 'invisible t)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1116 (delete-region |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1117 b (or (text-property-not-all b (point-max) 'invisible t) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1118 (point-max))))))) |
17493 | 1119 |
1120 (defun gnus-article-text-type-exists-p (type) | |
1121 "Say whether any text of type TYPE exists in the buffer." | |
1122 (text-property-any (point-min) (point-max) 'article-type type)) | |
1123 | |
1124 (defsubst gnus-article-header-rank () | |
1125 "Give the rank of the string HEADER as given by `gnus-sorted-header-list'." | |
1126 (let ((list gnus-sorted-header-list) | |
1127 (i 0)) | |
1128 (while list | |
1129 (when (looking-at (car list)) | |
1130 (setq list nil)) | |
1131 (setq list (cdr list)) | |
1132 (incf i)) | |
1133 i)) | |
1134 | |
1135 (defun article-hide-headers (&optional arg delete) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1136 "Hide unwanted headers and possibly sort them as well." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1137 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1138 ;; This function might be inhibited. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1139 (unless gnus-inhibit-hiding |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1140 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1141 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1142 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1143 (case-fold-search t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1144 (max (1+ (length gnus-sorted-header-list))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1145 (ignored (when (not gnus-visible-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1146 (cond ((stringp gnus-ignored-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1147 gnus-ignored-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1148 ((listp gnus-ignored-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1149 (mapconcat 'identity gnus-ignored-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1150 "\\|"))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1151 (visible |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1152 (cond ((stringp gnus-visible-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1153 gnus-visible-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1154 ((and gnus-visible-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1155 (listp gnus-visible-headers)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1156 (mapconcat 'identity gnus-visible-headers "\\|")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1157 (inhibit-point-motion-hooks t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1158 beg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1159 ;; First we narrow to just the headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1160 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1161 ;; Hide any "From " lines at the beginning of (mail) articles. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1162 (while (looking-at "From ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1163 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1164 (unless (bobp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1165 (delete-region (point-min) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1166 ;; Then treat the rest of the header lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1167 ;; Then we use the two regular expressions |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1168 ;; `gnus-ignored-headers' and `gnus-visible-headers' to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1169 ;; select which header lines is to remain visible in the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1170 ;; article buffer. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1171 (while (re-search-forward "^[^ \t]*:" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1172 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1173 ;; Mark the rank of the header. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1174 (put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1175 (point) (1+ (point)) 'message-rank |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1176 (if (or (and visible (looking-at visible)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1177 (and ignored |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1178 (not (looking-at ignored)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1179 (gnus-article-header-rank) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1180 (+ 2 max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1181 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1182 (message-sort-headers-1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1183 (when (setq beg (text-property-any |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1184 (point-min) (point-max) 'message-rank (+ 2 max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1185 ;; We delete the unwanted headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1186 (push 'headers gnus-article-wash-types) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1187 (add-text-properties (point-min) (+ 5 (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1188 '(article-type headers dummy-invisible t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1189 (delete-region beg (point-max)))))))) |
17493 | 1190 |
1191 (defun article-hide-boring-headers (&optional arg) | |
1192 "Toggle hiding of headers that aren't very interesting. | |
1193 If given a negative prefix, always show; if given a positive prefix, | |
1194 always hide." | |
1195 (interactive (gnus-article-hidden-arg)) | |
1196 (when (and (not (gnus-article-check-hidden-text 'boring-headers arg)) | |
1197 (not gnus-show-all-headers)) | |
1198 (save-excursion | |
1199 (save-restriction | |
1200 (let ((buffer-read-only nil) | |
1201 (list gnus-boring-article-headers) | |
1202 (inhibit-point-motion-hooks t) | |
1203 elem) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1204 (article-narrow-to-head) |
17493 | 1205 (while list |
1206 (setq elem (pop list)) | |
1207 (goto-char (point-min)) | |
1208 (cond | |
1209 ;; Hide empty headers. | |
1210 ((eq elem 'empty) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1211 (while (re-search-forward "^[^: \t]+:[ \t]*\n[^ \t]" nil t) |
17493 | 1212 (forward-line -1) |
1213 (gnus-article-hide-text-type | |
1214 (progn (beginning-of-line) (point)) | |
1215 (progn | |
1216 (end-of-line) | |
1217 (if (re-search-forward "^[^ \t]" nil t) | |
1218 (match-beginning 0) | |
1219 (point-max))) | |
1220 'boring-headers))) | |
1221 ;; Hide boring Newsgroups header. | |
1222 ((eq elem 'newsgroups) | |
1223 (when (equal (gnus-fetch-field "newsgroups") | |
1224 (gnus-group-real-name | |
1225 (if (boundp 'gnus-newsgroup-name) | |
1226 gnus-newsgroup-name | |
1227 ""))) | |
1228 (gnus-article-hide-header "newsgroups"))) | |
1229 ((eq elem 'followup-to) | |
1230 (when (equal (message-fetch-field "followup-to") | |
1231 (message-fetch-field "newsgroups")) | |
1232 (gnus-article-hide-header "followup-to"))) | |
1233 ((eq elem 'reply-to) | |
1234 (let ((from (message-fetch-field "from")) | |
1235 (reply-to (message-fetch-field "reply-to"))) | |
1236 (when (and | |
1237 from reply-to | |
1238 (ignore-errors | |
1239 (equal | |
1240 (nth 1 (mail-extract-address-components from)) | |
1241 (nth 1 (mail-extract-address-components reply-to))))) | |
1242 (gnus-article-hide-header "reply-to")))) | |
1243 ((eq elem 'date) | |
1244 (let ((date (message-fetch-field "date"))) | |
1245 (when (and date | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1246 (< (days-between (current-time-string) date) |
17493 | 1247 4)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1248 (gnus-article-hide-header "date")))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1249 ((eq elem 'long-to) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1250 (let ((to (message-fetch-field "to")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1251 (cc (message-fetch-field "cc"))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1252 (when (> (length to) 1024) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1253 (gnus-article-hide-header "to")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1254 (when (> (length cc) 1024) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1255 (gnus-article-hide-header "cc")))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1256 ((eq elem 'many-to) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1257 (let ((to-count 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1258 (cc-count 0)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1259 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1260 (while (re-search-forward "^to:" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1261 (setq to-count (1+ to-count))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1262 (when (> to-count 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1263 (while (> to-count 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1264 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1265 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1266 (re-search-forward "^to:" nil nil to-count) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1267 (forward-line -1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1268 (narrow-to-region (point) (point-max)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1269 (gnus-article-hide-header "to")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1270 (setq to-count (1- to-count)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1271 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1272 (while (re-search-forward "^cc:" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1273 (setq cc-count (1+ cc-count))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1274 (when (> cc-count 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1275 (while (> cc-count 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1276 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1277 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1278 (re-search-forward "^cc:" nil nil cc-count) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1279 (forward-line -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1280 (narrow-to-region (point) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1281 (gnus-article-hide-header "cc")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1282 (setq cc-count (1- cc-count))))))))))))) |
17493 | 1283 |
1284 (defun gnus-article-hide-header (header) | |
1285 (save-excursion | |
1286 (goto-char (point-min)) | |
1287 (when (re-search-forward (concat "^" header ":") nil t) | |
1288 (gnus-article-hide-text-type | |
1289 (progn (beginning-of-line) (point)) | |
1290 (progn | |
1291 (end-of-line) | |
1292 (if (re-search-forward "^[^ \t]" nil t) | |
1293 (match-beginning 0) | |
1294 (point-max))) | |
1295 'boring-headers)))) | |
1296 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1297 (defvar gnus-article-normalized-header-length 40 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1298 "Length of normalized headers.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1299 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1300 (defun article-normalize-headers () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1301 "Make all header lines 40 characters long." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1302 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1303 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1304 column) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1305 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1306 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1307 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1308 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1309 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1310 ((< (setq column (- (gnus-point-at-eol) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1311 gnus-article-normalized-header-length) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1312 (end-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1313 (insert (make-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1314 (- gnus-article-normalized-header-length column) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1315 ? ))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1316 ((> column gnus-article-normalized-header-length) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1317 (gnus-put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1318 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1319 (forward-char gnus-article-normalized-header-length) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1320 (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1321 (gnus-point-at-eol) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1322 'invisible t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1323 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1324 ;; Do nothing. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1325 )) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1326 (forward-line 1)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1327 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1328 (defun article-treat-dumbquotes () |
34818
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
1329 "Translate M****s*** sm*rtq**t*s into proper text. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1330 Note that this function guesses whether a character is a sm*rtq**t* or |
34818
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
1331 not, so it should only be used interactively. |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
1332 |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
1333 Sm*rtq**t*s are M****s***'s unilateral extension to the character map |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
1334 in an attempt to provide more quoting characters. If you see |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
1335 something like \\222 or \\264 where you're expecting some kind of |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
1336 apostrophe or quotation mark, then try this wash." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1337 (interactive) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1338 (article-translate-strings gnus-article-dumbquotes-map)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1339 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1340 (defun article-translate-characters (from to) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1341 "Translate all characters in the body of the article according to FROM and TO. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1342 FROM is a string of characters to translate from; to is a string of |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1343 characters to translate to." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1344 (save-excursion |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1345 (when (article-goto-body) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1346 (let ((buffer-read-only nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1347 (x (make-string 225 ?x)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1348 (i -1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1349 (while (< (incf i) (length x)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1350 (aset x i i)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1351 (setq i 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1352 (while (< i (length from)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1353 (aset x (aref from i) (aref to i)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1354 (incf i)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1355 (translate-region (point) (point-max) x))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1356 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1357 (defun article-translate-strings (map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1358 "Translate all string in the body of the article according to MAP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1359 MAP is an alist where the elements are on the form (\"from\" \"to\")." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1360 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1361 (when (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1362 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1363 elem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1364 (while (setq elem (pop map)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1365 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1366 (while (search-forward (car elem) nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1367 (replace-match (cadr elem))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1368 |
17493 | 1369 (defun article-treat-overstrike () |
1370 "Translate overstrikes into bold text." | |
1371 (interactive) | |
1372 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1373 (when (article-goto-body) |
17493 | 1374 (let ((buffer-read-only nil)) |
1375 (while (search-forward "\b" nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1376 (let ((next (char-after)) |
17493 | 1377 (previous (char-after (- (point) 2)))) |
1378 ;; We do the boldification/underlining by hiding the | |
1379 ;; overstrikes and putting the proper text property | |
1380 ;; on the letters. | |
1381 (cond | |
1382 ((eq next previous) | |
1383 (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike) | |
1384 (put-text-property (point) (1+ (point)) 'face 'bold)) | |
1385 ((eq next ?_) | |
1386 (gnus-article-hide-text-type | |
1387 (1- (point)) (1+ (point)) 'overstrike) | |
1388 (put-text-property | |
1389 (- (point) 2) (1- (point)) 'face 'underline)) | |
1390 ((eq previous ?_) | |
1391 (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike) | |
1392 (put-text-property | |
1393 (point) (1+ (point)) 'face 'underline))))))))) | |
1394 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1395 (defun article-fill-long-lines () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1396 "Fill lines that are wider than the window width." |
17493 | 1397 (interactive) |
1398 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1399 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1400 (width (window-width (get-buffer-window (current-buffer))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1401 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1402 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1403 (let ((adaptive-fill-mode nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1404 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1405 (end-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1406 (when (>= (current-column) (min fill-column width)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1407 (narrow-to-region (point) (gnus-point-at-bol)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1408 (fill-paragraph nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1409 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1410 (widen)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1411 (forward-line 1))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1412 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1413 (defun article-capitalize-sentences () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1414 "Capitalize the first word in each sentence." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1415 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1416 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1417 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1418 (paragraph-start "^[\n\^L]")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1419 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1420 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1421 (capitalize-word 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1422 (forward-sentence))))) |
17493 | 1423 |
1424 (defun article-remove-cr () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1425 "Remove trailing CRs and then translate remaining CRs into LFs." |
17493 | 1426 (interactive) |
1427 (save-excursion | |
1428 (let ((buffer-read-only nil)) | |
1429 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1430 (while (re-search-forward "\r+$" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1431 (replace-match "" t t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1432 (goto-char (point-min)) |
17493 | 1433 (while (search-forward "\r" nil t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1434 (replace-match "\n" t t))))) |
17493 | 1435 |
1436 (defun article-remove-trailing-blank-lines () | |
1437 "Remove all trailing blank lines from the article." | |
1438 (interactive) | |
1439 (save-excursion | |
1440 (let ((buffer-read-only nil)) | |
1441 (goto-char (point-max)) | |
1442 (delete-region | |
1443 (point) | |
1444 (progn | |
1445 (while (and (not (bobp)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1446 (looking-at "^[ \t]*$") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1447 (not (gnus-annotation-in-region-p |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1448 (point) (gnus-point-at-eol)))) |
17493 | 1449 (forward-line -1)) |
1450 (forward-line 1) | |
1451 (point)))))) | |
1452 | |
1453 (defun article-display-x-face (&optional force) | |
1454 "Look for an X-Face header and display it if present." | |
1455 (interactive (list 'force)) | |
1456 (save-excursion | |
1457 ;; Delete the old process, if any. | |
1458 (when (process-status "article-x-face") | |
1459 (delete-process "article-x-face")) | |
1460 (let ((inhibit-point-motion-hooks t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1461 (case-fold-search t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1462 from last) |
17493 | 1463 (save-restriction |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1464 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1465 (goto-char (point-min)) |
17493 | 1466 (setq from (message-fetch-field "from")) |
1467 (goto-char (point-min)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1468 (while (and gnus-article-x-face-command |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1469 (not last) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1470 (or force |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1471 ;; Check whether this face is censored. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1472 (not gnus-article-x-face-too-ugly) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1473 (and gnus-article-x-face-too-ugly from |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1474 (not (string-match gnus-article-x-face-too-ugly |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1475 from)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1476 ;; Has to be present. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1477 (re-search-forward "^X-Face: " nil t)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1478 ;; This used to try to do multiple faces (`while' instead of |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1479 ;; `when' above), but (a) sending multiple EOFs to xv doesn't |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1480 ;; work (b) it can crash some versions of Emacs (c) are |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1481 ;; multiple faces really something to encourage? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1482 (when (stringp gnus-article-x-face-command) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1483 (setq last t)) |
17493 | 1484 ;; We now have the area of the buffer where the X-Face is stored. |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1485 (save-excursion |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1486 (let ((beg (point)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1487 (end (1- (re-search-forward "^\\($\\|[^ \t]\\)" nil t)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1488 ;; We display the face. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1489 (if (symbolp gnus-article-x-face-command) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1490 ;; The command is a lisp function, so we call it. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1491 (if (gnus-functionp gnus-article-x-face-command) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1492 (funcall gnus-article-x-face-command beg end) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1493 (error "%s is not a function" gnus-article-x-face-command)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1494 ;; The command is a string, so we interpret the command |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1495 ;; as a, well, command, and fork it off. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1496 (let ((process-connection-type nil)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1497 (process-kill-without-query |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1498 (start-process |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1499 "article-x-face" nil shell-file-name shell-command-switch |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1500 gnus-article-x-face-command)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1501 (process-send-region "article-x-face" beg end) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1502 (process-send-eof "article-x-face")))))))))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1503 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1504 (defun article-decode-mime-words () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1505 "Decode all MIME-encoded words in the article." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1506 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1507 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1508 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1509 (let ((inhibit-point-motion-hooks t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1510 buffer-read-only |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1511 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1512 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1513 (save-excursion (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1514 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1515 (mail-decode-encoded-word-region (point-min) (point-max))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1516 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1517 (defun article-decode-charset (&optional prompt) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1518 "Decode charset-encoded text in the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1519 If PROMPT (the prefix), prompt for a coding system to use." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1520 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1521 (let ((inhibit-point-motion-hooks t) (case-fold-search t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1522 buffer-read-only |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1523 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1524 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1525 (save-excursion (condition-case nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1526 (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1527 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1528 gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1529 ct cte ctl charset format) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1530 (save-excursion |
17493 | 1531 (save-restriction |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1532 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1533 (setq ct (message-fetch-field "Content-Type" t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1534 cte (message-fetch-field "Content-Transfer-Encoding" t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1535 ctl (and ct (ignore-errors |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1536 (mail-header-parse-content-type ct))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1537 charset (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1538 (prompt |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1539 (mm-read-coding-system "Charset to decode: ")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1540 (ctl |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1541 (mail-content-type-get ctl 'charset))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1542 format (and ctl (mail-content-type-get ctl 'format))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1543 (when cte |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1544 (setq cte (mail-header-strip cte))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1545 (if (and ctl (not (string-match "/" (car ctl)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1546 (setq ctl nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1547 (goto-char (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1548 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1549 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1550 (narrow-to-region (point) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1551 (when (and (eq mail-parse-charset 'gnus-decoded) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1552 (eq (mm-body-7-or-8) '8bit)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1553 ;; The text code could have been decoded. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1554 (setq charset mail-parse-charset)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1555 (when (and (or (not ctl) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1556 (equal (car ctl) "text/plain")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1557 (not format)) ;; article with format will decode later. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1558 (mm-decode-body |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1559 charset (and cte (intern (downcase |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1560 (gnus-strip-whitespace cte)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1561 (car ctl))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1562 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1563 (defun article-decode-encoded-words () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1564 "Remove encoded-word encoding from headers." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1565 (let ((inhibit-point-motion-hooks t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1566 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1567 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1568 (save-excursion (condition-case nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1569 (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1570 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1571 gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1572 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1573 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1574 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1575 (funcall gnus-decode-header-function (point-min) (point-max))))) |
17493 | 1576 |
1577 (defun article-de-quoted-unreadable (&optional force) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1578 "Translate a quoted-printable-encoded article. |
17493 | 1579 If FORCE, decode the article whether it is marked as quoted-printable |
1580 or not." | |
1581 (interactive (list 'force)) | |
1582 (save-excursion | |
31785 | 1583 (let ((buffer-read-only nil) type charset) |
1584 (if (gnus-buffer-live-p gnus-original-article-buffer) | |
1585 (with-current-buffer gnus-original-article-buffer | |
1586 (setq type | |
1587 (gnus-fetch-field "content-transfer-encoding")) | |
1588 (let* ((ct (gnus-fetch-field "content-type")) | |
1589 (ctl (and ct | |
1590 (ignore-errors | |
1591 (mail-header-parse-content-type ct))))) | |
1592 (setq charset (and ctl | |
1593 (mail-content-type-get ctl 'charset))) | |
1594 (if (stringp charset) | |
1595 (setq charset (intern (downcase charset))))))) | |
1596 (unless charset | |
1597 (setq charset gnus-newsgroup-charset)) | |
17493 | 1598 (when (or force |
32210 | 1599 (and type (let ((case-fold-search t)) |
1600 (string-match "quoted-printable" type)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1601 (article-goto-body) |
32210 | 1602 (quoted-printable-decode-region |
1603 (point) (point-max) (mm-charset-to-coding-system charset)))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1604 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1605 (defun article-de-base64-unreadable (&optional force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1606 "Translate a base64 article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1607 If FORCE, decode the article whether it is marked as base64 not." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1608 (interactive (list 'force)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1609 (save-excursion |
31785 | 1610 (let ((buffer-read-only nil) type charset) |
1611 (if (gnus-buffer-live-p gnus-original-article-buffer) | |
1612 (with-current-buffer gnus-original-article-buffer | |
1613 (setq type | |
1614 (gnus-fetch-field "content-transfer-encoding")) | |
1615 (let* ((ct (gnus-fetch-field "content-type")) | |
1616 (ctl (and ct | |
1617 (ignore-errors | |
1618 (mail-header-parse-content-type ct))))) | |
1619 (setq charset (and ctl | |
1620 (mail-content-type-get ctl 'charset))) | |
1621 (if (stringp charset) | |
1622 (setq charset (intern (downcase charset))))))) | |
1623 (unless charset | |
1624 (setq charset gnus-newsgroup-charset)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1625 (when (or force |
32210 | 1626 (and type (let ((case-fold-search t)) |
1627 (string-match "base64" type)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1628 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1629 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1630 (narrow-to-region (point) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1631 (base64-decode-region (point-min) (point-max)) |
32210 | 1632 (mm-decode-coding-region |
1633 (point-min) (point-max) (mm-charset-to-coding-system charset))))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1634 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1635 (eval-when-compile |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1636 (require 'rfc1843)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1637 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1638 (defun article-decode-HZ () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1639 "Translate a HZ-encoded article." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1640 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1641 (require 'rfc1843) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1642 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1643 (let ((buffer-read-only nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1644 (rfc1843-decode-region (point-min) (point-max))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1645 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1646 (defun article-wash-html () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1647 "Format an html article." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1648 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1649 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1650 (let ((buffer-read-only nil) |
31785 | 1651 charset) |
1652 (if (gnus-buffer-live-p gnus-original-article-buffer) | |
1653 (with-current-buffer gnus-original-article-buffer | |
1654 (let* ((ct (gnus-fetch-field "content-type")) | |
1655 (ctl (and ct | |
1656 (ignore-errors | |
1657 (mail-header-parse-content-type ct))))) | |
1658 (setq charset (and ctl | |
1659 (mail-content-type-get ctl 'charset))) | |
1660 (if (stringp charset) | |
1661 (setq charset (intern (downcase charset))))))) | |
1662 (unless charset | |
1663 (setq charset gnus-newsgroup-charset)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1664 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1665 (save-window-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1666 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1667 (narrow-to-region (point) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1668 (mm-setup-w3) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1669 (let ((w3-strict-width (window-width)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1670 (url-standalone-mode t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1671 (condition-case var |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1672 (w3-region (point-min) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1673 (error)))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1674 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1675 (defun article-hide-list-identifiers () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1676 "Remove list identifies from the Subject header. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1677 The `gnus-list-identifiers' variable specifies what to do." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1678 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1679 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1680 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1681 (let ((inhibit-point-motion-hooks t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1682 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1683 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1684 (let ((regexp (if (stringp gnus-list-identifiers) gnus-list-identifiers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1685 (mapconcat 'identity gnus-list-identifiers " *\\|")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1686 (when regexp |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1687 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1688 (when (re-search-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1689 (concat "^Subject: +\\(\\(\\(Re: +\\)?\\(" regexp |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1690 " *\\)\\)+\\(Re: +\\)?\\)") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1691 nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1692 (let ((s (or (match-string 3) (match-string 5)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1693 (delete-region (match-beginning 1) (match-end 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1694 (when s |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1695 (goto-char (match-beginning 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1696 (insert s)))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1697 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1698 (defun article-hide-pgp () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1699 "Remove any PGP headers and signatures in the current article." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1700 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1701 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1702 (save-restriction |
17493 | 1703 (let ((inhibit-point-motion-hooks t) |
1704 buffer-read-only beg end) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1705 (article-goto-body) |
17493 | 1706 ;; Hide the "header". |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1707 (when (re-search-forward "^-----BEGIN PGP SIGNED MESSAGE-----\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1708 (push 'pgp gnus-article-wash-types) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1709 (delete-region (match-beginning 0) (match-end 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1710 ;; Remove armor headers (rfc2440 6.2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1711 (delete-region (point) (or (re-search-forward "^[ \t]*\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1712 (point))) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1713 (setq beg (point)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1714 ;; Hide the actual signature. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1715 (and (search-forward "\n-----BEGIN PGP SIGNATURE-----\n" nil t) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1716 (setq end (1+ (match-beginning 0))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1717 (delete-region |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1718 end |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1719 (if (search-forward "\n-----END PGP SIGNATURE-----\n" nil t) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1720 (match-end 0) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1721 ;; Perhaps we shouldn't hide to the end of the buffer |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1722 ;; if there is no end to the signature? |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1723 (point-max)))) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1724 ;; Hide "- " PGP quotation markers. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1725 (when (and beg end) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1726 (narrow-to-region beg end) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1727 (goto-char (point-min)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1728 (while (re-search-forward "^- " nil t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1729 (delete-region |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1730 (match-beginning 0) (match-end 0))) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1731 (widen)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1732 (gnus-run-hooks 'gnus-article-hide-pgp-hook)))))) |
17493 | 1733 |
1734 (defun article-hide-pem (&optional arg) | |
1735 "Toggle hiding of any PEM headers and signatures in the current article. | |
1736 If given a negative prefix, always show; if given a positive prefix, | |
1737 always hide." | |
1738 (interactive (gnus-article-hidden-arg)) | |
1739 (unless (gnus-article-check-hidden-text 'pem arg) | |
1740 (save-excursion | |
1741 (let (buffer-read-only end) | |
1742 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1743 ;; Hide the horrendously ugly "header". |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1744 (when (and (search-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1745 "\n-----BEGIN PRIVACY-ENHANCED MESSAGE-----\n" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1746 nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1747 (setq end (1+ (match-beginning 0)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1748 (push 'pem gnus-article-wash-types) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1749 (gnus-article-hide-text-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1750 end |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1751 (if (search-forward "\n\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1752 (match-end 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1753 (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1754 'pem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1755 ;; Hide the trailer as well |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1756 (when (search-forward "\n-----END PRIVACY-ENHANCED MESSAGE-----\n" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1757 nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1758 (gnus-article-hide-text-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1759 (match-beginning 0) (match-end 0) 'pem))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1760 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1761 (defun article-strip-banner () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1762 "Strip the banner specified by the `banner' group parameter." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1763 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1764 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1765 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1766 (let ((inhibit-point-motion-hooks t) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1767 (banner (gnus-group-find-parameter gnus-newsgroup-name 'banner)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1768 (gnus-signature-limit nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1769 buffer-read-only beg end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1770 (when banner |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1771 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1772 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1773 ((eq banner 'signature) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1774 (when (gnus-article-narrow-to-signature) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1775 (widen) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1776 (forward-line -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1777 (delete-region (point) (point-max)))) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1778 ((symbolp banner) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1779 (if (setq banner (cdr (assq banner gnus-article-banner-alist))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1780 (while (re-search-forward banner nil t) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1781 (delete-region (match-beginning 0) (match-end 0))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1782 ((stringp banner) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1783 (while (re-search-forward banner nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1784 (delete-region (match-beginning 0) (match-end 0)))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1785 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1786 (defun article-babel () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1787 "Translate article using an online translation service." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1788 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1789 (require 'babel) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1790 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1791 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1792 (when (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1793 (let* ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1794 (start (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1795 (end (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1796 (orig (buffer-substring start end)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1797 (trans (babel-as-string orig))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1798 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1799 (narrow-to-region start end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1800 (delete-region start end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1801 (insert trans)))))) |
17493 | 1802 |
1803 (defun article-hide-signature (&optional arg) | |
1804 "Hide the signature in the current article. | |
1805 If given a negative prefix, always show; if given a positive prefix, | |
1806 always hide." | |
1807 (interactive (gnus-article-hidden-arg)) | |
1808 (unless (gnus-article-check-hidden-text 'signature arg) | |
1809 (save-excursion | |
1810 (save-restriction | |
1811 (let ((buffer-read-only nil)) | |
1812 (when (gnus-article-narrow-to-signature) | |
1813 (gnus-article-hide-text-type | |
1814 (point-min) (point-max) 'signature))))))) | |
1815 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1816 (defun article-strip-headers-in-body () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1817 "Strip offensive headers from bodies." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1818 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1819 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1820 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1821 (let ((case-fold-search t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1822 (when (looking-at "x-no-archive:") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1823 (gnus-delete-line))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1824 |
17493 | 1825 (defun article-strip-leading-blank-lines () |
1826 "Remove all blank lines from the beginning of the article." | |
1827 (interactive) | |
1828 (save-excursion | |
1829 (let ((inhibit-point-motion-hooks t) | |
1830 buffer-read-only) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1831 (when (article-goto-body) |
17493 | 1832 (while (and (not (eobp)) |
1833 (looking-at "[ \t]*$")) | |
1834 (gnus-delete-line)))))) | |
1835 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1836 (defun article-narrow-to-head () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1837 "Narrow the buffer to the head of the message. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1838 Point is left at the beginning of the narrowed-to region." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1839 (narrow-to-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1840 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1841 (if (search-forward "\n\n" nil 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1842 (1- (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1843 (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1844 (goto-char (point-min))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1845 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1846 (defun article-goto-body () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1847 "Place point at the start of the body." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1848 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1849 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1850 ;; This variable is only bound when dealing with separate |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1851 ;; MIME body parts. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1852 (article-goto-body-goes-to-point-min-p |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1853 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1854 ((search-forward "\n\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1855 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1856 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1857 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1858 nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1859 |
17493 | 1860 (defun article-strip-multiple-blank-lines () |
1861 "Replace consecutive blank lines with one empty line." | |
1862 (interactive) | |
1863 (save-excursion | |
1864 (let ((inhibit-point-motion-hooks t) | |
1865 buffer-read-only) | |
1866 ;; First make all blank lines empty. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1867 (article-goto-body) |
17493 | 1868 (while (re-search-forward "^[ \t]+$" nil t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1869 (unless (gnus-annotation-in-region-p |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1870 (match-beginning 0) (match-end 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1871 (replace-match "" nil t))) |
17493 | 1872 ;; Then replace multiple empty lines with a single empty line. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1873 (article-goto-body) |
17493 | 1874 (while (re-search-forward "\n\n\n+" nil t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1875 (unless (gnus-annotation-in-region-p |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1876 (match-beginning 0) (match-end 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1877 (replace-match "\n\n" t t)))))) |
17493 | 1878 |
1879 (defun article-strip-leading-space () | |
1880 "Remove all white space from the beginning of the lines in the article." | |
1881 (interactive) | |
1882 (save-excursion | |
1883 (let ((inhibit-point-motion-hooks t) | |
1884 buffer-read-only) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1885 (article-goto-body) |
17493 | 1886 (while (re-search-forward "^[ \t]+" nil t) |
1887 (replace-match "" t t))))) | |
1888 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1889 (defun article-strip-trailing-space () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1890 "Remove all white space from the end of the lines in the article." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1891 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1892 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1893 (let ((inhibit-point-motion-hooks t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1894 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1895 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1896 (while (re-search-forward "[ \t]+$" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1897 (replace-match "" t t))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1898 |
17493 | 1899 (defun article-strip-blank-lines () |
1900 "Strip leading, trailing and multiple blank lines." | |
1901 (interactive) | |
1902 (article-strip-leading-blank-lines) | |
1903 (article-remove-trailing-blank-lines) | |
1904 (article-strip-multiple-blank-lines)) | |
1905 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1906 (defun article-strip-all-blank-lines () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1907 "Strip all blank lines." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1908 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1909 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1910 (let ((inhibit-point-motion-hooks t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1911 buffer-read-only) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1912 (article-goto-body) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1913 (while (re-search-forward "^[ \t]*\n" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1914 (replace-match "" t t))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1915 |
17493 | 1916 (defun gnus-article-narrow-to-signature () |
1917 "Narrow to the signature; return t if a signature is found, else nil." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1918 (let ((inhibit-point-motion-hooks t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1919 (when (gnus-article-search-signature) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1920 (forward-line 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1921 ;; Check whether we have some limits to what we consider |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1922 ;; to be a signature. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1923 (let ((limits (if (listp gnus-signature-limit) gnus-signature-limit |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1924 (list gnus-signature-limit))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1925 limit limited) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1926 (while (setq limit (pop limits)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1927 (if (or (and (integerp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1928 (< (- (point-max) (point)) limit)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1929 (and (floatp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1930 (< (count-lines (point) (point-max)) limit)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1931 (and (gnus-functionp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1932 (funcall limit)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1933 (and (stringp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1934 (not (re-search-forward limit nil t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1935 () ; This limit did not succeed. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1936 (setq limited t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1937 limits nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1938 (unless limited |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1939 (narrow-to-region (point) (point-max)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1940 t))))) |
17493 | 1941 |
1942 (defun gnus-article-search-signature () | |
1943 "Search the current buffer for the signature separator. | |
1944 Put point at the beginning of the signature separator." | |
1945 (let ((cur (point))) | |
1946 (goto-char (point-max)) | |
1947 (if (if (stringp gnus-signature-separator) | |
1948 (re-search-backward gnus-signature-separator nil t) | |
1949 (let ((seps gnus-signature-separator)) | |
1950 (while (and seps | |
1951 (not (re-search-backward (car seps) nil t))) | |
1952 (pop seps)) | |
1953 seps)) | |
1954 t | |
1955 (goto-char cur) | |
1956 nil))) | |
1957 | |
1958 (defun gnus-article-hidden-arg () | |
1959 "Return the current prefix arg as a number, or 0 if no prefix." | |
1960 (list (if current-prefix-arg | |
1961 (prefix-numeric-value current-prefix-arg) | |
1962 0))) | |
1963 | |
1964 (defun gnus-article-check-hidden-text (type arg) | |
1965 "Return nil if hiding is necessary. | |
1966 Arg can be nil or a number. Nil and positive means hide, negative | |
1967 means show, 0 means toggle." | |
1968 (save-excursion | |
1969 (save-restriction | |
1970 (let ((hide (gnus-article-hidden-text-p type))) | |
1971 (cond | |
1972 ((or (null arg) | |
1973 (> arg 0)) | |
1974 nil) | |
1975 ((< arg 0) | |
34833
aaf69bc74739
* gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34818
diff
changeset
|
1976 (gnus-article-show-hidden-text type) |
aaf69bc74739
* gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34818
diff
changeset
|
1977 t) |
17493 | 1978 (t |
1979 (if (eq hide 'hidden) | |
34833
aaf69bc74739
* gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34818
diff
changeset
|
1980 (progn |
aaf69bc74739
* gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34818
diff
changeset
|
1981 (gnus-article-show-hidden-text type) |
aaf69bc74739
* gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34818
diff
changeset
|
1982 t) |
17493 | 1983 nil))))))) |
1984 | |
1985 (defun gnus-article-hidden-text-p (type) | |
1986 "Say whether the current buffer contains hidden text of type TYPE." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1987 (let ((pos (text-property-any (point-min) (point-max) 'article-type type))) |
17493 | 1988 (while (and pos |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1989 (not (get-text-property pos 'invisible)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1990 (not (get-text-property pos 'dummy-invisible))) |
17493 | 1991 (setq pos |
1992 (text-property-any (1+ pos) (point-max) 'article-type type))) | |
1993 (if pos | |
1994 'hidden | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1995 nil))) |
17493 | 1996 |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
1997 (defun gnus-article-show-hidden-text (type &optional dummy) |
17493 | 1998 "Show all hidden text of type TYPE. |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
1999 Originally it is hide instead of DUMMY." |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2000 (let ((buffer-read-only nil) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2001 (inhibit-point-motion-hooks t)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2002 (gnus-remove-text-properties-when |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2003 'article-type type |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2004 (point-min) (point-max) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2005 (cons 'article-type (cons type |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2006 gnus-hidden-properties))))) |
17493 | 2007 |
2008 (defconst article-time-units | |
2009 `((year . ,(* 365.25 24 60 60)) | |
2010 (week . ,(* 7 24 60 60)) | |
2011 (day . ,(* 24 60 60)) | |
2012 (hour . ,(* 60 60)) | |
2013 (minute . 60) | |
2014 (second . 1)) | |
2015 "Mapping from time units to seconds.") | |
2016 | |
2017 (defun article-date-ut (&optional type highlight header) | |
2018 "Convert DATE date to universal time in the current article. | |
2019 If TYPE is `local', convert to local time; if it is `lapsed', output | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2020 how much time has lapsed since DATE. For `lapsed', the value of |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2021 `gnus-article-date-lapsed-new-header' says whether the \"X-Sent:\" header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2022 should replace the \"Date:\" one, or should be added below it." |
17493 | 2023 (interactive (list 'ut t)) |
2024 (let* ((header (or header | |
2025 (message-fetch-field "date") | |
2026 "")) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2027 (tdate-regexp "^Date:[ \t]\\|^X-Sent:[ \t]") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2028 (date-regexp |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2029 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2030 ((not gnus-article-date-lapsed-new-header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2031 tdate-regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2032 ((eq type 'lapsed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2033 "^X-Sent:[ \t]") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2034 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2035 "^Date:[ \t]"))) |
17493 | 2036 (date (if (vectorp header) (mail-header-date header) |
2037 header)) | |
2038 (inhibit-point-motion-hooks t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2039 pos |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2040 bface eface) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2041 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2042 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2043 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2044 (when (re-search-forward tdate-regexp nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2045 (setq bface (get-text-property (gnus-point-at-bol) 'face) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2046 date (or (get-text-property (gnus-point-at-bol) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2047 'original-date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2048 date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2049 eface (get-text-property (1- (gnus-point-at-eol)) 'face)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2050 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2051 (when (and date (not (string= date ""))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2052 (goto-char (point-min)) |
17493 | 2053 (let ((buffer-read-only nil)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2054 ;; Delete any old Date headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2055 (while (re-search-forward date-regexp nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2056 (if pos |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2057 (delete-region (progn (beginning-of-line) (point)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2058 (progn (forward-line 1) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2059 (delete-region (progn (beginning-of-line) (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2060 (progn (end-of-line) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2061 (setq pos (point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2062 (when (and (not pos) (re-search-forward tdate-regexp nil t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2063 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2064 (if pos (goto-char pos)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2065 (insert (article-make-date-line date (or type 'ut))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2066 (when (not pos) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2067 (insert "\n") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2068 (forward-line -1)) |
17493 | 2069 ;; Do highlighting. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2070 (beginning-of-line) |
17493 | 2071 (when (looking-at "\\([^:]+\\): *\\(.*\\)$") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2072 (put-text-property (match-beginning 1) (1+ (match-end 1)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2073 'original-date date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2074 (put-text-property (match-beginning 1) (1+ (match-end 1)) |
17493 | 2075 'face bface) |
2076 (put-text-property (match-beginning 2) (match-end 2) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2077 'face eface)))))))) |
17493 | 2078 |
2079 (defun article-make-date-line (date type) | |
2080 "Return a DATE line of TYPE." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2081 (let ((time (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2082 (date-to-time date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2083 (error '(0 0))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2084 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2085 ;; Convert to the local timezone. We have to slap a |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2086 ;; `condition-case' round the calls to the timezone |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2087 ;; functions since they aren't particularly resistant to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2088 ;; buggy dates. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2089 ((eq type 'local) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2090 (let ((tz (car (current-time-zone time)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2091 (format "Date: %s %s%02d%02d" (current-time-string time) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2092 (if (> tz 0) "+" "-") (/ (abs tz) 3600) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2093 (/ (% (abs tz) 3600) 60)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2094 ;; Convert to Universal Time. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2095 ((eq type 'ut) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2096 (concat "Date: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2097 (current-time-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2098 (let* ((e (parse-time-string date)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2099 (tm (apply 'encode-time e)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2100 (ms (car tm)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2101 (ls (- (cadr tm) (car (current-time-zone time))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2102 (cond ((< ls 0) (list (1- ms) (+ ls 65536))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2103 ((> ls 65535) (list (1+ ms) (- ls 65536))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2104 (t (list ms ls))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2105 " UT")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2106 ;; Get the original date from the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2107 ((eq type 'original) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2108 (concat "Date: " (if (string-match "\n+$" date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2109 (substring date 0 (match-beginning 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2110 date))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2111 ;; Let the user define the format. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2112 ((eq type 'user) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2113 (if (gnus-functionp gnus-article-time-format) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2114 (funcall gnus-article-time-format time) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2115 (concat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2116 "Date: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2117 (format-time-string gnus-article-time-format time)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2118 ;; ISO 8601. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2119 ((eq type 'iso8601) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2120 (let ((tz (car (current-time-zone time)))) |
17493 | 2121 (concat |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2122 "Date: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2123 (format-time-string "%Y%m%dT%H%M%S" time) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2124 (format "%s%02d%02d" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2125 (if (> tz 0) "+" "-") (/ (abs tz) 3600) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2126 (/ (% (abs tz) 3600) 60))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2127 ;; Do an X-Sent lapsed format. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2128 ((eq type 'lapsed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2129 ;; If the date is seriously mangled, the timezone functions are |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2130 ;; liable to bug out, so we ignore all errors. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2131 (let* ((now (current-time)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2132 (real-time (subtract-time now time)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2133 (real-sec (and real-time |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2134 (+ (* (float (car real-time)) 65536) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2135 (cadr real-time)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2136 (sec (and real-time (abs real-sec))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2137 num prev) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2138 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2139 ((null real-time) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2140 "X-Sent: Unknown") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2141 ((zerop sec) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2142 "X-Sent: Now") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2143 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2144 (concat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2145 "X-Sent: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2146 ;; This is a bit convoluted, but basically we go |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2147 ;; through the time units for years, weeks, etc, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2148 ;; and divide things to see whether that results |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2149 ;; in positive answers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2150 (mapconcat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2151 (lambda (unit) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2152 (if (zerop (setq num (ffloor (/ sec (cdr unit))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2153 ;; The (remaining) seconds are too few to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2154 ;; be divided into this time unit. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2155 "" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2156 ;; It's big enough, so we output it. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2157 (setq sec (- sec (* num (cdr unit)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2158 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2159 (concat (if prev ", " "") (int-to-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2160 (floor num)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2161 " " (symbol-name (car unit)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2162 (if (> num 1) "s" "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2163 (setq prev t)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2164 article-time-units "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2165 ;; If dates are odd, then it might appear like the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2166 ;; article was sent in the future. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2167 (if (> real-sec 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2168 " ago" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2169 " in the future")))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2170 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2171 (error "Unknown conversion type: %s" type))))) |
17493 | 2172 |
2173 (defun article-date-local (&optional highlight) | |
2174 "Convert the current article date to the local timezone." | |
2175 (interactive (list t)) | |
2176 (article-date-ut 'local highlight)) | |
2177 | |
2178 (defun article-date-original (&optional highlight) | |
2179 "Convert the current article date to what it was originally. | |
2180 This is only useful if you have used some other date conversion | |
2181 function and want to see what the date was before converting." | |
2182 (interactive (list t)) | |
2183 (article-date-ut 'original highlight)) | |
2184 | |
2185 (defun article-date-lapsed (&optional highlight) | |
2186 "Convert the current article date to time lapsed since it was sent." | |
2187 (interactive (list t)) | |
2188 (article-date-ut 'lapsed highlight)) | |
2189 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2190 (defun article-update-date-lapsed () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2191 "Function to be run from a timer to update the lapsed time line." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2192 (let (deactivate-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2193 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2194 (ignore-errors |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2195 (walk-windows |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2196 (lambda (w) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2197 (set-buffer (window-buffer w)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2198 (when (eq major-mode 'gnus-article-mode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2199 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2200 (when (re-search-forward "^X-Sent:" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2201 (article-date-lapsed t)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2202 nil 'visible))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2203 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2204 (defun gnus-start-date-timer (&optional n) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2205 "Start a timer to update the X-Sent header in the article buffers. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2206 The numerical prefix says how frequently (in seconds) the function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2207 is to run." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2208 (interactive "p") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2209 (unless n |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2210 (setq n 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2211 (gnus-stop-date-timer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2212 (setq article-lapsed-timer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2213 (nnheader-run-at-time 1 n 'article-update-date-lapsed))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2214 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2215 (defun gnus-stop-date-timer () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2216 "Stop the X-Sent timer." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2217 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2218 (when article-lapsed-timer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2219 (nnheader-cancel-timer article-lapsed-timer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2220 (setq article-lapsed-timer nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2221 |
17493 | 2222 (defun article-date-user (&optional highlight) |
2223 "Convert the current article date to the user-defined format. | |
2224 This format is defined by the `gnus-article-time-format' variable." | |
2225 (interactive (list t)) | |
2226 (article-date-ut 'user highlight)) | |
2227 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2228 (defun article-date-iso8601 (&optional highlight) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2229 "Convert the current article date to ISO8601." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2230 (interactive (list t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2231 (article-date-ut 'iso8601 highlight)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2232 |
17493 | 2233 (defun article-show-all () |
2234 "Show all hidden text in the article buffer." | |
2235 (interactive) | |
2236 (save-excursion | |
2237 (let ((buffer-read-only nil)) | |
2238 (gnus-article-unhide-text (point-min) (point-max))))) | |
2239 | |
2240 (defun article-emphasize (&optional arg) | |
2241 "Emphasize text according to `gnus-emphasis-alist'." | |
2242 (interactive (gnus-article-hidden-arg)) | |
2243 (unless (gnus-article-check-hidden-text 'emphasis arg) | |
2244 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2245 (let ((alist (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2246 (condition-case nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2247 (with-current-buffer gnus-summary-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2248 gnus-article-emphasis-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2249 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2250 gnus-emphasis-alist)) |
17493 | 2251 (buffer-read-only nil) |
2252 (props (append '(article-type emphasis) | |
2253 gnus-hidden-properties)) | |
2254 regexp elem beg invisible visible face) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2255 (article-goto-body) |
17493 | 2256 (setq beg (point)) |
2257 (while (setq elem (pop alist)) | |
2258 (goto-char beg) | |
2259 (setq regexp (car elem) | |
2260 invisible (nth 1 elem) | |
2261 visible (nth 2 elem) | |
2262 face (nth 3 elem)) | |
2263 (while (re-search-forward regexp nil t) | |
2264 (when (and (match-beginning visible) (match-beginning invisible)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2265 (push 'emphasis gnus-article-wash-types) |
17493 | 2266 (gnus-article-hide-text |
2267 (match-beginning invisible) (match-end invisible) props) | |
2268 (gnus-article-unhide-text-type | |
2269 (match-beginning visible) (match-end visible) 'emphasis) | |
2270 (gnus-put-text-property-excluding-newlines | |
2271 (match-beginning visible) (match-end visible) 'face face) | |
2272 (goto-char (match-end invisible))))))))) | |
2273 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2274 (defun gnus-article-setup-highlight-words (&optional highlight-words) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2275 "Setup newsgroup emphasis alist." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2276 (unless gnus-article-emphasis-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2277 (let ((name (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2278 (gnus-group-real-name gnus-newsgroup-name)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2279 (make-local-variable 'gnus-article-emphasis-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2280 (setq gnus-article-emphasis-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2281 (nconc |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2282 (let ((alist gnus-group-highlight-words-alist) elem highlight) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2283 (while (setq elem (pop alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2284 (when (and name (string-match (car elem) name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2285 (setq alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2286 highlight (copy-sequence (cdr elem))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2287 highlight) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2288 (copy-sequence highlight-words) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2289 (if gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2290 (copy-sequence (gnus-group-find-parameter |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2291 gnus-newsgroup-name 'highlight-words t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2292 gnus-emphasis-alist))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2293 |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2294 (eval-when-compile |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2295 (defvar gnus-summary-article-menu) |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2296 (defvar gnus-summary-post-menu)) |
17493 | 2297 |
2298 ;;; Saving functions. | |
2299 | |
2300 (defun gnus-article-save (save-buffer file &optional num) | |
2301 "Save the currently selected article." | |
2302 (unless gnus-save-all-headers | |
2303 ;; Remove headers according to `gnus-saved-headers'. | |
2304 (let ((gnus-visible-headers | |
2305 (or gnus-saved-headers gnus-visible-headers)) | |
2306 (gnus-article-buffer save-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2307 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2308 (set-buffer save-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2309 (article-hide-headers 1 t)))) |
17493 | 2310 (save-window-excursion |
2311 (if (not gnus-default-article-saver) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2312 (error "No default saver is defined") |
17493 | 2313 ;; !!! Magic! The saving functions all save |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2314 ;; `gnus-save-article-buffer' (or so they think), but we |
17493 | 2315 ;; bind that variable to our save-buffer. |
2316 (set-buffer gnus-article-buffer) | |
2317 (let* ((gnus-save-article-buffer save-buffer) | |
2318 (filename | |
2319 (cond | |
2320 ((not gnus-prompt-before-saving) 'default) | |
2321 ((eq gnus-prompt-before-saving 'always) nil) | |
2322 (t file))) | |
2323 (gnus-number-of-articles-to-be-saved | |
2324 (when (eq gnus-prompt-before-saving t) | |
2325 num))) ; Magic | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2326 (set-buffer gnus-article-current-summary) |
17493 | 2327 (funcall gnus-default-article-saver filename))))) |
2328 | |
2329 (defun gnus-read-save-file-name (prompt &optional filename | |
2330 function group headers variable) | |
2331 (let ((default-name | |
2332 (funcall function group headers (symbol-value variable))) | |
2333 result) | |
33077 | 2334 (setq result |
2335 (expand-file-name | |
2336 (cond | |
2337 ((eq filename 'default) | |
2338 default-name) | |
2339 ((eq filename t) | |
2340 default-name) | |
2341 (filename filename) | |
2342 (t | |
2343 (let* ((split-name (gnus-get-split-value gnus-split-methods)) | |
2344 (prompt | |
2345 (format prompt | |
2346 (if (and gnus-number-of-articles-to-be-saved | |
2347 (> gnus-number-of-articles-to-be-saved 1)) | |
2348 (format "these %d articles" | |
2349 gnus-number-of-articles-to-be-saved) | |
2350 "this article"))) | |
2351 (file | |
2352 ;; Let the split methods have their say. | |
2353 (cond | |
2354 ;; No split name was found. | |
2355 ((null split-name) | |
2356 (read-file-name | |
2357 (concat prompt " (default " | |
2358 (file-name-nondirectory default-name) ") ") | |
2359 (file-name-directory default-name) | |
2360 default-name)) | |
2361 ;; A single group name is returned. | |
2362 ((stringp split-name) | |
2363 (setq default-name | |
2364 (funcall function split-name headers | |
2365 (symbol-value variable))) | |
2366 (read-file-name | |
2367 (concat prompt " (default " | |
2368 (file-name-nondirectory default-name) ") ") | |
2369 (file-name-directory default-name) | |
2370 default-name)) | |
2371 ;; A single split name was found | |
2372 ((= 1 (length split-name)) | |
2373 (let* ((name (expand-file-name | |
2374 (car split-name) gnus-article-save-directory)) | |
2375 (dir (cond ((file-directory-p name) | |
2376 (file-name-as-directory name)) | |
2377 ((file-exists-p name) name) | |
2378 (t gnus-article-save-directory)))) | |
2379 (read-file-name | |
2380 (concat prompt " (default " name ") ") | |
2381 dir name))) | |
2382 ;; A list of splits was found. | |
2383 (t | |
2384 (setq split-name (nreverse split-name)) | |
2385 (let (result) | |
2386 (let ((file-name-history | |
2387 (nconc split-name file-name-history))) | |
2388 (setq result | |
2389 (expand-file-name | |
2390 (read-file-name | |
2391 (concat prompt " (`M-p' for defaults) ") | |
2392 gnus-article-save-directory | |
2393 (car split-name)) | |
2394 gnus-article-save-directory))) | |
2395 (car (push result file-name-history))))))) | |
2396 ;; Create the directory. | |
2397 (gnus-make-directory (file-name-directory file)) | |
2398 ;; If we have read a directory, we append the default file name. | |
2399 (when (file-directory-p file) | |
2400 (setq file (expand-file-name (file-name-nondirectory default-name) | |
2401 (file-name-as-directory file)))) | |
2402 ;; Possibly translate some characters. | |
2403 (nnheader-translate-file-chars file)))))) | |
17493 | 2404 (gnus-make-directory (file-name-directory result)) |
2405 (set variable result))) | |
2406 | |
2407 (defun gnus-article-archive-name (group) | |
2408 "Return the first instance of an \"Archive-name\" in the current buffer." | |
2409 (let ((case-fold-search t)) | |
2410 (when (re-search-forward "archive-name: *\\([^ \n\t]+\\)[ \t]*$" nil t) | |
2411 (nnheader-concat gnus-article-save-directory | |
2412 (match-string 1))))) | |
2413 | |
2414 (defun gnus-article-nndoc-name (group) | |
2415 "If GROUP is an nndoc group, return the name of the parent group." | |
2416 (when (eq (car (gnus-find-method-for-group group)) 'nndoc) | |
2417 (gnus-group-get-parameter group 'save-article-group))) | |
2418 | |
2419 (defun gnus-summary-save-in-rmail (&optional filename) | |
2420 "Append this article to Rmail file. | |
2421 Optional argument FILENAME specifies file name. | |
2422 Directory to save to is default to `gnus-article-save-directory'." | |
2423 (setq filename (gnus-read-save-file-name | |
2424 "Save %s in rmail file:" filename | |
2425 gnus-rmail-save-name gnus-newsgroup-name | |
2426 gnus-current-headers 'gnus-newsgroup-last-rmail)) | |
2427 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
2428 (save-excursion | |
2429 (save-restriction | |
2430 (widen) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2431 (gnus-output-to-rmail filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2432 filename) |
17493 | 2433 |
2434 (defun gnus-summary-save-in-mail (&optional filename) | |
2435 "Append this article to Unix mail file. | |
2436 Optional argument FILENAME specifies file name. | |
2437 Directory to save to is default to `gnus-article-save-directory'." | |
2438 (setq filename (gnus-read-save-file-name | |
2439 "Save %s in Unix mail file:" filename | |
2440 gnus-mail-save-name gnus-newsgroup-name | |
2441 gnus-current-headers 'gnus-newsgroup-last-mail)) | |
2442 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
2443 (save-excursion | |
2444 (save-restriction | |
2445 (widen) | |
2446 (if (and (file-readable-p filename) | |
2447 (mail-file-babyl-p filename)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2448 (rmail-output-to-rmail-file filename t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2449 (gnus-output-to-mail filename))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2450 filename) |
17493 | 2451 |
2452 (defun gnus-summary-save-in-file (&optional filename overwrite) | |
2453 "Append this article to file. | |
2454 Optional argument FILENAME specifies file name. | |
2455 Directory to save to is default to `gnus-article-save-directory'." | |
2456 (setq filename (gnus-read-save-file-name | |
2457 "Save %s in file:" filename | |
2458 gnus-file-save-name gnus-newsgroup-name | |
2459 gnus-current-headers 'gnus-newsgroup-last-file)) | |
2460 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
2461 (save-excursion | |
2462 (save-restriction | |
2463 (widen) | |
2464 (when (and overwrite | |
2465 (file-exists-p filename)) | |
2466 (delete-file filename)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2467 (gnus-output-to-file filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2468 filename) |
17493 | 2469 |
2470 (defun gnus-summary-write-to-file (&optional filename) | |
2471 "Write this article to a file. | |
2472 Optional argument FILENAME specifies file name. | |
2473 The directory to save in defaults to `gnus-article-save-directory'." | |
2474 (gnus-summary-save-in-file nil t)) | |
2475 | |
2476 (defun gnus-summary-save-body-in-file (&optional filename) | |
2477 "Append this article body to a file. | |
2478 Optional argument FILENAME specifies file name. | |
2479 The directory to save in defaults to `gnus-article-save-directory'." | |
2480 (setq filename (gnus-read-save-file-name | |
2481 "Save %s body in file:" filename | |
2482 gnus-file-save-name gnus-newsgroup-name | |
2483 gnus-current-headers 'gnus-newsgroup-last-file)) | |
2484 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
2485 (save-excursion | |
2486 (save-restriction | |
2487 (widen) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2488 (when (article-goto-body) |
17493 | 2489 (narrow-to-region (point) (point-max))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2490 (gnus-output-to-file filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2491 filename) |
17493 | 2492 |
2493 (defun gnus-summary-save-in-pipe (&optional command) | |
2494 "Pipe this article to subprocess." | |
2495 (setq command | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2496 (cond ((and (eq command 'default) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2497 gnus-last-shell-command) |
17493 | 2498 gnus-last-shell-command) |
35838
53eebdb81828
2001-02-01 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35759
diff
changeset
|
2499 ((stringp command) |
53eebdb81828
2001-02-01 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35759
diff
changeset
|
2500 command) |
17493 | 2501 (t (read-string |
2502 (format | |
2503 "Shell command on %s: " | |
2504 (if (and gnus-number-of-articles-to-be-saved | |
2505 (> gnus-number-of-articles-to-be-saved 1)) | |
2506 (format "these %d articles" | |
2507 gnus-number-of-articles-to-be-saved) | |
2508 "this article")) | |
2509 gnus-last-shell-command)))) | |
2510 (when (string-equal command "") | |
35838
53eebdb81828
2001-02-01 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35759
diff
changeset
|
2511 (if gnus-last-shell-command |
53eebdb81828
2001-02-01 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35759
diff
changeset
|
2512 (setq command gnus-last-shell-command) |
38413
a26d9b55abb6
Some fixes to follow coding conventions in files from Gnus.
Pavel Janík <Pavel@Janik.cz>
parents:
35957
diff
changeset
|
2513 (error "A command is required"))) |
17493 | 2514 (gnus-eval-in-buffer-window gnus-article-buffer |
2515 (save-restriction | |
2516 (widen) | |
2517 (shell-command-on-region (point-min) (point-max) command nil))) | |
2518 (setq gnus-last-shell-command command)) | |
2519 | |
2520 ;;; Article file names when saving. | |
2521 | |
2522 (defun gnus-capitalize-newsgroup (newsgroup) | |
2523 "Capitalize NEWSGROUP name." | |
2524 (when (not (zerop (length newsgroup))) | |
2525 (concat (char-to-string (upcase (aref newsgroup 0))) | |
2526 (substring newsgroup 1)))) | |
2527 | |
2528 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file) | |
2529 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
2530 If variable `gnus-use-long-file-name' is non-nil, it is ~/News/News.group/num. | |
2531 Otherwise, it is like ~/News/news/group/num." | |
2532 (let ((default | |
2533 (expand-file-name | |
2534 (concat (if (gnus-use-long-file-name 'not-save) | |
2535 (gnus-capitalize-newsgroup newsgroup) | |
2536 (gnus-newsgroup-directory-form newsgroup)) | |
2537 "/" (int-to-string (mail-header-number headers))) | |
2538 gnus-article-save-directory))) | |
2539 (if (and last-file | |
2540 (string-equal (file-name-directory default) | |
2541 (file-name-directory last-file)) | |
2542 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
2543 default | |
2544 (or last-file default)))) | |
2545 | |
2546 (defun gnus-numeric-save-name (newsgroup headers &optional last-file) | |
2547 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
2548 If variable `gnus-use-long-file-name' is non-nil, it is | |
2549 ~/News/news.group/num. Otherwise, it is like ~/News/news/group/num." | |
2550 (let ((default | |
2551 (expand-file-name | |
2552 (concat (if (gnus-use-long-file-name 'not-save) | |
2553 newsgroup | |
2554 (gnus-newsgroup-directory-form newsgroup)) | |
2555 "/" (int-to-string (mail-header-number headers))) | |
2556 gnus-article-save-directory))) | |
2557 (if (and last-file | |
2558 (string-equal (file-name-directory default) | |
2559 (file-name-directory last-file)) | |
2560 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
2561 default | |
2562 (or last-file default)))) | |
2563 | |
2564 (defun gnus-plain-save-name (newsgroup headers &optional last-file) | |
2565 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
2566 If variable `gnus-use-long-file-name' is non-nil, it is | |
2567 ~/News/news.group. Otherwise, it is like ~/News/news/group/news." | |
2568 (or last-file | |
2569 (expand-file-name | |
2570 (if (gnus-use-long-file-name 'not-save) | |
2571 newsgroup | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2572 (expand-file-name "news" (gnus-newsgroup-directory-form newsgroup))) |
17493 | 2573 gnus-article-save-directory))) |
2574 | |
2575 (eval-and-compile | |
2576 (mapcar | |
2577 (lambda (func) | |
2578 (let (afunc gfunc) | |
2579 (if (consp func) | |
2580 (setq afunc (car func) | |
2581 gfunc (cdr func)) | |
2582 (setq afunc func | |
2583 gfunc (intern (format "gnus-%s" func)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2584 (defalias gfunc |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2585 (if (fboundp afunc) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2586 `(lambda (&optional interactive &rest args) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2587 ,(documentation afunc t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2588 (interactive (list t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2589 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2590 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2591 (if interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2592 (call-interactively ',afunc) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2593 (apply ',afunc args)))))))) |
17493 | 2594 '(article-hide-headers |
2595 article-hide-boring-headers | |
2596 article-treat-overstrike | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2597 article-fill-long-lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2598 article-capitalize-sentences |
17493 | 2599 article-remove-cr |
2600 article-display-x-face | |
2601 article-de-quoted-unreadable | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2602 article-de-base64-unreadable |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2603 article-decode-HZ |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2604 article-wash-html |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2605 article-hide-list-identifiers |
17493 | 2606 article-hide-pgp |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2607 article-strip-banner |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2608 article-babel |
17493 | 2609 article-hide-pem |
2610 article-hide-signature | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2611 article-strip-headers-in-body |
17493 | 2612 article-remove-trailing-blank-lines |
2613 article-strip-leading-blank-lines | |
2614 article-strip-multiple-blank-lines | |
2615 article-strip-leading-space | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2616 article-strip-trailing-space |
17493 | 2617 article-strip-blank-lines |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2618 article-strip-all-blank-lines |
17493 | 2619 article-date-local |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2620 article-date-iso8601 |
17493 | 2621 article-date-original |
2622 article-date-ut | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2623 article-decode-mime-words |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2624 article-decode-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2625 article-decode-encoded-words |
17493 | 2626 article-date-user |
2627 article-date-lapsed | |
2628 article-emphasize | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2629 article-treat-dumbquotes |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2630 article-normalize-headers |
17493 | 2631 (article-show-all . gnus-article-show-all-headers)))) |
2632 | |
2633 ;;; | |
2634 ;;; Gnus article mode | |
2635 ;;; | |
2636 | |
2637 (put 'gnus-article-mode 'mode-class 'special) | |
2638 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2639 (set-keymap-parent gnus-article-mode-map widget-keymap) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2640 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2641 (gnus-define-keys gnus-article-mode-map |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2642 " " gnus-article-goto-next-page |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2643 "\177" gnus-article-goto-prev-page |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2644 [delete] gnus-article-goto-prev-page |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2645 [backspace] gnus-article-goto-prev-page |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2646 "\C-c^" gnus-article-refer-article |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2647 "h" gnus-article-show-summary |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2648 "s" gnus-article-show-summary |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2649 "\C-c\C-m" gnus-article-mail |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2650 "?" gnus-article-describe-briefly |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2651 "e" gnus-summary-edit-article |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2652 "<" beginning-of-buffer |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2653 ">" end-of-buffer |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2654 "\C-c\C-i" gnus-info-find-node |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2655 "\C-c\C-b" gnus-bug |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2656 "\C-hk" gnus-article-describe-key |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2657 "\C-hc" gnus-article-describe-key-briefly |
17493 | 2658 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2659 "\C-d" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2660 "\M-*" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2661 "\M-#" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2662 "\M-^" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2663 "\M-g" gnus-article-read-summary-keys) |
17493 | 2664 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2665 (substitute-key-definition |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2666 'undefined 'gnus-article-read-summary-keys gnus-article-mode-map) |
17493 | 2667 |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2668 (defvar gnus-article-post-menu nil) |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2669 |
17493 | 2670 (defun gnus-article-make-menu-bar () |
2671 (gnus-turn-off-edit-menu 'article) | |
2672 (unless (boundp 'gnus-article-article-menu) | |
2673 (easy-menu-define | |
2674 gnus-article-article-menu gnus-article-mode-map "" | |
2675 '("Article" | |
2676 ["Scroll forwards" gnus-article-goto-next-page t] | |
2677 ["Scroll backwards" gnus-article-goto-prev-page t] | |
2678 ["Show summary" gnus-article-show-summary t] | |
2679 ["Fetch Message-ID at point" gnus-article-refer-article t] | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2680 ["Mail to address at point" gnus-article-mail t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2681 ["Send a bug report" gnus-bug t])) |
17493 | 2682 |
2683 (easy-menu-define | |
2684 gnus-article-treatment-menu gnus-article-mode-map "" | |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2685 ;; Fixme: this should use :active (and maybe :visible). |
17493 | 2686 '("Treatment" |
2687 ["Hide headers" gnus-article-hide-headers t] | |
2688 ["Hide signature" gnus-article-hide-signature t] | |
2689 ["Hide citation" gnus-article-hide-citation t] | |
2690 ["Treat overstrike" gnus-article-treat-overstrike t] | |
2691 ["Remove carriage return" gnus-article-remove-cr t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2692 ["Remove quoted-unreadable" gnus-article-de-quoted-unreadable t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2693 ["Remove base64" gnus-article-de-base64-unreadable t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2694 ["Treat html" gnus-article-wash-html t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2695 ["Decode HZ" gnus-article-decode-HZ t])) |
17493 | 2696 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2697 ;; Note "Commands" menu is defined in gnus-sum.el for consistency |
17493 | 2698 |
2699 (when (boundp 'gnus-summary-post-menu) | |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2700 (cond |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2701 ((not (keymapp gnus-summary-post-menu)) |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2702 (setq gnus-article-post-menu gnus-summary-post-menu)) |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2703 ((not gnus-article-post-menu) |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2704 ;; Don't share post menu. |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2705 (setq gnus-article-post-menu |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2706 (copy-keymap gnus-summary-post-menu)))) |
17493 | 2707 (define-key gnus-article-mode-map [menu-bar post] |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2708 (cons "Post" gnus-article-post-menu))) |
17493 | 2709 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2710 (gnus-run-hooks 'gnus-article-menu-hook))) |
17493 | 2711 |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2712 ;; Fixme: do something for the Emacs tool bar in Article mode a la |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2713 ;; Summary. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2714 |
17493 | 2715 (defun gnus-article-mode () |
2716 "Major mode for displaying an article. | |
2717 | |
2718 All normal editing commands are switched off. | |
2719 | |
2720 The following commands are available in addition to all summary mode | |
2721 commands: | |
2722 \\<gnus-article-mode-map> | |
2723 \\[gnus-article-next-page]\t Scroll the article one page forwards | |
2724 \\[gnus-article-prev-page]\t Scroll the article one page backwards | |
2725 \\[gnus-article-refer-article]\t Go to the article referred to by an article id near point | |
2726 \\[gnus-article-show-summary]\t Display the summary buffer | |
2727 \\[gnus-article-mail]\t Send a reply to the address near point | |
2728 \\[gnus-article-describe-briefly]\t Describe the current mode briefly | |
2729 \\[gnus-info-find-node]\t Go to the Gnus info node" | |
2730 (interactive) | |
2731 (gnus-simplify-mode-line) | |
2732 (setq mode-name "Article") | |
2733 (setq major-mode 'gnus-article-mode) | |
2734 (make-local-variable 'minor-mode-alist) | |
2735 (use-local-map gnus-article-mode-map) | |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2736 (when (gnus-visual-p 'article-menu 'menu) |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
2737 (gnus-article-make-menu-bar)) |
17493 | 2738 (gnus-update-format-specifications nil 'article-mode) |
2739 (set (make-local-variable 'page-delimiter) gnus-page-delimiter) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2740 (make-local-variable 'gnus-page-broken) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2741 (make-local-variable 'gnus-button-marker-list) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2742 (make-local-variable 'gnus-article-current-summary) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2743 (make-local-variable 'gnus-article-mime-handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2744 (make-local-variable 'gnus-article-decoded-p) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2745 (make-local-variable 'gnus-article-mime-handle-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2746 (make-local-variable 'gnus-article-wash-types) |
17493 | 2747 (gnus-set-default-directory) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2748 (buffer-disable-undo) |
17493 | 2749 (setq buffer-read-only t) |
2750 (set-syntax-table gnus-article-mode-syntax-table) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2751 (mm-enable-multibyte) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2752 (gnus-run-hooks 'gnus-article-mode-hook)) |
17493 | 2753 |
2754 (defun gnus-article-setup-buffer () | |
2755 "Initialize the article buffer." | |
2756 (let* ((name (if gnus-single-article-buffer "*Article*" | |
2757 (concat "*Article " gnus-newsgroup-name "*"))) | |
2758 (original | |
2759 (progn (string-match "\\*Article" name) | |
2760 (concat " *Original Article" | |
2761 (substring name (match-end 0)))))) | |
2762 (setq gnus-article-buffer name) | |
2763 (setq gnus-original-article-buffer original) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2764 (setq gnus-article-mime-handle-alist nil) |
17493 | 2765 ;; This might be a variable local to the summary buffer. |
2766 (unless gnus-single-article-buffer | |
2767 (save-excursion | |
2768 (set-buffer gnus-summary-buffer) | |
2769 (setq gnus-article-buffer name) | |
2770 (setq gnus-original-article-buffer original) | |
2771 (gnus-set-global-variables))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2772 (gnus-article-setup-highlight-words) |
17493 | 2773 ;; Init original article buffer. |
2774 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2775 (set-buffer (gnus-get-buffer-create gnus-original-article-buffer)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2776 (mm-enable-multibyte) |
17493 | 2777 (setq major-mode 'gnus-original-article-mode) |
2778 (make-local-variable 'gnus-original-article)) | |
2779 (if (get-buffer name) | |
2780 (save-excursion | |
2781 (set-buffer name) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2782 (when gnus-article-mime-handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2783 (mm-destroy-parts gnus-article-mime-handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2784 (setq gnus-article-mime-handles nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2785 ;; Set it to nil in article-buffer! |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2786 (setq gnus-article-mime-handle-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2787 (buffer-disable-undo) |
17493 | 2788 (setq buffer-read-only t) |
2789 (unless (eq major-mode 'gnus-article-mode) | |
2790 (gnus-article-mode)) | |
2791 (current-buffer)) | |
2792 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2793 (set-buffer (gnus-get-buffer-create name)) |
17493 | 2794 (gnus-article-mode) |
2795 (make-local-variable 'gnus-summary-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2796 (gnus-summary-set-local-parameters gnus-newsgroup-name) |
17493 | 2797 (current-buffer))))) |
2798 | |
2799 ;; Set article window start at LINE, where LINE is the number of lines | |
2800 ;; from the head of the article. | |
2801 (defun gnus-article-set-window-start (&optional line) | |
2802 (set-window-start | |
2803 (get-buffer-window gnus-article-buffer t) | |
2804 (save-excursion | |
2805 (set-buffer gnus-article-buffer) | |
2806 (goto-char (point-min)) | |
2807 (if (not line) | |
2808 (point-min) | |
2809 (gnus-message 6 "Moved to bookmark") | |
2810 (search-forward "\n\n" nil t) | |
2811 (forward-line line) | |
2812 (point))))) | |
2813 | |
2814 (defun gnus-article-prepare (article &optional all-headers header) | |
2815 "Prepare ARTICLE in article mode buffer. | |
2816 ARTICLE should either be an article number or a Message-ID. | |
2817 If ARTICLE is an id, HEADER should be the article headers. | |
2818 If ALL-HEADERS is non-nil, no headers are hidden." | |
2819 (save-excursion | |
2820 ;; Make sure we start in a summary buffer. | |
2821 (unless (eq major-mode 'gnus-summary-mode) | |
2822 (set-buffer gnus-summary-buffer)) | |
2823 (setq gnus-summary-buffer (current-buffer)) | |
2824 (let* ((gnus-article (if header (mail-header-number header) article)) | |
2825 (summary-buffer (current-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2826 (gnus-tmp-internal-hook gnus-article-internal-prepare-hook) |
17493 | 2827 (group gnus-newsgroup-name) |
2828 result) | |
2829 (save-excursion | |
2830 (gnus-article-setup-buffer) | |
2831 (set-buffer gnus-article-buffer) | |
2832 ;; Deactivate active regions. | |
2833 (when (and (boundp 'transient-mark-mode) | |
2834 transient-mark-mode) | |
2835 (setq mark-active nil)) | |
2836 (if (not (setq result (let ((buffer-read-only nil)) | |
2837 (gnus-request-article-this-buffer | |
2838 article group)))) | |
2839 ;; There is no such article. | |
2840 (save-excursion | |
2841 (when (and (numberp article) | |
2842 (not (memq article gnus-newsgroup-sparse))) | |
2843 (setq gnus-article-current | |
2844 (cons gnus-newsgroup-name article)) | |
2845 (set-buffer gnus-summary-buffer) | |
2846 (setq gnus-current-article article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2847 (if (eq (gnus-article-mark article) gnus-undownloaded-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2848 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2849 (gnus-summary-set-agent-mark article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2850 (message "Message marked for downloading")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2851 (gnus-summary-mark-article article gnus-canceled-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2852 (unless (memq article gnus-newsgroup-sparse) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2853 (gnus-error 1 "No such article (may have expired or been canceled)"))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2854 (if (or (eq result 'pseudo) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2855 (eq result 'nneething)) |
17493 | 2856 (progn |
2857 (save-excursion | |
2858 (set-buffer summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2859 (push article gnus-newsgroup-history) |
17493 | 2860 (setq gnus-last-article gnus-current-article |
2861 gnus-current-article 0 | |
2862 gnus-current-headers nil | |
2863 gnus-article-current nil) | |
2864 (if (eq result 'nneething) | |
2865 (gnus-configure-windows 'summary) | |
2866 (gnus-configure-windows 'article)) | |
2867 (gnus-set-global-variables)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2868 (let ((gnus-article-mime-handle-alist-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2869 gnus-article-mime-handle-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2870 (gnus-set-mode-line 'article))) |
17493 | 2871 ;; The result from the `request' was an actual article - |
2872 ;; or at least some text that is now displayed in the | |
2873 ;; article buffer. | |
2874 (when (and (numberp article) | |
2875 (not (eq article gnus-current-article))) | |
2876 ;; Seems like a new article has been selected. | |
2877 ;; `gnus-current-article' must be an article number. | |
2878 (save-excursion | |
2879 (set-buffer summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2880 (push article gnus-newsgroup-history) |
17493 | 2881 (setq gnus-last-article gnus-current-article |
2882 gnus-current-article article | |
2883 gnus-current-headers | |
2884 (gnus-summary-article-header gnus-current-article) | |
2885 gnus-article-current | |
2886 (cons gnus-newsgroup-name gnus-current-article)) | |
2887 (unless (vectorp gnus-current-headers) | |
2888 (setq gnus-current-headers nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2889 (gnus-summary-goto-subject gnus-current-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2890 (when (gnus-summary-show-thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2891 ;; If the summary buffer really was folded, the |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2892 ;; previous goto may not actually have gone to |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2893 ;; the right article, but the thread root instead. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2894 ;; So we go again. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2895 (gnus-summary-goto-subject gnus-current-article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2896 (gnus-run-hooks 'gnus-mark-article-hook) |
17493 | 2897 (gnus-set-mode-line 'summary) |
2898 (when (gnus-visual-p 'article-highlight 'highlight) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2899 (gnus-run-hooks 'gnus-visual-mark-article-hook)) |
17493 | 2900 ;; Set the global newsgroup variables here. |
2901 (gnus-set-global-variables) | |
2902 (setq gnus-have-all-headers | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2903 (or all-headers gnus-show-all-headers)))) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
2904 (save-excursion |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
2905 (gnus-configure-windows 'article)) |
17493 | 2906 (when (or (numberp article) |
2907 (stringp article)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2908 (gnus-article-prepare-display) |
17493 | 2909 ;; Do page break. |
2910 (goto-char (point-min)) | |
2911 (setq gnus-page-broken | |
2912 (when gnus-break-pages | |
2913 (gnus-narrow-to-page) | |
2914 t))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2915 (let ((gnus-article-mime-handle-alist-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2916 gnus-article-mime-handle-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2917 (gnus-set-mode-line 'article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2918 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2919 (set-window-point (get-buffer-window (current-buffer)) (point)) |
17493 | 2920 (gnus-configure-windows 'article) |
2921 t)))))) | |
2922 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2923 ;;;###autoload |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2924 (defun gnus-article-prepare-display () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2925 "Make the current buffer look like a nice article." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2926 ;; Hooks for getting information from the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2927 ;; This hook must be called before being narrowed. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2928 (let ((gnus-article-buffer (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2929 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2930 (unless (eq major-mode 'gnus-article-mode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2931 (gnus-article-mode)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2932 (setq buffer-read-only nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2933 gnus-article-wash-types nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2934 (gnus-run-hooks 'gnus-tmp-internal-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2935 (when gnus-display-mime-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2936 (funcall gnus-display-mime-function)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2937 (gnus-run-hooks 'gnus-article-prepare-hook))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2938 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2939 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2940 ;;; Gnus MIME viewing functions |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2941 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2942 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2943 (defvar gnus-mime-button-line-format "%{%([%p. %d%T]%)%}%e\n" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2944 "The following specs can be used: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2945 %t The MIME type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2946 %T MIME type, along with additional info |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2947 %n The `name' parameter |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2948 %d The description, if any |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2949 %l The length of the encoded part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2950 %p The part identifier number |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2951 %e Dots if the part isn't displayed") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2952 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2953 (defvar gnus-mime-button-line-format-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2954 '((?t gnus-tmp-type ?s) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2955 (?T gnus-tmp-type-long ?s) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2956 (?n gnus-tmp-name ?s) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2957 (?d gnus-tmp-description ?s) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2958 (?p gnus-tmp-id ?s) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2959 (?l gnus-tmp-length ?d) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2960 (?e gnus-tmp-dots ?s))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2961 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2962 (defvar gnus-mime-button-commands |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2963 '((gnus-article-press-button "\r" "Toggle Display") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2964 (gnus-mime-view-part "v" "View Interactively...") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2965 (gnus-mime-view-part-as-type "t" "View As Type...") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2966 (gnus-mime-save-part "o" "Save...") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2967 (gnus-mime-copy-part "c" "View As Text, In Other Buffer") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2968 (gnus-mime-inline-part "i" "View As Text, In This Buffer") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2969 (gnus-mime-internalize-part "E" "View Internally") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2970 (gnus-mime-externalize-part "e" "View Externally") |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
2971 (gnus-mime-pipe-part "|" "Pipe To Command...") |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
2972 (gnus-mime-action-on-part "." "Take action on the part"))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2973 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2974 (defun gnus-article-mime-part-status () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2975 (if gnus-article-mime-handle-alist-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2976 (format " (%d parts)" (length gnus-article-mime-handle-alist-1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2977 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2978 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2979 (defvar gnus-mime-button-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2980 (let ((map (make-sparse-keymap))) |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2981 ;; Not for Emacs 21: fixme better. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2982 ;; (set-keymap-parent map gnus-article-mode-map) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2983 (define-key map gnus-mouse-2 'gnus-article-push-button) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2984 (define-key map gnus-down-mouse-3 'gnus-mime-button-menu) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2985 (dolist (c gnus-mime-button-commands) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2986 (define-key map (cadr c) (car c))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2987 map)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2988 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2989 (defun gnus-mime-button-menu (event) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2990 "Construct a context-sensitive menu of MIME commands." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2991 (interactive "e") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2992 (save-excursion |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2993 (mouse-set-point event) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2994 (gnus-article-check-buffer) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2995 (let ((response (x-popup-menu |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2996 t `("MIME Part" |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2997 ("" ,@(mapcar (lambda (c) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2998 (cons (caddr c) (car c))) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2999 gnus-mime-button-commands)))))) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3000 (if response |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3001 (call-interactively response))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3002 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3003 (defun gnus-mime-view-all-parts (&optional handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3004 "View all the MIME parts." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3005 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3006 (save-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3007 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3008 (let ((handles (or handles gnus-article-mime-handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3009 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3010 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3011 (save-excursion (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3012 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3013 (if (stringp (car handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3014 (gnus-mime-view-all-parts (cdr handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3015 (mapcar 'mm-display-part handles))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3016 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3017 (defun gnus-mime-save-part () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3018 "Save the MIME part under point." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3019 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3020 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3021 (let ((data (get-text-property (point) 'gnus-data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3022 (mm-save-part data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3023 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3024 (defun gnus-mime-pipe-part () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3025 "Pipe the MIME part under point to a process." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3026 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3027 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3028 (let ((data (get-text-property (point) 'gnus-data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3029 (mm-pipe-part data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3030 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3031 (defun gnus-mime-view-part () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3032 "Interactively choose a viewing method for the MIME part under point." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3033 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3034 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3035 (let ((data (get-text-property (point) 'gnus-data))) |
35453
26726eff41ca
2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34833
diff
changeset
|
3036 (push (setq data (copy-sequence data)) gnus-article-mime-handles) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3037 (mm-interactively-view-part data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3038 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3039 (defun gnus-mime-view-part-as-type-internal () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3040 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3041 (let* ((name (mail-content-type-get |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3042 (mm-handle-type (get-text-property (point) 'gnus-data)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3043 'name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3044 (def-type (and name (mm-default-file-encoding name)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3045 (and def-type (cons def-type 0)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3046 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3047 (defun gnus-mime-view-part-as-type (mime-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3048 "Choose a MIME media type, and view the part as such." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3049 (interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3050 (list (completing-read |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3051 "View as MIME type: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3052 (mapcar #'list (mailcap-mime-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3053 nil nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3054 (gnus-mime-view-part-as-type-internal)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3055 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3056 (let ((handle (get-text-property (point) 'gnus-data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3057 (gnus-mm-display-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3058 (mm-make-handle (mm-handle-buffer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3059 (cons mime-type (cdr (mm-handle-type handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3060 (mm-handle-encoding handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3061 (mm-handle-undisplayer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3062 (mm-handle-disposition handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3063 (mm-handle-description handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3064 (mm-handle-cache handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3065 (mm-handle-id handle))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3066 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3067 (defun gnus-mime-copy-part (&optional handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3068 "Put the the MIME part under point into a new buffer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3069 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3070 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3071 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) |
35453
26726eff41ca
2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34833
diff
changeset
|
3072 (contents (mm-get-part handle)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3073 (base (file-name-nondirectory |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3074 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3075 (mail-content-type-get (mm-handle-type handle) 'name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3076 (mail-content-type-get (mm-handle-type handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3077 'filename) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3078 "*decoded*"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3079 (buffer (generate-new-buffer base))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3080 (switch-to-buffer buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3081 (insert contents) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3082 ;; We do it this way to make `normal-mode' set the appropriate mode. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3083 (unwind-protect |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3084 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3085 (setq buffer-file-name (expand-file-name base)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3086 (normal-mode)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3087 (setq buffer-file-name nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3088 (goto-char (point-min)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3089 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3090 (defun gnus-mime-inline-part (&optional handle arg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3091 "Insert the MIME part under point into the current buffer." |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3092 (interactive (list nil current-prefix-arg)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3093 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3094 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3095 contents charset |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3096 (b (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3097 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3098 (if (mm-handle-undisplayer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3099 (mm-remove-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3100 (setq contents (mm-get-part handle)) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3101 (cond |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3102 ((not arg) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3103 (setq charset (or (mail-content-type-get |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3104 (mm-handle-type handle) 'charset) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3105 gnus-newsgroup-charset))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3106 ((numberp arg) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3107 (setq charset |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3108 (or (cdr (assq arg |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3109 gnus-summary-show-article-charset-alist)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3110 (read-coding-system "Charset: "))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3111 (forward-line 2) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3112 (mm-insert-inline handle |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3113 (if (and charset |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3114 (setq charset (mm-charset-to-coding-system |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3115 charset)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3116 (not (eq charset 'ascii))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3117 (mm-decode-coding-string contents charset) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3118 contents)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3119 (goto-char b)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3120 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3121 (defun gnus-mime-externalize-part (&optional handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3122 "View the MIME part under point with an external viewer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3123 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3124 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3125 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3126 (mm-user-display-methods nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3127 (mm-inlined-types nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3128 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3129 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3130 (save-excursion (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3131 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3132 (if (mm-handle-undisplayer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3133 (mm-remove-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3134 (mm-display-part handle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3135 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3136 (defun gnus-mime-internalize-part (&optional handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3137 "View the MIME part under point with an internal viewer. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3138 In no internal viewer is available, use an external viewer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3139 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3140 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3141 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3142 (mm-inlined-types '(".*")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3143 (mm-inline-large-images t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3144 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3145 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3146 (save-excursion (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3147 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3148 (if (mm-handle-undisplayer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3149 (mm-remove-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3150 (mm-display-part handle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3151 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3152 (defun gnus-mime-action-on-part (&optional action) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3153 "Do something with the MIME attachment at \(point\)." |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3154 (interactive |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3155 (list (completing-read "Action: " gnus-mime-action-alist))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3156 (gnus-article-check-buffer) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3157 (let ((action-pair (assoc action gnus-mime-action-alist))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3158 (if action-pair |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3159 (funcall (cdr action-pair))))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3160 |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3161 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3162 (defun gnus-article-part-wrapper (n function) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3163 (save-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3164 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3165 (when (> n (length gnus-article-mime-handle-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3166 (error "No such part")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3167 (gnus-article-goto-part n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3168 (let ((handle (cdr (assq n gnus-article-mime-handle-alist)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3169 (funcall function handle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3170 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3171 (defun gnus-article-pipe-part (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3172 "Pipe MIME part N, which is the numerical prefix." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3173 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3174 (gnus-article-part-wrapper n 'mm-pipe-part)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3175 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3176 (defun gnus-article-save-part (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3177 "Save MIME part N, which is the numerical prefix." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3178 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3179 (gnus-article-part-wrapper n 'mm-save-part)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3180 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3181 (defun gnus-article-interactively-view-part (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3182 "View MIME part N interactively, which is the numerical prefix." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3183 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3184 (gnus-article-part-wrapper n 'mm-interactively-view-part)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3185 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3186 (defun gnus-article-copy-part (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3187 "Copy MIME part N, which is the numerical prefix." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3188 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3189 (gnus-article-part-wrapper n 'gnus-mime-copy-part)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3190 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3191 (defun gnus-article-externalize-part (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3192 "View MIME part N externally, which is the numerical prefix." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3193 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3194 (gnus-article-part-wrapper n 'gnus-mime-externalize-part)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3195 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3196 (defun gnus-article-inline-part (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3197 "Inline MIME part N, which is the numerical prefix." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3198 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3199 (gnus-article-part-wrapper n 'gnus-mime-inline-part)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3200 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3201 (defun gnus-article-mime-match-handle-first (condition) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3202 (if condition |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3203 (let ((alist gnus-article-mime-handle-alist) ihandle n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3204 (while (setq ihandle (pop alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3205 (if (and (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3206 ((functionp condition) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3207 (funcall condition (cdr ihandle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3208 ((eq condition 'undisplayed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3209 (not (or (mm-handle-undisplayer (cdr ihandle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3210 (equal (mm-handle-media-type (cdr ihandle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3211 "multipart/alternative")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3212 ((eq condition 'undisplayed-alternative) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3213 (not (mm-handle-undisplayer (cdr ihandle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3214 (t t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3215 (gnus-article-goto-part (car ihandle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3216 (or (not n) (< (car ihandle) n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3217 (setq n (car ihandle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3218 (or n 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3219 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3220 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3221 (defun gnus-article-view-part (&optional n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3222 "View MIME part N, which is the numerical prefix." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3223 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3224 (save-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3225 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3226 (or (numberp n) (setq n (gnus-article-mime-match-handle-first |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3227 gnus-article-mime-match-handle-function))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3228 (when (> n (length gnus-article-mime-handle-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3229 (error "No such part")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3230 (let ((handle (cdr (assq n gnus-article-mime-handle-alist)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3231 (when (gnus-article-goto-part n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3232 (if (equal (car handle) "multipart/alternative") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3233 (gnus-article-press-button) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3234 (when (eq (gnus-mm-display-part handle) 'internal) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3235 (gnus-set-window-start))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3236 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3237 (defsubst gnus-article-mime-total-parts () |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3238 (if (bufferp (car gnus-article-mime-handles)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3239 1 ;; single part |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3240 (1- (length gnus-article-mime-handles)))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3241 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3242 (defun gnus-mm-display-part (handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3243 "Display HANDLE and fix MIME button." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3244 (let ((id (get-text-property (point) 'gnus-part)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3245 (point (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3246 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3247 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3248 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3249 (let ((window (selected-window)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3250 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3251 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3252 (save-excursion (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3253 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3254 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3255 (unwind-protect |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3256 (let ((win (get-buffer-window (current-buffer) t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3257 (beg (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3258 (when win |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3259 (select-window win)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3260 (goto-char point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3261 (forward-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3262 (if (mm-handle-displayed-p handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3263 ;; This will remove the part. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3264 (mm-display-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3265 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3266 (narrow-to-region (point) (1+ (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3267 (mm-display-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3268 ;; We narrow to the part itself and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3269 ;; then call the treatment functions. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3270 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3271 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3272 (narrow-to-region (point) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3273 (gnus-treat-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3274 nil id |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3275 (gnus-article-mime-total-parts) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3276 (mm-handle-media-type handle))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3277 (select-window window)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3278 (goto-char point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3279 (delete-region (gnus-point-at-bol) (progn (forward-line 1) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3280 (gnus-insert-mime-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3281 handle id (list (mm-handle-displayed-p handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3282 (goto-char point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3283 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3284 (defun gnus-article-goto-part (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3285 "Go to MIME part N." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3286 (let ((point (text-property-any (point-min) (point-max) 'gnus-part n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3287 (when point |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3288 (goto-char point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3289 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3290 (defun gnus-insert-mime-button (handle gnus-tmp-id &optional displayed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3291 (let ((gnus-tmp-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3292 (or (mail-content-type-get (mm-handle-type handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3293 'name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3294 (mail-content-type-get (mm-handle-disposition handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3295 'filename) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3296 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3297 (gnus-tmp-type (mm-handle-media-type handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3298 (gnus-tmp-description |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3299 (mail-decode-encoded-word-string (or (mm-handle-description handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3300 ""))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3301 (gnus-tmp-dots |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3302 (if (if displayed (car displayed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3303 (mm-handle-displayed-p handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3304 "" "...")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3305 (gnus-tmp-length (with-current-buffer (mm-handle-buffer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3306 (buffer-size))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3307 gnus-tmp-type-long b e) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3308 (when (string-match ".*/" gnus-tmp-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3309 (setq gnus-tmp-name (replace-match "" t t gnus-tmp-name))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3310 (setq gnus-tmp-type-long (concat gnus-tmp-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3311 (and (not (equal gnus-tmp-name "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3312 (concat "; " gnus-tmp-name)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3313 (or (equal gnus-tmp-description "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3314 (setq gnus-tmp-type-long (concat " --- " gnus-tmp-type-long))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3315 (unless (bolp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3316 (insert "\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3317 (setq b (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3318 (gnus-eval-format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3319 gnus-mime-button-line-format gnus-mime-button-line-format-alist |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3320 `(keymap ,gnus-mime-button-map |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3321 ;; Not for Emacs 21: fixme better. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3322 ;; local-map ,gnus-mime-button-map |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3323 gnus-callback gnus-mm-display-part |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3324 gnus-part ,gnus-tmp-id |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3325 article-type annotation |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3326 gnus-data ,handle)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3327 (setq e (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3328 (widget-convert-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3329 'link b e |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3330 :mime-handle handle |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3331 :action 'gnus-widget-press-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3332 :button-keymap gnus-mime-button-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3333 :help-echo |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3334 (lambda (widget/window &optional overlay pos) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3335 ;; Needed to properly clear the message due to a bug in |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3336 ;; wid-edit (XEmacs only). |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3337 (if (boundp 'help-echo-owns-message) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3338 (setq help-echo-owns-message t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3339 (format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3340 "%S: %s the MIME part; %S: more options" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3341 (aref gnus-mouse-2 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3342 ;; XEmacs will get a single widget arg; Emacs 21 will get |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3343 ;; window, overlay, position. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3344 (if (mm-handle-displayed-p |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3345 (if overlay |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3346 (with-current-buffer (gnus-overlay-buffer overlay) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3347 (widget-get (widget-at (gnus-overlay-start overlay)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3348 :mime-handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3349 (widget-get widget/window :mime-handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3350 "hide" "show") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3351 (aref gnus-down-mouse-3 0)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3352 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3353 (defun gnus-widget-press-button (elems el) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3354 (goto-char (widget-get elems :from)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3355 (gnus-article-press-button)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3356 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3357 (defvar gnus-displaying-mime nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3358 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3359 (defun gnus-display-mime (&optional ihandles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3360 "Display the MIME parts." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3361 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3362 (save-selected-window |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3363 (let ((window (get-buffer-window gnus-article-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3364 (point (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3365 (when window |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3366 (select-window window) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3367 ;; We have to do this since selecting the window |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3368 ;; may change the point. So we set the window point. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3369 (set-window-point window point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3370 (let* ((handles (or ihandles (mm-dissect-buffer) (mm-uu-dissect))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3371 buffer-read-only handle name type b e display) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3372 (when (and (not ihandles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3373 (not gnus-displaying-mime)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3374 ;; Top-level call; we clean up. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3375 (when gnus-article-mime-handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3376 (mm-destroy-parts gnus-article-mime-handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3377 (setq gnus-article-mime-handle-alist nil));; A trick. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3378 (setq gnus-article-mime-handles handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3379 ;; We allow users to glean info from the handles. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3380 (when gnus-article-mime-part-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3381 (gnus-mime-part-function handles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3382 (if (and handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3383 (or (not (stringp (car handles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3384 (cdr handles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3385 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3386 (when (and (not ihandles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3387 (not gnus-displaying-mime)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3388 ;; Clean up for mime parts. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3389 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3390 (delete-region (point) (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3391 (let ((gnus-displaying-mime t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3392 (gnus-mime-display-part handles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3393 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3394 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3395 (narrow-to-region (point) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3396 (gnus-treat-article nil 1 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3397 (widen))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3398 (unless ihandles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3399 ;; Highlight the headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3400 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3401 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3402 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3403 (narrow-to-region (point-min) (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3404 (gnus-treat-article 'head)))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3405 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3406 (defvar gnus-mime-display-multipart-as-mixed nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3407 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3408 (defun gnus-mime-display-part (handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3409 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3410 ;; Single part. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3411 ((not (stringp (car handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3412 (gnus-mime-display-single handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3413 ;; User-defined multipart |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3414 ((cdr (assoc (car handle) gnus-mime-multipart-functions)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3415 (funcall (cdr (assoc (car handle) gnus-mime-multipart-functions)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3416 handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3417 ;; multipart/alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3418 ((and (equal (car handle) "multipart/alternative") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3419 (not gnus-mime-display-multipart-as-mixed)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3420 (let ((id (1+ (length gnus-article-mime-handle-alist)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3421 (push (cons id handle) gnus-article-mime-handle-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3422 (gnus-mime-display-alternative (cdr handle) nil nil id))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3423 ;; multipart/related |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3424 ((and (equal (car handle) "multipart/related") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3425 (not gnus-mime-display-multipart-as-mixed)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3426 ;;;!!!We should find the start part, but we just default |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3427 ;;;!!!to the first part. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3428 (gnus-mime-display-part (cadr handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3429 ;; Other multiparts are handled like multipart/mixed. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3430 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3431 (gnus-mime-display-mixed (cdr handle))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3432 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3433 (defun gnus-mime-part-function (handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3434 (if (stringp (car handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3435 (mapcar 'gnus-mime-part-function (cdr handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3436 (funcall gnus-article-mime-part-function handles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3437 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3438 (defun gnus-mime-display-mixed (handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3439 (mapcar 'gnus-mime-display-part handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3440 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3441 (defun gnus-mime-display-single (handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3442 (let ((type (mm-handle-media-type handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3443 (ignored gnus-ignored-mime-types) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3444 (not-attachment t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3445 (move nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3446 display text) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3447 (catch 'ignored |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3448 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3449 (while ignored |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3450 (when (string-match (pop ignored) type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3451 (throw 'ignored nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3452 (if (and (setq not-attachment |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3453 (and (not (mm-inline-override-p handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3454 (or (not (mm-handle-disposition handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3455 (equal (car (mm-handle-disposition handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3456 "inline") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3457 (mm-attachment-override-p handle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3458 (mm-automatic-display-p handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3459 (or (mm-inlined-p handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3460 (mm-automatic-external-display-p type))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3461 (setq display t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3462 (when (equal (mm-handle-media-supertype handle) "text") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3463 (setq text t))) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3464 (let ((id (1+ (length gnus-article-mime-handle-alist))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3465 beg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3466 (push (cons id handle) gnus-article-mime-handle-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3467 (when (or (not display) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3468 (not (gnus-unbuttonized-mime-type-p type))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3469 ;(gnus-article-insert-newline) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3470 (gnus-insert-mime-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3471 handle id (list (or display (and not-attachment text)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3472 (gnus-article-insert-newline) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3473 ;(gnus-article-insert-newline) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3474 (setq move t)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3475 (setq beg (point)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3476 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3477 (display |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3478 (when move |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3479 (forward-line -2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3480 (setq beg (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3481 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3482 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3483 (save-excursion (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3484 (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3485 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3486 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3487 (mm-display-part handle t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3488 (goto-char (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3489 ((and text not-attachment) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3490 (when move |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3491 (forward-line -2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3492 (setq beg (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3493 (gnus-article-insert-newline) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3494 (mm-insert-inline handle (mm-get-part handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3495 (goto-char (point-max)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3496 ;; Do highlighting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3497 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3498 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3499 (narrow-to-region beg (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3500 (gnus-treat-article |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3501 nil id |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3502 (gnus-article-mime-total-parts) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3503 (mm-handle-media-type handle))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3504 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3505 (defun gnus-unbuttonized-mime-type-p (type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3506 "Say whether TYPE is to be unbuttonized." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3507 (unless gnus-inhibit-mime-unbuttonizing |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3508 (catch 'found |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3509 (let ((types gnus-unbuttonized-mime-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3510 (while types |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3511 (when (string-match (pop types) type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3512 (throw 'found t))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3513 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3514 (defun gnus-article-insert-newline () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3515 "Insert a newline, but mark it as undeletable." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3516 (gnus-put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3517 (point) (progn (insert "\n") (point)) 'gnus-undeletable t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3518 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3519 (defun gnus-mime-display-alternative (handles &optional preferred ibegend id) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3520 (let* ((preferred (or preferred (mm-preferred-alternative handles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3521 (ihandles handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3522 (point (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3523 handle buffer-read-only from props begend not-pref) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3524 (save-window-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3525 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3526 (when ibegend |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3527 (narrow-to-region (car ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3528 (or (cdr ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3529 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3530 (goto-char (car ibegend)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3531 (forward-line 2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3532 (point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3533 (delete-region (point-min) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3534 (mm-remove-parts handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3535 (setq begend (list (point-marker))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3536 ;; Do the toggle. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3537 (unless (setq not-pref (cadr (member preferred ihandles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3538 (setq not-pref (car ihandles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3539 (when (or ibegend |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3540 (not (gnus-unbuttonized-mime-type-p |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3541 "multipart/alternative"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3542 (gnus-add-text-properties |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3543 (setq from (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3544 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3545 (insert (format "%d. " id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3546 (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3547 `(gnus-callback |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3548 (lambda (handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3549 (unless ,(not ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3550 (setq gnus-article-mime-handle-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3551 ',gnus-article-mime-handle-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3552 (gnus-mime-display-alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3553 ',ihandles ',not-pref ',begend ,id)) |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3554 ;; Not for Emacs 21: fixme better. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3555 ;; local-map ,gnus-mime-button-map |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3556 ,gnus-mouse-face-prop ,gnus-article-mouse-face |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3557 face ,gnus-article-button-face |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3558 keymap ,gnus-mime-button-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3559 gnus-part ,id |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3560 gnus-data ,handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3561 (widget-convert-button 'link from (point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3562 :action 'gnus-widget-press-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3563 :button-keymap gnus-widget-button-keymap) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3564 ;; Do the handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3565 (while (setq handle (pop handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3566 (gnus-add-text-properties |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3567 (setq from (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3568 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3569 (insert (format "(%c) %-18s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3570 (if (equal handle preferred) ?* ? ) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3571 (mm-handle-media-type handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3572 (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3573 `(gnus-callback |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3574 (lambda (handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3575 (unless ,(not ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3576 (setq gnus-article-mime-handle-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3577 ',gnus-article-mime-handle-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3578 (gnus-mime-display-alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3579 ',ihandles ',handle ',begend ,id)) |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3580 ;; Not for Emacs 21: fixme better. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3581 ;; local-map ,gnus-mime-button-map |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3582 ,gnus-mouse-face-prop ,gnus-article-mouse-face |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3583 face ,gnus-article-button-face |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3584 keymap ,gnus-mime-button-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3585 gnus-part ,id |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3586 gnus-data ,handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3587 (widget-convert-button 'link from (point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3588 :action 'gnus-widget-press-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3589 :button-keymap gnus-widget-button-keymap) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3590 (insert " ")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3591 (insert "\n\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3592 (when preferred |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3593 (if (stringp (car preferred)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3594 (gnus-display-mime preferred) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3595 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3596 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3597 (save-excursion (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3598 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3599 (mm-display-part preferred) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3600 ;; Do highlighting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3601 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3602 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3603 (narrow-to-region (car begend) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3604 (gnus-treat-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3605 nil (length gnus-article-mime-handle-alist) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3606 (gnus-article-mime-total-parts) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3607 (mm-handle-media-type handle)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3608 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3609 (setcdr begend (point-marker))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3610 (when ibegend |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3611 (goto-char point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3612 |
17493 | 3613 (defun gnus-article-wash-status () |
3614 "Return a string which display status of article washing." | |
3615 (save-excursion | |
3616 (set-buffer gnus-article-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3617 (let ((cite (memq 'cite gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3618 (headers (memq 'headers gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3619 (boring (memq 'boring-headers gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3620 (pgp (memq 'pgp gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3621 (pem (memq 'pem gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3622 (signature (memq 'signature gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3623 (overstrike (memq 'overstrike gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3624 (emphasis (memq 'emphasis gnus-article-wash-types))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3625 (format "%c%c%c%c%c%c" |
17493 | 3626 (if cite ?c ? ) |
3627 (if (or headers boring) ?h ? ) | |
3628 (if (or pgp pem) ?p ? ) | |
3629 (if signature ?s ? ) | |
3630 (if overstrike ?o ? ) | |
3631 (if emphasis ?e ? ))))) | |
3632 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3633 (defalias 'gnus-article-hide-headers-if-wanted 'gnus-article-maybe-hide-headers) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3634 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3635 (defun gnus-article-maybe-hide-headers () |
17493 | 3636 "Hide unwanted headers if `gnus-have-all-headers' is nil. |
3637 Provided for backwards compatibility." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3638 (when (and (or (not (gnus-buffer-live-p gnus-summary-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3639 (not (save-excursion (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3640 gnus-have-all-headers))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3641 (not gnus-inhibit-hiding)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3642 (gnus-article-hide-headers))) |
17493 | 3643 |
3644 ;;; Article savers. | |
3645 | |
3646 (defun gnus-output-to-file (file-name) | |
3647 "Append the current article to a file named FILE-NAME." | |
3648 (let ((artbuf (current-buffer))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3649 (with-temp-buffer |
17493 | 3650 (insert-buffer-substring artbuf) |
3651 ;; Append newline at end of the buffer as separator, and then | |
3652 ;; save it to file. | |
3653 (goto-char (point-max)) | |
3654 (insert "\n") | |
38861
f8833aa83b5e
* gnus-art.el (gnus-output-to-file): Bind file-name-coding-system.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38413
diff
changeset
|
3655 (let ((file-name-coding-system nnmail-pathname-coding-system)) |
f8833aa83b5e
* gnus-art.el (gnus-output-to-file): Bind file-name-coding-system.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38413
diff
changeset
|
3656 (mm-append-to-file (point-min) (point-max) file-name)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3657 t))) |
17493 | 3658 |
3659 (defun gnus-narrow-to-page (&optional arg) | |
3660 "Narrow the article buffer to a page. | |
3661 If given a numerical ARG, move forward ARG pages." | |
3662 (interactive "P") | |
3663 (setq arg (if arg (prefix-numeric-value arg) 0)) | |
3664 (save-excursion | |
3665 (set-buffer gnus-article-buffer) | |
3666 (goto-char (point-min)) | |
3667 (widen) | |
3668 ;; Remove any old next/prev buttons. | |
3669 (when (gnus-visual-p 'page-marker) | |
3670 (let ((buffer-read-only nil)) | |
3671 (gnus-remove-text-with-property 'gnus-prev) | |
3672 (gnus-remove-text-with-property 'gnus-next))) | |
3673 (when | |
3674 (cond ((< arg 0) | |
3675 (re-search-backward page-delimiter nil 'move (1+ (abs arg)))) | |
3676 ((> arg 0) | |
3677 (re-search-forward page-delimiter nil 'move arg))) | |
3678 (goto-char (match-end 0))) | |
3679 (narrow-to-region | |
3680 (point) | |
3681 (if (re-search-forward page-delimiter nil 'move) | |
3682 (match-beginning 0) | |
3683 (point))) | |
3684 (when (and (gnus-visual-p 'page-marker) | |
3685 (not (= (point-min) 1))) | |
3686 (save-excursion | |
3687 (goto-char (point-min)) | |
3688 (gnus-insert-prev-page-button))) | |
3689 (when (and (gnus-visual-p 'page-marker) | |
3690 (< (+ (point-max) 2) (buffer-size))) | |
3691 (save-excursion | |
3692 (goto-char (point-max)) | |
3693 (gnus-insert-next-page-button))))) | |
3694 | |
3695 ;; Article mode commands | |
3696 | |
3697 (defun gnus-article-goto-next-page () | |
3698 "Show the next page of the article." | |
3699 (interactive) | |
3700 (when (gnus-article-next-page) | |
3701 (goto-char (point-min)) | |
3702 (gnus-article-read-summary-keys nil (gnus-character-to-event ?n)))) | |
3703 | |
3704 (defun gnus-article-goto-prev-page () | |
3705 "Show the next page of the article." | |
3706 (interactive) | |
3707 (if (bobp) (gnus-article-read-summary-keys nil (gnus-character-to-event ?p)) | |
3708 (gnus-article-prev-page nil))) | |
3709 | |
3710 (defun gnus-article-next-page (&optional lines) | |
3711 "Show the next page of the current article. | |
3712 If end of article, return non-nil. Otherwise return nil. | |
3713 Argument LINES specifies lines to be scrolled up." | |
3714 (interactive "p") | |
3715 (move-to-window-line -1) | |
3716 (if (save-excursion | |
3717 (end-of-line) | |
3718 (and (pos-visible-in-window-p) ;Not continuation line. | |
3719 (eobp))) | |
3720 ;; Nothing in this page. | |
3721 (if (or (not gnus-page-broken) | |
3722 (save-excursion | |
3723 (save-restriction | |
3724 (widen) (forward-line 1) (eobp)))) ;Real end-of-buffer? | |
3725 t ;Nothing more. | |
3726 (gnus-narrow-to-page 1) ;Go to next page. | |
3727 nil) | |
3728 ;; More in this page. | |
3729 (let ((scroll-in-place nil)) | |
3730 (condition-case () | |
3731 (scroll-up lines) | |
3732 (end-of-buffer | |
3733 ;; Long lines may cause an end-of-buffer error. | |
3734 (goto-char (point-max))))) | |
3735 (move-to-window-line 0) | |
3736 nil)) | |
3737 | |
3738 (defun gnus-article-prev-page (&optional lines) | |
3739 "Show previous page of current article. | |
3740 Argument LINES specifies lines to be scrolled down." | |
3741 (interactive "p") | |
3742 (move-to-window-line 0) | |
3743 (if (and gnus-page-broken | |
3744 (bobp) | |
3745 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer? | |
3746 (progn | |
3747 (gnus-narrow-to-page -1) ;Go to previous page. | |
3748 (goto-char (point-max)) | |
3749 (recenter -1)) | |
3750 (let ((scroll-in-place nil)) | |
3751 (prog1 | |
3752 (condition-case () | |
3753 (scroll-down lines) | |
3754 (beginning-of-buffer | |
3755 (goto-char (point-min)))) | |
3756 (move-to-window-line 0))))) | |
3757 | |
3758 (defun gnus-article-refer-article () | |
3759 "Read article specified by message-id around point." | |
3760 (interactive) | |
3761 (let ((point (point))) | |
3762 (search-forward ">" nil t) ;Move point to end of "<....>". | |
3763 (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t) | |
3764 (let ((message-id (match-string 1))) | |
3765 (goto-char point) | |
3766 (set-buffer gnus-summary-buffer) | |
3767 (gnus-summary-refer-article message-id)) | |
3768 (goto-char (point)) | |
3769 (error "No references around point")))) | |
3770 | |
3771 (defun gnus-article-show-summary () | |
3772 "Reconfigure windows to show summary buffer." | |
3773 (interactive) | |
3774 (if (not (gnus-buffer-live-p gnus-summary-buffer)) | |
3775 (error "There is no summary buffer for this article buffer") | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3776 (gnus-article-set-globals) |
17493 | 3777 (gnus-configure-windows 'article) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3778 (gnus-summary-goto-subject gnus-current-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3779 (gnus-summary-position-point))) |
17493 | 3780 |
3781 (defun gnus-article-describe-briefly () | |
3782 "Describe article mode commands briefly." | |
3783 (interactive) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3784 (gnus-message 6 (substitute-command-keys "\\<gnus-article-mode-map>\\[gnus-article-goto-next-page]:Next page \\[gnus-article-goto-prev-page]:Prev page \\[gnus-article-show-summary]:Show summary \\[gnus-info-find-node]:Run Info \\[gnus-article-describe-briefly]:This help"))) |
17493 | 3785 |
3786 (defun gnus-article-summary-command () | |
3787 "Execute the last keystroke in the summary buffer." | |
3788 (interactive) | |
3789 (let ((obuf (current-buffer)) | |
3790 (owin (current-window-configuration)) | |
3791 func) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3792 (switch-to-buffer gnus-article-current-summary 'norecord) |
17493 | 3793 (setq func (lookup-key (current-local-map) (this-command-keys))) |
3794 (call-interactively func) | |
3795 (set-buffer obuf) | |
3796 (set-window-configuration owin) | |
3797 (set-window-point (get-buffer-window (current-buffer)) (point)))) | |
3798 | |
3799 (defun gnus-article-summary-command-nosave () | |
3800 "Execute the last keystroke in the summary buffer." | |
3801 (interactive) | |
3802 (let (func) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3803 (pop-to-buffer gnus-article-current-summary 'norecord) |
17493 | 3804 (setq func (lookup-key (current-local-map) (this-command-keys))) |
3805 (call-interactively func))) | |
3806 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3807 (defun gnus-article-check-buffer () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3808 "Beep if not in an article buffer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3809 (unless (equal major-mode 'gnus-article-mode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3810 (error "Command invoked outside of a Gnus article buffer"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3811 |
17493 | 3812 (defun gnus-article-read-summary-keys (&optional arg key not-restore-window) |
3813 "Read a summary buffer key sequence and execute it from the article buffer." | |
3814 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3815 (gnus-article-check-buffer) |
17493 | 3816 (let ((nosaves |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3817 '("q" "Q" "c" "r" "R" "\C-c\C-f" "m" "a" "f" "F" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3818 "Zc" "ZC" "ZE" "ZQ" "ZZ" "Zn" "ZR" "ZG" "ZN" "ZP" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3819 "=" "^" "\M-^" "|")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3820 (nosave-but-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3821 '("A\r")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3822 (nosave-in-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3823 '("\C-d")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3824 (up-to-top |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3825 '("n" "Gn" "p" "Gp")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3826 keys new-sum-point) |
17493 | 3827 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3828 (set-buffer gnus-article-current-summary) |
17493 | 3829 (let (gnus-pick-mode) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3830 (push (or key last-command-event) unread-command-events) |
32939
c8119677d63e
Use (featurep 'xemacs) instead of the `gnus-xemacs' variable, as the
Miles Bader <miles@gnu.org>
parents:
32927
diff
changeset
|
3831 (setq keys (if (featurep 'xemacs) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3832 (events-to-keys (read-key-sequence nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3833 (read-key-sequence nil))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3834 |
17493 | 3835 (message "") |
3836 | |
3837 (if (or (member keys nosaves) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3838 (member keys nosave-but-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3839 (member keys nosave-in-article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3840 (let (func) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3841 (save-window-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3842 (pop-to-buffer gnus-article-current-summary 'norecord) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3843 ;; We disable the pick minor mode commands. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3844 (let (gnus-pick-mode) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3845 (setq func (lookup-key (current-local-map) keys)))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3846 (if (or (not func) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3847 (numberp func)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3848 (ding) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3849 (unless (member keys nosave-in-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3850 (set-buffer gnus-article-current-summary)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3851 (call-interactively func) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3852 (setq new-sum-point (point))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3853 (when (member keys nosave-but-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3854 (pop-to-buffer gnus-article-buffer 'norecord))) |
17493 | 3855 ;; These commands should restore window configuration. |
3856 (let ((obuf (current-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3857 (owin (current-window-configuration)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3858 (opoint (point)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3859 (summary gnus-article-current-summary) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3860 func in-buffer selected) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3861 (if not-restore-window |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3862 (pop-to-buffer summary 'norecord) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3863 (switch-to-buffer summary 'norecord)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3864 (setq in-buffer (current-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3865 ;; We disable the pick minor mode commands. |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3866 (if (and (setq func (let (gnus-pick-mode) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3867 (lookup-key (current-local-map) keys))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3868 (functionp func)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3869 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3870 (call-interactively func) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3871 (setq new-sum-point (point)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3872 (when (eq in-buffer (current-buffer)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3873 (setq selected (gnus-summary-select-article)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3874 (set-buffer obuf) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3875 (unless not-restore-window |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3876 (set-window-configuration owin)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3877 (when (eq selected 'old) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3878 (article-goto-body) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3879 (set-window-start (get-buffer-window (current-buffer)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3880 1) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3881 (set-window-point (get-buffer-window (current-buffer)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3882 (point))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3883 (let ((win (get-buffer-window gnus-article-current-summary))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3884 (when win |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3885 (set-window-point win new-sum-point)))) ) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3886 (switch-to-buffer gnus-article-buffer) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3887 (ding)))))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3888 |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3889 (defun gnus-article-describe-key (key) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3890 "Display documentation of the function invoked by KEY. KEY is a string." |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3891 (interactive "kDescribe key: ") |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3892 (gnus-article-check-buffer) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3893 (if (eq (key-binding key) 'gnus-article-read-summary-keys) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3894 (save-excursion |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3895 (set-buffer gnus-article-current-summary) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3896 (let (gnus-pick-mode) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3897 (push (elt key 0) unread-command-events) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3898 (setq key (if (featurep 'xemacs) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3899 (events-to-keys (read-key-sequence "Describe key: ")) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3900 (read-key-sequence "Describe key: ")))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3901 (describe-key key)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3902 (describe-key key))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3903 |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3904 (defun gnus-article-describe-key-briefly (key &optional insert) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3905 "Display documentation of the function invoked by KEY. KEY is a string." |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3906 (interactive "kDescribe key: \nP") |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3907 (gnus-article-check-buffer) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3908 (if (eq (key-binding key) 'gnus-article-read-summary-keys) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3909 (save-excursion |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3910 (set-buffer gnus-article-current-summary) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3911 (let (gnus-pick-mode) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3912 (push (elt key 0) unread-command-events) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3913 (setq key (if (featurep 'xemacs) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3914 (events-to-keys (read-key-sequence "Describe key: ")) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3915 (read-key-sequence "Describe key: ")))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3916 (describe-key-briefly key insert)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3917 (describe-key-briefly key insert))) |
17493 | 3918 |
3919 (defun gnus-article-hide (&optional arg force) | |
3920 "Hide all the gruft in the current article. | |
3921 This means that PGP stuff, signatures, cited text and (some) | |
3922 headers will be hidden. | |
3923 If given a prefix, show the hidden text instead." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3924 (interactive (append (gnus-article-hidden-arg) (list 'force))) |
17493 | 3925 (gnus-article-hide-headers arg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3926 (gnus-article-hide-list-identifiers arg) |
17493 | 3927 (gnus-article-hide-pgp arg) |
3928 (gnus-article-hide-citation-maybe arg force) | |
3929 (gnus-article-hide-signature arg)) | |
3930 | |
3931 (defun gnus-article-maybe-highlight () | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3932 "Do some article highlighting if article highlighting is requested." |
17493 | 3933 (when (gnus-visual-p 'article-highlight 'highlight) |
3934 (gnus-article-highlight-some))) | |
3935 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3936 (defun gnus-check-group-server () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3937 ;; Make sure the connection to the server is alive. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3938 (unless (gnus-server-opened |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3939 (gnus-find-method-for-group gnus-newsgroup-name)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3940 (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3941 (gnus-request-group gnus-newsgroup-name t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3942 |
17493 | 3943 (defun gnus-request-article-this-buffer (article group) |
3944 "Get an article and insert it into this buffer." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3945 (let (do-update-line sparse-header) |
17493 | 3946 (prog1 |
3947 (save-excursion | |
3948 (erase-buffer) | |
3949 (gnus-kill-all-overlays) | |
3950 (setq group (or group gnus-newsgroup-name)) | |
3951 | |
3952 ;; Using `gnus-request-article' directly will insert the article into | |
3953 ;; `nntp-server-buffer' - so we'll save some time by not having to | |
3954 ;; copy it from the server buffer into the article buffer. | |
3955 | |
3956 ;; We only request an article by message-id when we do not have the | |
3957 ;; headers for it, so we'll have to get those. | |
3958 (when (stringp article) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3959 (gnus-read-header article)) |
17493 | 3960 |
3961 ;; If the article number is negative, that means that this article | |
3962 ;; doesn't belong in this newsgroup (possibly), so we find its | |
3963 ;; message-id and request it by id instead of number. | |
3964 (when (and (numberp article) | |
3965 gnus-summary-buffer | |
3966 (get-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3967 (gnus-buffer-exists-p gnus-summary-buffer)) |
17493 | 3968 (save-excursion |
3969 (set-buffer gnus-summary-buffer) | |
3970 (let ((header (gnus-summary-article-header article))) | |
3971 (when (< article 0) | |
3972 (cond | |
3973 ((memq article gnus-newsgroup-sparse) | |
3974 ;; This is a sparse gap article. | |
3975 (setq do-update-line article) | |
3976 (setq article (mail-header-id header)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3977 (setq sparse-header (gnus-read-header article)) |
17493 | 3978 (setq gnus-newsgroup-sparse |
3979 (delq article gnus-newsgroup-sparse))) | |
3980 ((vectorp header) | |
3981 ;; It's a real article. | |
3982 (setq article (mail-header-id header))) | |
3983 (t | |
3984 ;; It is an extracted pseudo-article. | |
3985 (setq article 'pseudo) | |
3986 (gnus-request-pseudo-article header)))) | |
3987 | |
3988 (let ((method (gnus-find-method-for-group | |
3989 gnus-newsgroup-name))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3990 (when (and (eq (car method) 'nneething) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3991 (vectorp header)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3992 (let ((dir (expand-file-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3993 (mail-header-subject header) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3994 (file-name-as-directory |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3995 (or (cadr (assq 'nneething-address method)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3996 (nth 1 method)))))) |
17493 | 3997 (when (file-directory-p dir) |
3998 (setq article 'nneething) | |
3999 (gnus-group-enter-directory dir)))))))) | |
4000 | |
4001 (cond | |
4002 ;; Refuse to select canceled articles. | |
4003 ((and (numberp article) | |
4004 gnus-summary-buffer | |
4005 (get-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4006 (gnus-buffer-exists-p gnus-summary-buffer) |
17493 | 4007 (eq (cdr (save-excursion |
4008 (set-buffer gnus-summary-buffer) | |
4009 (assq article gnus-newsgroup-reads))) | |
4010 gnus-canceled-mark)) | |
4011 nil) | |
4012 ;; We first check `gnus-original-article-buffer'. | |
4013 ((and (get-buffer gnus-original-article-buffer) | |
4014 (numberp article) | |
4015 (save-excursion | |
4016 (set-buffer gnus-original-article-buffer) | |
4017 (and (equal (car gnus-original-article) group) | |
4018 (eq (cdr gnus-original-article) article)))) | |
4019 (insert-buffer-substring gnus-original-article-buffer) | |
4020 'article) | |
4021 ;; Check the backlog. | |
4022 ((and gnus-keep-backlog | |
4023 (gnus-backlog-request-article group article (current-buffer))) | |
4024 'article) | |
4025 ;; Check asynchronous pre-fetch. | |
4026 ((gnus-async-request-fetched-article group article (current-buffer)) | |
4027 (gnus-async-prefetch-next group article gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4028 (when (and (numberp article) gnus-keep-backlog) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4029 (gnus-backlog-enter-article group article (current-buffer))) |
17493 | 4030 'article) |
4031 ;; Check the cache. | |
4032 ((and gnus-use-cache | |
4033 (numberp article) | |
4034 (gnus-cache-request-article article group)) | |
4035 'article) | |
4036 ;; Get the article and put into the article buffer. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4037 ((or (stringp article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4038 (numberp article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4039 (let ((gnus-override-method gnus-override-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4040 (methods (and (stringp article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4041 gnus-refer-article-method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4042 result |
17493 | 4043 (buffer-read-only nil)) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4044 (if (or (not (listp methods)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4045 (and (symbolp (car methods)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4046 (assq (car methods) nnoo-definition-alist))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4047 (setq methods (list methods))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4048 (when (and (null gnus-override-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4049 methods) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4050 (setq gnus-override-method (pop methods))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4051 (while (not result) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4052 (when (eq gnus-override-method 'current) |
39335
65ef5b3fc045
(gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents:
38861
diff
changeset
|
4053 (setq gnus-override-method |
65ef5b3fc045
(gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents:
38861
diff
changeset
|
4054 (with-current-buffer gnus-summary-buffer |
65ef5b3fc045
(gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents:
38861
diff
changeset
|
4055 gnus-current-select-method))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4056 (erase-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4057 (gnus-kill-all-overlays) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4058 (let ((gnus-newsgroup-name group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4059 (gnus-check-group-server)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4060 (when (gnus-request-article article group (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4061 (when (numberp article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4062 (gnus-async-prefetch-next group article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4063 gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4064 (when gnus-keep-backlog |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4065 (gnus-backlog-enter-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4066 group article (current-buffer)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4067 (setq result 'article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4068 (if (not result) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4069 (if methods |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4070 (setq gnus-override-method (pop methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4071 (setq result 'done)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4072 (and (eq result 'article) 'article))) |
17493 | 4073 ;; It was a pseudo. |
4074 (t article))) | |
4075 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4076 ;; Associate this article with the current summary buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4077 (setq gnus-article-current-summary gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4078 |
17493 | 4079 ;; Take the article from the original article buffer |
4080 ;; and place it in the buffer it's supposed to be in. | |
4081 (when (and (get-buffer gnus-article-buffer) | |
4082 (equal (buffer-name (current-buffer)) | |
4083 (buffer-name (get-buffer gnus-article-buffer)))) | |
4084 (save-excursion | |
4085 (if (get-buffer gnus-original-article-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4086 (set-buffer gnus-original-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4087 (set-buffer (gnus-get-buffer-create gnus-original-article-buffer)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4088 (buffer-disable-undo) |
17493 | 4089 (setq major-mode 'gnus-original-article-mode) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4090 (setq buffer-read-only t)) |
17493 | 4091 (let (buffer-read-only) |
4092 (erase-buffer) | |
4093 (insert-buffer-substring gnus-article-buffer)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4094 (setq gnus-original-article (cons group article))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4095 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4096 ;; Decode charsets. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4097 (run-hooks 'gnus-article-decode-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4098 ;; Mark article as decoded or not. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4099 (setq gnus-article-decoded-p gnus-article-decode-hook)) |
17493 | 4100 |
4101 ;; Update sparse articles. | |
4102 (when (and do-update-line | |
4103 (or (numberp article) | |
4104 (stringp article))) | |
4105 (let ((buf (current-buffer))) | |
4106 (set-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4107 (gnus-summary-update-article do-update-line sparse-header) |
17493 | 4108 (gnus-summary-goto-subject do-update-line nil t) |
4109 (set-window-point (get-buffer-window (current-buffer) t) | |
4110 (point)) | |
4111 (set-buffer buf)))))) | |
4112 | |
4113 ;;; | |
4114 ;;; Article editing | |
4115 ;;; | |
4116 | |
4117 (defcustom gnus-article-edit-mode-hook nil | |
4118 "Hook run in article edit mode buffers." | |
4119 :group 'gnus-article-various | |
4120 :type 'hook) | |
4121 | |
4122 (defvar gnus-article-edit-done-function nil) | |
4123 | |
4124 (defvar gnus-article-edit-mode-map nil) | |
4125 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4126 ;; Should we be using derived.el for this? |
17493 | 4127 (unless gnus-article-edit-mode-map |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4128 (setq gnus-article-edit-mode-map (make-sparse-keymap)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4129 (set-keymap-parent gnus-article-edit-mode-map text-mode-map) |
17493 | 4130 |
4131 (gnus-define-keys gnus-article-edit-mode-map | |
4132 "\C-c\C-c" gnus-article-edit-done | |
4133 "\C-c\C-k" gnus-article-edit-exit) | |
4134 | |
4135 (gnus-define-keys (gnus-article-edit-wash-map | |
4136 "\C-c\C-w" gnus-article-edit-mode-map) | |
4137 "f" gnus-article-edit-full-stops)) | |
4138 | |
4139 (defun gnus-article-edit-mode () | |
4140 "Major mode for editing articles. | |
4141 This is an extended text-mode. | |
4142 | |
4143 \\{gnus-article-edit-mode-map}" | |
4144 (interactive) | |
4145 (setq major-mode 'gnus-article-edit-mode) | |
4146 (setq mode-name "Article Edit") | |
4147 (use-local-map gnus-article-edit-mode-map) | |
4148 (make-local-variable 'gnus-article-edit-done-function) | |
4149 (make-local-variable 'gnus-prev-winconf) | |
4150 (setq buffer-read-only nil) | |
4151 (buffer-enable-undo) | |
4152 (widen) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4153 (gnus-run-hooks 'text-mode-hook 'gnus-article-edit-mode-hook)) |
17493 | 4154 |
4155 (defun gnus-article-edit (&optional force) | |
4156 "Edit the current article. | |
4157 This will have permanent effect only in mail groups. | |
4158 If FORCE is non-nil, allow editing of articles even in read-only | |
4159 groups." | |
4160 (interactive "P") | |
4161 (when (and (not force) | |
4162 (gnus-group-read-only-p)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4163 (error "The current newsgroup does not support article editing")) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4164 (gnus-article-date-original) |
17493 | 4165 (gnus-article-edit-article |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4166 'ignore |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4167 `(lambda (no-highlight) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4168 'ignore |
17493 | 4169 (gnus-summary-edit-article-done |
4170 ,(or (mail-header-references gnus-current-headers) "") | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4171 ,(gnus-group-read-only-p) ,gnus-summary-buffer no-highlight)))) |
17493 | 4172 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4173 (defun gnus-article-edit-article (start-func exit-func) |
17493 | 4174 "Start editing the contents of the current article buffer." |
4175 (let ((winconf (current-window-configuration))) | |
4176 (set-buffer gnus-article-buffer) | |
4177 (gnus-article-edit-mode) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4178 (funcall start-func) |
17493 | 4179 (gnus-configure-windows 'edit-article) |
4180 (setq gnus-article-edit-done-function exit-func) | |
4181 (setq gnus-prev-winconf winconf) | |
4182 (gnus-message 6 "C-c C-c to end edits"))) | |
4183 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4184 (defun gnus-article-edit-done (&optional arg) |
17493 | 4185 "Update the article edits and exit." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4186 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4187 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4188 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4189 (widen) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4190 (when (article-goto-body) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4191 (let ((lines (count-lines (point) (point-max))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4192 (length (- (point-max) (point))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4193 (case-fold-search t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4194 (body (copy-marker (point)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4195 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4196 (when (re-search-forward "^content-length:[ \t]\\([0-9]+\\)" body t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4197 (delete-region (match-beginning 1) (match-end 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4198 (insert (number-to-string length))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4199 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4200 (when (re-search-forward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4201 "^x-content-length:[ \t]\\([0-9]+\\)" body t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4202 (delete-region (match-beginning 1) (match-end 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4203 (insert (number-to-string length))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4204 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4205 (when (re-search-forward "^lines:[ \t]\\([0-9]+\\)" body t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4206 (delete-region (match-beginning 1) (match-end 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4207 (insert (number-to-string lines))))))) |
17493 | 4208 (let ((func gnus-article-edit-done-function) |
4209 (buf (current-buffer)) | |
4210 (start (window-start))) | |
4211 (gnus-article-edit-exit) | |
4212 (save-excursion | |
4213 (set-buffer buf) | |
4214 (let ((buffer-read-only nil)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4215 (funcall func arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4216 ;; The cache and backlog have to be flushed somewhat. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4217 (when gnus-keep-backlog |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4218 (gnus-backlog-remove-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4219 (car gnus-article-current) (cdr gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4220 ;; Flush original article as well. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4221 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4222 (when (get-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4223 (set-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4224 (setq gnus-original-article nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4225 (when gnus-use-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4226 (gnus-cache-update-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4227 (car gnus-article-current) (cdr gnus-article-current)))) |
17493 | 4228 (set-buffer buf) |
4229 (set-window-start (get-buffer-window buf) start) | |
4230 (set-window-point (get-buffer-window buf) (point)))) | |
4231 | |
4232 (defun gnus-article-edit-exit () | |
4233 "Exit the article editing without updating." | |
4234 (interactive) | |
4235 ;; We remove all text props from the article buffer. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4236 (let ((buf (buffer-substring-no-properties (point-min) (point-max))) |
17493 | 4237 (curbuf (current-buffer)) |
4238 (p (point)) | |
4239 (window-start (window-start))) | |
4240 (erase-buffer) | |
4241 (insert buf) | |
4242 (let ((winconf gnus-prev-winconf)) | |
4243 (gnus-article-mode) | |
4244 (set-window-configuration winconf) | |
4245 ;; Tippy-toe some to make sure that point remains where it was. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4246 (save-current-buffer |
17493 | 4247 (set-buffer curbuf) |
4248 (set-window-start (get-buffer-window (current-buffer)) window-start) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4249 (goto-char p))))) |
17493 | 4250 |
4251 (defun gnus-article-edit-full-stops () | |
4252 "Interactively repair spacing at end of sentences." | |
4253 (interactive) | |
4254 (save-excursion | |
4255 (goto-char (point-min)) | |
4256 (search-forward-regexp "^$" nil t) | |
4257 (let ((case-fold-search nil)) | |
4258 (query-replace-regexp "\\([.!?][])}]* \\)\\([[({A-Z]\\)" "\\1 \\2")))) | |
4259 | |
4260 ;;; | |
4261 ;;; Article highlights | |
4262 ;;; | |
4263 | |
4264 ;; Written by Per Abrahamsen <abraham@iesd.auc.dk>. | |
4265 | |
4266 ;;; Internal Variables: | |
4267 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4268 (defcustom gnus-button-url-regexp "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\)\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?\\([-a-zA-Z0-9_=!?#$@~`%&*+|\\/:;.,]\\|\\w\\)+\\([-a-zA-Z0-9_=#$@~`%&*+|\\/]\\|\\w\\)\\)" |
17493 | 4269 "Regular expression that matches URLs." |
4270 :group 'gnus-article-buttons | |
4271 :type 'regexp) | |
4272 | |
4273 (defcustom gnus-button-alist | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4274 `(("<\\(url:[>\n\t ]*?\\)?news:[>\n\t ]*\\([^>\n\t ]*@[^>\n\t ]*\\)>" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4275 0 t gnus-button-message-id 2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4276 ("\\bnews:\\([^>\n\t ]*@[^>)!;:,\n\t ]*\\)" 0 t gnus-button-message-id 1) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4277 ("\\(\\b<\\(url:[>\n\t ]*\\)?news:[>\n\t ]*\\(//\\)?\\([^>\n\t ]*\\)>\\)" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4278 1 t |
17493 | 4279 gnus-button-fetch-group 4) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4280 ("\\bnews:\\(//\\)?\\([^'\">\n\t ]+\\)" 0 t gnus-button-fetch-group 2) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4281 ("\\bin\\( +article\\| +message\\)? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)" 2 |
17493 | 4282 t gnus-button-message-id 3) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4283 ("\\(<URL: *\\)mailto: *\\([^> \n\t]+\\)>" 0 t gnus-url-mailto 2) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4284 ("mailto:\\([-a-zA-Z.@_+0-9%]+\\)" 0 t gnus-url-mailto 1) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4285 ("\\bmailto:\\([^ \n\t]+\\)" 0 t gnus-url-mailto 1) |
17493 | 4286 ;; This is how URLs _should_ be embedded in text... |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4287 ("<URL: *\\([^<>]*\\)>" 0 t gnus-button-embedded-url 1) |
17493 | 4288 ;; Raw URLs. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4289 (,gnus-button-url-regexp 0 t browse-url 0)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4290 "*Alist of regexps matching buttons in article bodies. |
17493 | 4291 |
4292 Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where | |
4293 REGEXP: is the string matching text around the button, | |
4294 BUTTON: is the number of the regexp grouping actually matching the button, | |
4295 FORM: is a lisp expression which must eval to true for the button to | |
4296 be added, | |
4297 CALLBACK: is the function to call when the user push this button, and each | |
4298 PAR: is a number of a regexp grouping whose text will be passed to CALLBACK. | |
4299 | |
4300 CALLBACK can also be a variable, in that case the value of that | |
4301 variable it the real callback function." | |
4302 :group 'gnus-article-buttons | |
4303 :type '(repeat (list regexp | |
4304 (integer :tag "Button") | |
4305 (sexp :tag "Form") | |
4306 (function :tag "Callback") | |
4307 (repeat :tag "Par" | |
4308 :inline t | |
4309 (integer :tag "Regexp group"))))) | |
4310 | |
4311 (defcustom gnus-header-button-alist | |
4312 `(("^\\(References\\|Message-I[Dd]\\):" "<[^>]+>" | |
4313 0 t gnus-button-message-id 0) | |
4314 ("^\\(From\\|Reply-To\\):" ": *\\(.+\\)$" 1 t gnus-button-reply 1) | |
4315 ("^\\(Cc\\|To\\):" "[^ \t\n<>,()\"]+@[^ \t\n<>,()\"]+" | |
4316 0 t gnus-button-mailto 0) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4317 ("^X-[Uu][Rr][Ll]:" ,gnus-button-url-regexp 0 t browse-url 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4318 ("^Subject:" ,gnus-button-url-regexp 0 t browse-url 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4319 ("^[^:]+:" ,gnus-button-url-regexp 0 t browse-url 0) |
17493 | 4320 ("^[^:]+:" "\\(<\\(url: \\)?news:\\([^>\n ]*\\)>\\)" 1 t |
4321 gnus-button-message-id 3)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4322 "*Alist of headers and regexps to match buttons in article heads. |
17493 | 4323 |
4324 This alist is very similar to `gnus-button-alist', except that each | |
4325 alist has an additional HEADER element first in each entry: | |
4326 | |
4327 \(HEADER REGEXP BUTTON FORM CALLBACK PAR) | |
4328 | |
4329 HEADER is a regexp to match a header. For a fuller explanation, see | |
4330 `gnus-button-alist'." | |
4331 :group 'gnus-article-buttons | |
4332 :group 'gnus-article-headers | |
4333 :type '(repeat (list (regexp :tag "Header") | |
4334 regexp | |
4335 (integer :tag "Button") | |
4336 (sexp :tag "Form") | |
4337 (function :tag "Callback") | |
4338 (repeat :tag "Par" | |
4339 :inline t | |
4340 (integer :tag "Regexp group"))))) | |
4341 | |
4342 (defvar gnus-button-regexp nil) | |
4343 (defvar gnus-button-marker-list nil) | |
4344 ;; Regexp matching any of the regexps from `gnus-button-alist'. | |
4345 | |
4346 (defvar gnus-button-last nil) | |
4347 ;; The value of `gnus-button-alist' when `gnus-button-regexp' was build. | |
4348 | |
4349 ;;; Commands: | |
4350 | |
4351 (defun gnus-article-push-button (event) | |
4352 "Check text under the mouse pointer for a callback function. | |
4353 If the text under the mouse pointer has a `gnus-callback' property, | |
4354 call it with the value of the `gnus-data' text property." | |
4355 (interactive "e") | |
4356 (set-buffer (window-buffer (posn-window (event-start event)))) | |
4357 (let* ((pos (posn-point (event-start event))) | |
4358 (data (get-text-property pos 'gnus-data)) | |
4359 (fun (get-text-property pos 'gnus-callback))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4360 (goto-char pos) |
17493 | 4361 (when fun |
4362 (funcall fun data)))) | |
4363 | |
4364 (defun gnus-article-press-button () | |
4365 "Check text at point for a callback function. | |
4366 If the text at point has a `gnus-callback' property, | |
4367 call it with the value of the `gnus-data' text property." | |
4368 (interactive) | |
4369 (let* ((data (get-text-property (point) 'gnus-data)) | |
4370 (fun (get-text-property (point) 'gnus-callback))) | |
4371 (when fun | |
4372 (funcall fun data)))) | |
4373 | |
4374 (defun gnus-article-highlight (&optional force) | |
4375 "Highlight current article. | |
4376 This function calls `gnus-article-highlight-headers', | |
4377 `gnus-article-highlight-citation', | |
4378 `gnus-article-highlight-signature', and `gnus-article-add-buttons' to | |
4379 do the highlighting. See the documentation for those functions." | |
4380 (interactive (list 'force)) | |
4381 (gnus-article-highlight-headers) | |
4382 (gnus-article-highlight-citation force) | |
4383 (gnus-article-highlight-signature) | |
4384 (gnus-article-add-buttons force) | |
4385 (gnus-article-add-buttons-to-head)) | |
4386 | |
4387 (defun gnus-article-highlight-some (&optional force) | |
4388 "Highlight current article. | |
4389 This function calls `gnus-article-highlight-headers', | |
4390 `gnus-article-highlight-signature', and `gnus-article-add-buttons' to | |
4391 do the highlighting. See the documentation for those functions." | |
4392 (interactive (list 'force)) | |
4393 (gnus-article-highlight-headers) | |
4394 (gnus-article-highlight-signature) | |
4395 (gnus-article-add-buttons)) | |
4396 | |
4397 (defun gnus-article-highlight-headers () | |
4398 "Highlight article headers as specified by `gnus-header-face-alist'." | |
4399 (interactive) | |
4400 (save-excursion | |
4401 (set-buffer gnus-article-buffer) | |
4402 (save-restriction | |
4403 (let ((alist gnus-header-face-alist) | |
4404 (buffer-read-only nil) | |
4405 (case-fold-search t) | |
4406 (inhibit-point-motion-hooks t) | |
4407 entry regexp header-face field-face from hpoints fpoints) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4408 (article-narrow-to-head) |
17493 | 4409 (while (setq entry (pop alist)) |
4410 (goto-char (point-min)) | |
4411 (setq regexp (concat "^\\(" | |
4412 (if (string-equal "" (nth 0 entry)) | |
4413 "[^\t ]" | |
4414 (nth 0 entry)) | |
4415 "\\)") | |
4416 header-face (nth 1 entry) | |
4417 field-face (nth 2 entry)) | |
4418 (while (and (re-search-forward regexp nil t) | |
4419 (not (eobp))) | |
4420 (beginning-of-line) | |
4421 (setq from (point)) | |
4422 (unless (search-forward ":" nil t) | |
4423 (forward-char 1)) | |
4424 (when (and header-face | |
4425 (not (memq (point) hpoints))) | |
4426 (push (point) hpoints) | |
4427 (gnus-put-text-property from (point) 'face header-face)) | |
4428 (when (and field-face | |
4429 (not (memq (setq from (point)) fpoints))) | |
4430 (push from fpoints) | |
4431 (if (re-search-forward "^[^ \t]" nil t) | |
4432 (forward-char -2) | |
4433 (goto-char (point-max))) | |
4434 (gnus-put-text-property from (point) 'face field-face)))))))) | |
4435 | |
4436 (defun gnus-article-highlight-signature () | |
4437 "Highlight the signature in an article. | |
4438 It does this by highlighting everything after | |
4439 `gnus-signature-separator' using `gnus-signature-face'." | |
4440 (interactive) | |
4441 (save-excursion | |
4442 (set-buffer gnus-article-buffer) | |
4443 (let ((buffer-read-only nil) | |
4444 (inhibit-point-motion-hooks t)) | |
4445 (save-restriction | |
4446 (when (and gnus-signature-face | |
4447 (gnus-article-narrow-to-signature)) | |
4448 (gnus-overlay-put (gnus-make-overlay (point-min) (point-max)) | |
4449 'face gnus-signature-face) | |
4450 (widen) | |
4451 (gnus-article-search-signature) | |
4452 (let ((start (match-beginning 0)) | |
4453 (end (set-marker (make-marker) (1+ (match-end 0))))) | |
4454 (gnus-article-add-button start (1- end) 'gnus-signature-toggle | |
4455 end))))))) | |
4456 | |
4457 (defun gnus-button-in-region-p (b e prop) | |
4458 "Say whether PROP exists in the region." | |
4459 (text-property-not-all b e prop nil)) | |
4460 | |
4461 (defun gnus-article-add-buttons (&optional force) | |
4462 "Find external references in the article and make buttons of them. | |
4463 \"External references\" are things like Message-IDs and URLs, as | |
4464 specified by `gnus-button-alist'." | |
4465 (interactive (list 'force)) | |
4466 (save-excursion | |
4467 (set-buffer gnus-article-buffer) | |
4468 (let ((buffer-read-only nil) | |
4469 (inhibit-point-motion-hooks t) | |
4470 (case-fold-search t) | |
4471 (alist gnus-button-alist) | |
4472 beg entry regexp) | |
4473 ;; Remove all old markers. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4474 (let (marker entry new-list) |
17493 | 4475 (while (setq marker (pop gnus-button-marker-list)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4476 (if (or (< marker (point-min)) (>= marker (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4477 (push marker new-list) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4478 (goto-char marker) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4479 (when (setq entry (gnus-button-entry)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4480 (put-text-property (match-beginning (nth 1 entry)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4481 (match-end (nth 1 entry)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4482 'gnus-callback nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4483 (set-marker marker nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4484 (setq gnus-button-marker-list new-list)) |
17493 | 4485 ;; We skip the headers. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4486 (article-goto-body) |
17493 | 4487 (setq beg (point)) |
4488 (while (setq entry (pop alist)) | |
4489 (setq regexp (car entry)) | |
4490 (goto-char beg) | |
4491 (while (re-search-forward regexp nil t) | |
4492 (let* ((start (and entry (match-beginning (nth 1 entry)))) | |
4493 (end (and entry (match-end (nth 1 entry)))) | |
4494 (from (match-beginning 0))) | |
4495 (when (and (or (eq t (nth 2 entry)) | |
4496 (eval (nth 2 entry))) | |
4497 (not (gnus-button-in-region-p | |
4498 start end 'gnus-callback))) | |
4499 ;; That optional form returned non-nil, so we add the | |
4500 ;; button. | |
4501 (gnus-article-add-button | |
4502 start end 'gnus-button-push | |
4503 (car (push (set-marker (make-marker) from) | |
4504 gnus-button-marker-list)))))))))) | |
4505 | |
4506 ;; Add buttons to the head of an article. | |
4507 (defun gnus-article-add-buttons-to-head () | |
4508 "Add buttons to the head of the article." | |
4509 (interactive) | |
4510 (save-excursion | |
4511 (set-buffer gnus-article-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4512 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4513 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4514 (inhibit-point-motion-hooks t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4515 (case-fold-search t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4516 (alist gnus-header-button-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4517 entry beg end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4518 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4519 (while alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4520 ;; Each alist entry. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4521 (setq entry (car alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4522 alist (cdr alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4523 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4524 (while (re-search-forward (car entry) nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4525 ;; Each header matching the entry. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4526 (setq beg (match-beginning 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4527 (setq end (or (and (re-search-forward "^[^ \t]" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4528 (match-beginning 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4529 (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4530 (goto-char beg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4531 (while (re-search-forward (nth 1 entry) end t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4532 ;; Each match within a header. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4533 (let* ((entry (cdr entry)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4534 (start (match-beginning (nth 1 entry))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4535 (end (match-end (nth 1 entry))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4536 (form (nth 2 entry))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4537 (goto-char (match-end 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4538 (when (eval form) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4539 (gnus-article-add-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4540 start end (nth 3 entry) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4541 (buffer-substring (match-beginning (nth 4 entry)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4542 (match-end (nth 4 entry))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4543 (goto-char end))))))) |
17493 | 4544 |
4545 ;;; External functions: | |
4546 | |
4547 (defun gnus-article-add-button (from to fun &optional data) | |
4548 "Create a button between FROM and TO with callback FUN and data DATA." | |
4549 (when gnus-article-button-face | |
4550 (gnus-overlay-put (gnus-make-overlay from to) | |
4551 'face gnus-article-button-face)) | |
4552 (gnus-add-text-properties | |
4553 from to | |
4554 (nconc (and gnus-article-mouse-face | |
4555 (list gnus-mouse-face-prop gnus-article-mouse-face)) | |
4556 (list 'gnus-callback fun) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4557 (and data (list 'gnus-data data)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4558 (widget-convert-button 'link from to :action 'gnus-widget-press-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4559 :button-keymap gnus-widget-button-keymap)) |
17493 | 4560 |
4561 ;;; Internal functions: | |
4562 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4563 (defun gnus-article-set-globals () |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4564 (save-excursion |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4565 (set-buffer gnus-summary-buffer) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4566 (gnus-set-global-variables))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4567 |
17493 | 4568 (defun gnus-signature-toggle (end) |
4569 (save-excursion | |
4570 (set-buffer gnus-article-buffer) | |
4571 (let ((buffer-read-only nil) | |
4572 (inhibit-point-motion-hooks t)) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
4573 (if (text-property-any end (point-max) 'article-type 'signature) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
4574 (gnus-remove-text-properties-when |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
4575 'article-type 'signature end (point-max) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
4576 (cons 'article-type (cons 'signature |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
4577 gnus-hidden-properties))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
4578 (gnus-add-text-properties-when |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
4579 'article-type nil end (point-max) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
4580 (cons 'article-type (cons 'signature |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
4581 gnus-hidden-properties))))))) |
17493 | 4582 |
4583 (defun gnus-button-entry () | |
4584 ;; Return the first entry in `gnus-button-alist' matching this place. | |
4585 (let ((alist gnus-button-alist) | |
4586 (entry nil)) | |
4587 (while alist | |
4588 (setq entry (pop alist)) | |
4589 (if (looking-at (car entry)) | |
4590 (setq alist nil) | |
4591 (setq entry nil))) | |
4592 entry)) | |
4593 | |
4594 (defun gnus-button-push (marker) | |
4595 ;; Push button starting at MARKER. | |
4596 (save-excursion | |
4597 (goto-char marker) | |
4598 (let* ((entry (gnus-button-entry)) | |
4599 (inhibit-point-motion-hooks t) | |
4600 (fun (nth 3 entry)) | |
4601 (args (mapcar (lambda (group) | |
4602 (let ((string (match-string group))) | |
4603 (gnus-set-text-properties | |
4604 0 (length string) nil string) | |
4605 string)) | |
4606 (nthcdr 4 entry)))) | |
4607 (cond | |
4608 ((fboundp fun) | |
4609 (apply fun args)) | |
4610 ((and (boundp fun) | |
4611 (fboundp (symbol-value fun))) | |
4612 (apply (symbol-value fun) args)) | |
4613 (t | |
4614 (gnus-message 1 "You must define `%S' to use this button" | |
4615 (cons fun args))))))) | |
4616 | |
4617 (defun gnus-button-message-id (message-id) | |
4618 "Fetch MESSAGE-ID." | |
4619 (save-excursion | |
4620 (set-buffer gnus-summary-buffer) | |
4621 (gnus-summary-refer-article message-id))) | |
4622 | |
4623 (defun gnus-button-fetch-group (address) | |
4624 "Fetch GROUP specified by ADDRESS." | |
4625 (if (not (string-match "[:/]" address)) | |
4626 ;; This is just a simple group url. | |
4627 (gnus-group-read-ephemeral-group address gnus-select-method) | |
4628 (if (not (string-match "^\\([^:/]+\\)\\(:\\([^/]+\\)/\\)?\\(.*\\)$" | |
4629 address)) | |
4630 (error "Can't parse %s" address) | |
4631 (gnus-group-read-ephemeral-group | |
4632 (match-string 4 address) | |
4633 `(nntp ,(match-string 1 address) | |
4634 (nntp-address ,(match-string 1 address)) | |
4635 (nntp-port-number ,(if (match-end 3) | |
4636 (match-string 3 address) | |
4637 "nntp"))))))) | |
4638 | |
4639 (defun gnus-url-parse-query-string (query &optional downcase) | |
4640 (let (retval pairs cur key val) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4641 (setq pairs (split-string query "&")) |
17493 | 4642 (while pairs |
4643 (setq cur (car pairs) | |
4644 pairs (cdr pairs)) | |
4645 (if (not (string-match "=" cur)) | |
4646 nil ; Grace | |
4647 (setq key (gnus-url-unhex-string (substring cur 0 (match-beginning 0))) | |
4648 val (gnus-url-unhex-string (substring cur (match-end 0) nil))) | |
4649 (if downcase | |
4650 (setq key (downcase key))) | |
4651 (setq cur (assoc key retval)) | |
4652 (if cur | |
4653 (setcdr cur (cons val (cdr cur))) | |
4654 (setq retval (cons (list key val) retval))))) | |
4655 retval)) | |
4656 | |
4657 (defun gnus-url-unhex (x) | |
4658 (if (> x ?9) | |
4659 (if (>= x ?a) | |
4660 (+ 10 (- x ?a)) | |
4661 (+ 10 (- x ?A))) | |
4662 (- x ?0))) | |
4663 | |
4664 (defun gnus-url-unhex-string (str &optional allow-newlines) | |
4665 "Remove %XXX embedded spaces, etc in a url. | |
4666 If optional second argument ALLOW-NEWLINES is non-nil, then allow the | |
4667 decoding of carriage returns and line feeds in the string, which is normally | |
4668 forbidden in URL encoding." | |
4669 (setq str (or str "")) | |
4670 (let ((tmp "") | |
4671 (case-fold-search t)) | |
4672 (while (string-match "%[0-9a-f][0-9a-f]" str) | |
4673 (let* ((start (match-beginning 0)) | |
4674 (ch1 (gnus-url-unhex (elt str (+ start 1)))) | |
4675 (code (+ (* 16 ch1) | |
4676 (gnus-url-unhex (elt str (+ start 2)))))) | |
4677 (setq tmp (concat | |
4678 tmp (substring str 0 start) | |
4679 (cond | |
4680 (allow-newlines | |
4681 (char-to-string code)) | |
4682 ((or (= code ?\n) (= code ?\r)) | |
4683 " ") | |
4684 (t (char-to-string code)))) | |
4685 str (substring str (match-end 0))))) | |
4686 (setq tmp (concat tmp str)) | |
4687 tmp)) | |
4688 | |
4689 (defun gnus-url-mailto (url) | |
4690 ;; Send mail to someone | |
4691 (when (string-match "mailto:/*\\(.*\\)" url) | |
4692 (setq url (substring url (match-beginning 1) nil))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4693 (let (to args subject func) |
17493 | 4694 (if (string-match (regexp-quote "?") url) |
4695 (setq to (gnus-url-unhex-string (substring url 0 (match-beginning 0))) | |
4696 args (gnus-url-parse-query-string | |
4697 (substring url (match-end 0) nil) t)) | |
4698 (setq to (gnus-url-unhex-string url))) | |
4699 (setq args (cons (list "to" to) args) | |
4700 subject (cdr-safe (assoc "subject" args))) | |
4701 (message-mail) | |
4702 (while args | |
4703 (setq func (intern-soft (concat "message-goto-" (downcase (caar args))))) | |
4704 (if (fboundp func) | |
4705 (funcall func) | |
4706 (message-position-on-field (caar args))) | |
4707 (insert (mapconcat 'identity (cdar args) ", ")) | |
4708 (setq args (cdr args))) | |
4709 (if subject | |
4710 (message-goto-body) | |
4711 (message-goto-subject)))) | |
4712 | |
4713 (defun gnus-button-mailto (address) | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4714 "Mail to ADDRESS." |
17493 | 4715 (set-buffer (gnus-copy-article-buffer)) |
4716 (message-reply address)) | |
4717 | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4718 (defalias 'gnus-button-reply 'message-reply) |
17493 | 4719 |
4720 (defun gnus-button-embedded-url (address) | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4721 "Activate ADDRESS with `browse-url'." |
23608
3805e63b8caf
(gnus-button-embedded-url, gnus-button-url):
Dave Love <fx@gnu.org>
parents:
23361
diff
changeset
|
4722 (browse-url (gnus-strip-whitespace address))) |
17493 | 4723 |
4724 ;;; Next/prev buttons in the article buffer. | |
4725 | |
4726 (defvar gnus-next-page-line-format "%{%(Next page...%)%}\n") | |
4727 (defvar gnus-prev-page-line-format "%{%(Previous page...%)%}\n") | |
4728 | |
4729 (defvar gnus-prev-page-map nil) | |
4730 (unless gnus-prev-page-map | |
4731 (setq gnus-prev-page-map (make-sparse-keymap)) | |
4732 (define-key gnus-prev-page-map gnus-mouse-2 'gnus-button-prev-page) | |
4733 (define-key gnus-prev-page-map "\r" 'gnus-button-prev-page)) | |
4734 | |
4735 (defun gnus-insert-prev-page-button () | |
4736 (let ((buffer-read-only nil)) | |
4737 (gnus-eval-format | |
4738 gnus-prev-page-line-format nil | |
4739 `(gnus-prev t local-map ,gnus-prev-page-map | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4740 gnus-callback gnus-article-button-prev-page |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4741 article-type annotation)))) |
17493 | 4742 |
4743 (defvar gnus-next-page-map nil) | |
4744 (unless gnus-next-page-map | |
4745 (setq gnus-next-page-map (make-keymap)) | |
4746 (suppress-keymap gnus-prev-page-map) | |
4747 (define-key gnus-next-page-map gnus-mouse-2 'gnus-button-next-page) | |
4748 (define-key gnus-next-page-map "\r" 'gnus-button-next-page)) | |
4749 | |
4750 (defun gnus-button-next-page () | |
4751 "Go to the next page." | |
4752 (interactive) | |
4753 (let ((win (selected-window))) | |
4754 (select-window (get-buffer-window gnus-article-buffer t)) | |
4755 (gnus-article-next-page) | |
4756 (select-window win))) | |
4757 | |
4758 (defun gnus-button-prev-page () | |
4759 "Go to the prev page." | |
4760 (interactive) | |
4761 (let ((win (selected-window))) | |
4762 (select-window (get-buffer-window gnus-article-buffer t)) | |
4763 (gnus-article-prev-page) | |
4764 (select-window win))) | |
4765 | |
4766 (defun gnus-insert-next-page-button () | |
4767 (let ((buffer-read-only nil)) | |
4768 (gnus-eval-format gnus-next-page-line-format nil | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4769 `(gnus-next |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4770 t local-map ,gnus-next-page-map |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4771 gnus-callback gnus-article-button-next-page |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4772 article-type annotation)))) |
17493 | 4773 |
4774 (defun gnus-article-button-next-page (arg) | |
4775 "Go to the next page." | |
4776 (interactive "P") | |
4777 (let ((win (selected-window))) | |
4778 (select-window (get-buffer-window gnus-article-buffer t)) | |
4779 (gnus-article-next-page) | |
4780 (select-window win))) | |
4781 | |
4782 (defun gnus-article-button-prev-page (arg) | |
4783 "Go to the prev page." | |
4784 (interactive "P") | |
4785 (let ((win (selected-window))) | |
4786 (select-window (get-buffer-window gnus-article-buffer t)) | |
4787 (gnus-article-prev-page) | |
4788 (select-window win))) | |
4789 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4790 (defvar gnus-decode-header-methods |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4791 '(mail-decode-encoded-word-region) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4792 "List of methods used to decode headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4793 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4794 This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4795 is FUNCTION, FUNCTION will be apply to all newsgroups. If item is a |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4796 (REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4797 whose names match REGEXP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4798 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4799 For example: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4800 ((\"chinese\" . gnus-decode-encoded-word-region-by-guess) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4801 mail-decode-encoded-word-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4802 (\"chinese\" . rfc1843-decode-region)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4803 ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4804 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4805 (defvar gnus-decode-header-methods-cache nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4806 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4807 (defun gnus-multi-decode-header (start end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4808 "Apply the functions from `gnus-encoded-word-methods' that match." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4809 (unless (and gnus-decode-header-methods-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4810 (eq gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4811 (car gnus-decode-header-methods-cache))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4812 (setq gnus-decode-header-methods-cache (list gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4813 (mapcar (lambda (x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4814 (if (symbolp x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4815 (nconc gnus-decode-header-methods-cache (list x)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4816 (if (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4817 (string-match (car x) gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4818 (nconc gnus-decode-header-methods-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4819 (list (cdr x)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4820 gnus-decode-header-methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4821 (let ((xlist gnus-decode-header-methods-cache)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4822 (pop xlist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4823 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4824 (narrow-to-region start end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4825 (while xlist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4826 (funcall (pop xlist) (point-min) (point-max)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4827 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4828 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4829 ;;; Treatment top-level handling. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4830 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4831 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4832 (defun gnus-treat-article (condition &optional part-number total-parts type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4833 (let ((length (- (point-max) (point-min))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4834 (alist gnus-treatment-function-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4835 (article-goto-body-goes-to-point-min-p t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4836 (treated-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4837 (or (not type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4838 (catch 'found |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4839 (let ((list gnus-article-treat-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4840 (while list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4841 (when (string-match (pop list) type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4842 (throw 'found t))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4843 (highlightp (gnus-visual-p 'article-highlight 'highlight)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4844 val elem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4845 (gnus-run-hooks 'gnus-part-display-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4846 (while (setq elem (pop alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4847 (setq val |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4848 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4849 (if (gnus-buffer-live-p gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4850 (set-buffer gnus-summary-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4851 (symbol-value (car elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4852 (when (and (or (consp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4853 treated-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4854 (gnus-treat-predicate val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4855 (or (not (get (car elem) 'highlight)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4856 highlightp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4857 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4858 (funcall (cadr elem))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4859 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4860 ;; Dynamic variables. |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4861 (eval-when-compile |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4862 (defvar part-number) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4863 (defvar total-parts) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4864 (defvar type) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4865 (defvar condition) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4866 (defvar length)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4867 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4868 (defun gnus-treat-predicate (val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4869 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4870 ((null val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4871 nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4872 ((and (listp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4873 (stringp (car val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4874 (apply 'gnus-or (mapcar `(lambda (s) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4875 (string-match s ,(or gnus-newsgroup-name ""))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4876 val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4877 ((listp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4878 (let ((pred (pop val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4879 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4880 ((eq pred 'or) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4881 (apply 'gnus-or (mapcar 'gnus-treat-predicate val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4882 ((eq pred 'and) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4883 (apply 'gnus-and (mapcar 'gnus-treat-predicate val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4884 ((eq pred 'not) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4885 (not (gnus-treat-predicate (car val)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4886 ((eq pred 'typep) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4887 (equal (car val) type)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4888 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4889 (error "%S is not a valid predicate" pred))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4890 (condition |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4891 (eq condition val)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4892 ((eq val t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4893 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4894 ((eq val 'head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4895 nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4896 ((eq val 'last) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4897 (eq part-number total-parts)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4898 ((numberp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4899 (< length val)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4900 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4901 (error "%S is not a valid value" val)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4902 |
17493 | 4903 (gnus-ems-redefine) |
4904 | |
4905 (provide 'gnus-art) | |
4906 | |
4907 (run-hooks 'gnus-art-load-hook) | |
4908 | |
4909 ;;; gnus-art.el ends here |