Mercurial > emacs
annotate lisp/gnus/gnus-art.el @ 88194:1f1ae6ac5610
(rmail-process-new-messages): Add an X-Coding-System header if one
doesn't exist.
author | Henrik Enberg <henrik.enberg@telia.com> |
---|---|
date | Tue, 17 Jan 2006 22:31:38 +0000 |
parents | d7ddb3e565de |
children |
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 |
88155 | 3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
4 ;; 2005 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 | |
88155 | 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02110-1301, USA. | |
17493 | 25 |
26 ;;; Commentary: | |
27 | |
28 ;;; Code: | |
29 | |
88155 | 30 (eval-when-compile |
31 (require 'cl) | |
32 (defvar tool-bar-map) | |
33 (defvar w3m-minor-mode-map)) | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
34 |
17493 | 35 (require 'gnus) |
36 (require 'gnus-sum) | |
37 (require 'gnus-spec) | |
38 (require 'gnus-int) | |
88155 | 39 (require 'gnus-win) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
40 (require 'mm-bodies) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
41 (require 'mail-parse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
42 (require 'mm-decode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
43 (require 'mm-view) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
44 (require 'wid-edit) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
45 (require 'mm-uu) |
88155 | 46 (require 'message) |
47 | |
48 (autoload 'gnus-msg-mail "gnus-msg" nil t) | |
49 (autoload 'gnus-button-mailto "gnus-msg") | |
50 (autoload 'gnus-button-reply "gnus-msg" nil t) | |
51 (autoload 'parse-time-string "parse-time" nil nil) | |
17493 | 52 |
53 (defgroup gnus-article nil | |
54 "Article display." | |
88155 | 55 :link '(custom-manual "(gnus)Article Buffer") |
17493 | 56 :group 'gnus) |
57 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
58 (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
|
59 "Treating article parts." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
60 :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
|
61 :group 'gnus-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
62 |
17493 | 63 (defgroup gnus-article-hiding nil |
64 "Hiding article parts." | |
65 :link '(custom-manual "(gnus)Article Hiding") | |
66 :group 'gnus-article) | |
67 | |
68 (defgroup gnus-article-highlight nil | |
69 "Article highlighting." | |
70 :link '(custom-manual "(gnus)Article Highlighting") | |
71 :group 'gnus-article | |
72 :group 'gnus-visual) | |
73 | |
74 (defgroup gnus-article-signature nil | |
75 "Article signatures." | |
76 :link '(custom-manual "(gnus)Article Signature") | |
77 :group 'gnus-article) | |
78 | |
79 (defgroup gnus-article-headers nil | |
80 "Article headers." | |
81 :link '(custom-manual "(gnus)Hiding Headers") | |
82 :group 'gnus-article) | |
83 | |
84 (defgroup gnus-article-washing nil | |
85 "Special commands on articles." | |
86 :link '(custom-manual "(gnus)Article Washing") | |
87 :group 'gnus-article) | |
88 | |
89 (defgroup gnus-article-emphasis nil | |
90 "Fontisizing articles." | |
91 :link '(custom-manual "(gnus)Article Fontisizing") | |
92 :group 'gnus-article) | |
93 | |
94 (defgroup gnus-article-saving nil | |
95 "Saving articles." | |
96 :link '(custom-manual "(gnus)Saving Articles") | |
97 :group 'gnus-article) | |
98 | |
99 (defgroup gnus-article-mime nil | |
100 "Worshiping the MIME wonder." | |
101 :link '(custom-manual "(gnus)Using MIME") | |
102 :group 'gnus-article) | |
103 | |
104 (defgroup gnus-article-buttons nil | |
105 "Pushable buttons in the article buffer." | |
106 :link '(custom-manual "(gnus)Article Buttons") | |
107 :group 'gnus-article) | |
108 | |
109 (defgroup gnus-article-various nil | |
110 "Other article options." | |
111 :link '(custom-manual "(gnus)Misc Article") | |
112 :group 'gnus-article) | |
113 | |
114 (defcustom gnus-ignored-headers | |
88155 | 115 (mapcar |
116 (lambda (header) | |
117 (concat "^" header ":")) | |
118 '("Path" "Expires" "Date-Received" "References" "Xref" "Lines" | |
119 "Relay-Version" "Message-ID" "Approved" "Sender" "Received" | |
120 "X-UIDL" "MIME-Version" "Return-Path" "In-Reply-To" | |
121 "Content-Type" "Content-Transfer-Encoding" "X-WebTV-Signature" | |
122 "X-MimeOLE" "X-MSMail-Priority" "X-Priority" "X-Loop" | |
123 "X-Authentication-Warning" "X-MIME-Autoconverted" "X-Face" | |
124 "X-Attribution" "X-Originating-IP" "Delivered-To" | |
125 "NNTP-[-A-Za-z]+" "Distribution" "X-no-archive" "X-Trace" | |
126 "X-Complaints-To" "X-NNTP-Posting-Host" "X-Orig.*" | |
127 "Abuse-Reports-To" "Cache-Post-Path" "X-Article-Creation-Date" | |
128 "X-Poster" "X-Mail2News-Path" "X-Server-Date" "X-Cache" | |
129 "Originator" "X-Problems-To" "X-Auth-User" "X-Post-Time" | |
130 "X-Admin" "X-UID" "Resent-[-A-Za-z]+" "X-Mailing-List" | |
131 "Precedence" "Original-[-A-Za-z]+" "X-filename" "X-Orcpt" | |
132 "Old-Received" "X-Pgp" "X-Auth" "X-From-Line" | |
133 "X-Gnus-Article-Number" "X-Majordomo" "X-Url" "X-Sender" | |
134 "MBOX-Line" "Priority" "X400-[-A-Za-z]+" | |
135 "Status" "X-Gnus-Mail-Source" "Cancel-Lock" | |
136 "X-FTN" "X-EXP32-SerialNo" "Encoding" "Importance" | |
137 "Autoforwarded" "Original-Encoded-Information-Types" "X-Ya-Pop3" | |
138 "X-Face-Version" "X-Vms-To" "X-ML-NAME" "X-ML-COUNT" | |
139 "Mailing-List" "X-finfo" "X-md5sum" "X-md5sum-Origin" | |
140 "X-Sun-Charset" "X-Accept-Language" "X-Envelope-Sender" | |
141 "List-[A-Za-z]+" "X-Listprocessor-Version" | |
142 "X-Received" "X-Distribute" "X-Sequence" "X-Juno-Line-Breaks" | |
143 "X-Notes-Item" "X-MS-TNEF-Correlator" "x-uunet-gateway" | |
144 "X-Received" "Content-length" "X-precedence" | |
145 "X-Authenticated-User" "X-Comment" "X-Report" "X-Abuse-Info" | |
146 "X-HTTP-Proxy" "X-Mydeja-Info" "X-Copyright" "X-No-Markup" | |
147 "X-Abuse-Info" "X-From_" "X-Accept-Language" "Errors-To" | |
148 "X-BeenThere" "X-Mailman-Version" "List-Help" "List-Post" | |
149 "List-Subscribe" "List-Id" "List-Unsubscribe" "List-Archive" | |
150 "X-Content-length" "X-Posting-Agent" "Original-Received" | |
151 "X-Request-PGP" "X-Fingerprint" "X-WRIEnvto" "X-WRIEnvfrom" | |
152 "X-Virus-Scanned" "X-Delivery-Agent" "Posted-Date" "X-Gateway" | |
153 "X-Local-Origin" "X-Local-Destination" "X-UserInfo1" | |
154 "X-Received-Date" "X-Hashcash" "Face" "X-DMCA-Notifications" | |
155 "X-Abuse-and-DMCA-Info" "X-Postfilter" "X-Gpg-.*" "X-Disclaimer")) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
156 "*All headers that start with this regexp will be hidden. |
17493 | 157 This variable can also be a list of regexps of headers to be ignored. |
158 If `gnus-visible-headers' is non-nil, this variable will be ignored." | |
159 :type '(choice :custom-show nil | |
160 regexp | |
161 (repeat regexp)) | |
162 :group 'gnus-article-hiding) | |
163 | |
164 (defcustom gnus-visible-headers | |
88155 | 165 "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^[BGF]?Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Mail-Followup-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-From:\\|^X-Sent:" |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
166 "*All headers that do not match this regexp will be hidden. |
17493 | 167 This variable can also be a list of regexp of headers to remain visible. |
168 If this variable is non-nil, `gnus-ignored-headers' will be ignored." | |
169 :type '(repeat :value-to-internal (lambda (widget value) | |
170 (custom-split-regexp-maybe value)) | |
171 :match (lambda (widget value) | |
172 (or (stringp value) | |
173 (widget-editable-list-match widget value))) | |
174 regexp) | |
175 :group 'gnus-article-hiding) | |
176 | |
177 (defcustom gnus-sorted-header-list | |
178 '("^From:" "^Subject:" "^Summary:" "^Keywords:" "^Newsgroups:" | |
179 "^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
|
180 "*This variable is a list of regular expressions. |
17493 | 181 If it is non-nil, headers that match the regular expressions will |
182 be placed first in the article buffer in the sequence specified by | |
183 this list." | |
184 :type '(repeat regexp) | |
185 :group 'gnus-article-hiding) | |
186 | |
187 (defcustom gnus-boring-article-headers '(empty followup-to reply-to) | |
188 "Headers that are only to be displayed if they have interesting data. | |
88155 | 189 Possible values in this list are: |
190 | |
191 'empty Headers with no content. | |
192 'newsgroups Newsgroup identical to Gnus group. | |
193 'to-address To identical to To-address. | |
194 'to-list To identical to To-list. | |
195 'cc-list CC identical to To-list. | |
196 'followup-to Followup-to identical to Newsgroups. | |
197 'reply-to Reply-to identical to From. | |
198 'date Date less than four days old. | |
199 'long-to To and/or Cc longer than 1024 characters. | |
200 'many-to Multiple To and/or Cc." | |
17493 | 201 :type '(set (const :tag "Headers with no content." empty) |
88155 | 202 (const :tag "Newsgroups identical to Gnus group." newsgroups) |
203 (const :tag "To identical to To-address." to-address) | |
204 (const :tag "To identical to To-list." to-list) | |
205 (const :tag "CC identical to To-list." cc-list) | |
206 (const :tag "Followup-to identical to Newsgroups." followup-to) | |
207 (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
|
208 (const :tag "Date less than four days old." date) |
88155 | 209 (const :tag "To and/or Cc longer than 1024 characters." long-to) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
210 (const :tag "Multiple To and/or Cc headers." many-to)) |
17493 | 211 :group 'gnus-article-hiding) |
212 | |
88155 | 213 (defcustom gnus-article-skip-boring nil |
214 "Skip over text that is not worth reading. | |
215 By default, if you set this t, then Gnus will display citations and | |
216 signatures, but will never scroll down to show you a page consisting | |
217 only of boring text. Boring text is controlled by | |
218 `gnus-article-boring-faces'." | |
219 :version "22.1" | |
220 :type 'boolean | |
221 :group 'gnus-article-hiding) | |
222 | |
17493 | 223 (defcustom gnus-signature-separator '("^-- $" "^-- *$") |
224 "Regexp matching signature separator. | |
225 This can also be a list of regexps. In that case, it will be checked | |
226 from head to tail looking for a separator. Searches will be done from | |
227 the end of the buffer." | |
88155 | 228 :type '(choice :format "%{%t%}: %[Value Menu%]\n%v" |
229 (regexp) | |
230 (repeat :tag "List of regexp" regexp)) | |
17493 | 231 :group 'gnus-article-signature) |
232 | |
233 (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
|
234 "Provide a limit to what is considered a signature. |
17493 | 235 If it is a number, no signature may not be longer (in characters) than |
236 that number. If it is a floating point number, no signature may be | |
237 longer (in lines) than that number. If it is a function, the function | |
238 will be called without any parameters, and if it returns nil, there is | |
239 no signature in the buffer. If it is a string, it will be used as a | |
240 regexp. If it matches, the text in question is not a signature." | |
88155 | 241 :type '(choice (const nil) |
242 (integer :value 200) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
243 (number :value 4.0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
244 (function :value fun) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
245 (regexp :value ".*")) |
17493 | 246 :group 'gnus-article-signature) |
247 | |
248 (defcustom gnus-hidden-properties '(invisible t intangible t) | |
249 "Property list to use for hiding text." | |
250 :type 'sexp | |
251 :group 'gnus-article-hiding) | |
252 | |
88155 | 253 ;; Fixme: This isn't the right thing for mixed graphical and non-graphical |
254 ;; frames in a session. | |
17493 | 255 (defcustom gnus-article-x-face-command |
88155 | 256 (if (featurep 'xemacs) |
257 (if (or (gnus-image-type-available-p 'xface) | |
258 (gnus-image-type-available-p 'pbm)) | |
259 'gnus-display-x-face-in-from | |
260 "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | ee -") | |
261 (if (gnus-image-type-available-p 'pbm) | |
262 'gnus-display-x-face-in-from | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
263 "{ 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
|
264 display -")) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
265 "*String or function to be executed to display an X-Face header. |
17493 | 266 If it is a string, the command will be executed in a sub-shell |
267 asynchronously. The compressed face will be piped to this command." | |
88155 | 268 :type `(choice string |
269 (function-item gnus-display-x-face-in-from) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
270 function) |
35759 | 271 :version "21.1" |
88155 | 272 :group 'gnus-picon |
17493 | 273 :group 'gnus-article-washing) |
274 | |
275 (defcustom gnus-article-x-face-too-ugly nil | |
276 "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
|
277 :type '(choice regexp (const nil)) |
17493 | 278 :group 'gnus-article-washing) |
279 | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
280 (defcustom gnus-article-banner-alist nil |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
281 "Banner alist for stripping. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
282 For example, |
88155 | 283 ((egroups . \"^[ \\t\\n]*-------------------+\\\\( \\\\(e\\\\|Yahoo! \\\\)Groups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))" |
33397 | 284 :version "21.1" |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
285 :type '(repeat (cons symbol regexp)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
286 :group 'gnus-article-washing) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
287 |
88155 | 288 (gnus-define-group-parameter |
289 banner | |
290 :variable-document | |
291 "Alist of regexps (to match group names) and banner." | |
292 :variable-group gnus-article-washing | |
293 :parameter-type | |
294 '(choice :tag "Banner" | |
295 :value nil | |
296 (const :tag "Remove signature" signature) | |
297 (symbol :tag "Item in `gnus-article-banner-alist'" none) | |
298 regexp | |
299 (const :tag "None" nil)) | |
300 :parameter-document | |
301 "If non-nil, specify how to remove `banners' from articles. | |
302 | |
303 Symbol `signature' means to remove signatures delimited by | |
304 `gnus-signature-separator'. Any other symbol is used to look up a | |
305 regular expression to match the banner in `gnus-article-banner-alist'. | |
306 A string is used as a regular expression to match the banner | |
307 directly.") | |
308 | |
309 (defcustom gnus-article-address-banner-alist nil | |
310 "Alist of mail addresses and banners. | |
311 Each element has the form (ADDRESS . BANNER), where ADDRESS is a regexp | |
312 to match a mail address in the From: header, BANNER is one of a symbol | |
313 `signature', an item in `gnus-article-banner-alist', a regexp and nil. | |
314 If ADDRESS matches author's mail address, it will remove things like | |
315 advertisements. For example: | |
316 | |
317 \((\"@yoo-hoo\\\\.co\\\\.jp\\\\'\" . \"\\n_+\\nDo You Yoo-hoo!\\\\?\\n.*\\n.*\\n\")) | |
318 " | |
319 :type '(repeat | |
320 (cons | |
321 (regexp :tag "Address") | |
322 (choice :tag "Banner" :value nil | |
323 (const :tag "Remove signature" signature) | |
324 (symbol :tag "Item in `gnus-article-banner-alist'" none) | |
325 regexp | |
326 (const :tag "None" nil)))) | |
327 :version "22.1" | |
328 :group 'gnus-article-washing) | |
329 | |
330 (defmacro gnus-emphasis-custom-with-format (&rest body) | |
331 `(let ((format "\ | |
332 \\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\ | |
333 \\(\\([-,.;:!?\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)")) | |
334 ,@body)) | |
335 | |
336 (defun gnus-emphasis-custom-value-to-external (value) | |
337 (gnus-emphasis-custom-with-format | |
338 (if (consp (car value)) | |
339 (list (format format (car (car value)) (cdr (car value))) | |
340 2 | |
341 (if (nth 1 value) 2 3) | |
342 (nth 2 value)) | |
343 value))) | |
344 | |
345 (defun gnus-emphasis-custom-value-to-internal (value) | |
346 (gnus-emphasis-custom-with-format | |
347 (let ((regexp (concat "\\`" | |
348 (format (regexp-quote format) | |
349 "\\([^()]+\\)" "\\([^()]+\\)") | |
350 "\\'")) | |
351 pattern) | |
352 (if (string-match regexp (setq pattern (car value))) | |
353 (list (cons (match-string 1 pattern) (match-string 2 pattern)) | |
354 (= (nth 2 value) 2) | |
355 (nth 3 value)) | |
356 value)))) | |
357 | |
17493 | 358 (defcustom gnus-emphasis-alist |
88155 | 359 (let ((types |
360 '(("\\*" "\\*" bold nil 2) | |
361 ("_" "_" underline) | |
17493 | 362 ("/" "/" italic) |
363 ("_/" "/_" underline-italic) | |
364 ("_\\*" "\\*_" underline-bold) | |
365 ("\\*/" "/\\*" bold-italic) | |
366 ("_\\*/" "/\\*_" underline-bold-italic)))) | |
88155 | 367 (nconc |
368 (gnus-emphasis-custom-with-format | |
369 (mapcar (lambda (spec) | |
370 (list (format format (car spec) (cadr spec)) | |
371 (or (nth 3 spec) 2) | |
372 (or (nth 4 spec) 3) | |
373 (intern (format "gnus-emphasis-%s" (nth 2 spec))))) | |
374 types)) | |
375 '(;; I've never seen anyone use this strikethru convention whereas I've | |
376 ;; several times seen it triggered by normal text. --Stef | |
377 ;; Miles suggests that this form is sometimes used but for italics, | |
378 ;; so maybe we should map it to `italic'. | |
379 ;; ("\\(\\s-\\|^\\)\\(-\\(\\(\\w\\|-[^-]\\)+\\)-\\)\\(\\s-\\|[?!.,;]\\)" | |
380 ;; 2 3 gnus-emphasis-strikethru) | |
381 ("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)" | |
382 2 3 gnus-emphasis-underline)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
383 "*Alist that says how to fontify certain phrases. |
17493 | 384 Each item looks like this: |
385 | |
386 (\"_\\\\(\\\\w+\\\\)_\" 0 1 'underline) | |
387 | |
388 The first element is a regular expression to be matched. The second | |
389 is a number that says what regular expression grouping used to find | |
390 the entire emphasized word. The third is a number that says what | |
391 regexp grouping should be displayed and highlighted. The fourth | |
392 is the face used for highlighting." | |
88155 | 393 :type |
394 '(repeat | |
395 (menu-choice | |
396 :format "%[Customizing Style%]\n%v" | |
397 :indent 2 | |
398 (group :tag "Default" | |
399 :value ("" 0 0 default) | |
400 :value-create | |
401 (lambda (widget) | |
402 (let ((value (widget-get | |
403 (cadr (widget-get (widget-get widget :parent) | |
404 :args)) | |
405 :value))) | |
406 (if (not (eq (nth 2 value) 'default)) | |
407 (widget-put | |
408 widget | |
409 :value | |
410 (gnus-emphasis-custom-value-to-external value)))) | |
411 (widget-group-value-create widget)) | |
412 regexp | |
413 (integer :format "Match group: %v") | |
414 (integer :format "Emphasize group: %v") | |
415 face) | |
416 (group :tag "Simple" | |
417 :value (("_" . "_") nil default) | |
418 (cons :format "%v" | |
419 (regexp :format "Start regexp: %v") | |
420 (regexp :format "End regexp: %v")) | |
421 (boolean :format "Show start and end patterns: %[%v%]\n" | |
422 :on " On " :off " Off ") | |
423 face))) | |
424 :get (lambda (symbol) | |
425 (mapcar 'gnus-emphasis-custom-value-to-internal | |
426 (default-value symbol))) | |
427 :set (lambda (symbol value) | |
428 (set-default symbol (mapcar 'gnus-emphasis-custom-value-to-external | |
429 value))) | |
17493 | 430 :group 'gnus-article-emphasis) |
431 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
432 (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
|
433 "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
|
434 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
|
435 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
|
436 and the latter avoids underlining any whitespace at all." |
33397 | 437 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
438 :group 'gnus-article-emphasis |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
439 :type 'regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
440 |
88155 | 441 (defface gnus-emphasis-bold '((t (:bold t))) |
17493 | 442 "Face used for displaying strong emphasized text (*word*)." |
443 :group 'gnus-article-emphasis) | |
444 | |
88155 | 445 (defface gnus-emphasis-italic '((t (:italic t))) |
17493 | 446 "Face used for displaying italic emphasized text (/word/)." |
447 :group 'gnus-article-emphasis) | |
448 | |
449 (defface gnus-emphasis-underline '((t (:underline t))) | |
450 "Face used for displaying underlined emphasized text (_word_)." | |
451 :group 'gnus-article-emphasis) | |
452 | |
88155 | 453 (defface gnus-emphasis-underline-bold '((t (:bold t :underline t))) |
17493 | 454 "Face used for displaying underlined bold emphasized text (_*word*_)." |
455 :group 'gnus-article-emphasis) | |
456 | |
88155 | 457 (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
|
458 "Face used for displaying underlined italic emphasized text (_/word/_)." |
17493 | 459 :group 'gnus-article-emphasis) |
460 | |
88155 | 461 (defface gnus-emphasis-bold-italic '((t (:bold t :italic t))) |
17493 | 462 "Face used for displaying bold italic emphasized text (/*word*/)." |
463 :group 'gnus-article-emphasis) | |
464 | |
465 (defface gnus-emphasis-underline-bold-italic | |
88155 | 466 '((t (:bold t :italic t :underline t))) |
17493 | 467 "Face used for displaying underlined bold italic emphasized text. |
48588 | 468 Example: (_/*word*/_)." |
17493 | 469 :group 'gnus-article-emphasis) |
470 | |
88155 | 471 (defface gnus-emphasis-strikethru (if (featurep 'xemacs) |
472 '((t (:strikethru t))) | |
473 '((t (:strike-through t)))) | |
474 "Face used for displaying strike-through text (-word-)." | |
475 :group 'gnus-article-emphasis) | |
476 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
477 (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
|
478 '((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
|
479 "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
|
480 :group 'gnus-article-emphasis) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
481 |
17493 | 482 (defcustom gnus-article-time-format "%a, %b %d %Y %T %Z" |
483 "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
|
484 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
|
485 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
486 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
|
487 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
|
488 be fed to `format-time-string'." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
489 :type '(choice string symbol) |
17493 | 490 :link '(custom-manual "(gnus)Article Date") |
491 :group 'gnus-article-washing) | |
492 | |
493 (defcustom gnus-save-all-headers t | |
494 "*If non-nil, don't remove any headers before saving." | |
495 :group 'gnus-article-saving | |
496 :type 'boolean) | |
497 | |
498 (defcustom gnus-prompt-before-saving 'always | |
499 "*This variable says how much prompting is to be done when saving articles. | |
500 If it is nil, no prompting will be done, and the articles will be | |
501 saved to the default files. If this variable is `always', each and | |
502 every article that is saved will be preceded by a prompt, even when | |
503 saving large batches of articles. If this variable is neither nil not | |
504 `always', there the user will be prompted once for a file name for | |
505 each invocation of the saving commands." | |
506 :group 'gnus-article-saving | |
507 :type '(choice (item always) | |
508 (item :tag "never" nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
509 (sexp :tag "once" :format "%t\n" :value t))) |
17493 | 510 |
511 (defcustom gnus-saved-headers gnus-visible-headers | |
512 "Headers to keep if `gnus-save-all-headers' is nil. | |
513 If `gnus-save-all-headers' is non-nil, this variable will be ignored. | |
514 If that variable is nil, however, all headers that match this regexp | |
515 will be kept while the rest will be deleted before saving." | |
516 :group 'gnus-article-saving | |
23361
86b5dc6c12f5
(gnus-article-x-face-too-ugly): Fix type.
Karl Heuer <kwzh@gnu.org>
parents:
22584
diff
changeset
|
517 :type 'regexp) |
17493 | 518 |
519 (defcustom gnus-default-article-saver 'gnus-summary-save-in-rmail | |
520 "A function to save articles in your favourite format. | |
521 The function must be interactively callable (in other words, it must | |
522 be an Emacs command). | |
523 | |
524 Gnus provides the following functions: | |
525 | |
526 * gnus-summary-save-in-rmail (Rmail format) | |
527 * gnus-summary-save-in-mail (Unix mail format) | |
528 * gnus-summary-save-in-folder (MH folder) | |
529 * gnus-summary-save-in-file (article format) | |
88155 | 530 * gnus-summary-save-body-in-file (article body) |
17493 | 531 * gnus-summary-save-in-vm (use VM's folder format) |
532 * gnus-summary-write-to-file (article format -- overwrite)." | |
533 :group 'gnus-article-saving | |
534 :type '(radio (function-item gnus-summary-save-in-rmail) | |
535 (function-item gnus-summary-save-in-mail) | |
536 (function-item gnus-summary-save-in-folder) | |
537 (function-item gnus-summary-save-in-file) | |
88155 | 538 (function-item gnus-summary-save-body-in-file) |
17493 | 539 (function-item gnus-summary-save-in-vm) |
88155 | 540 (function-item gnus-summary-write-to-file) |
541 (function))) | |
17493 | 542 |
543 (defcustom gnus-rmail-save-name 'gnus-plain-save-name | |
544 "A function generating a file name to save articles in Rmail format. | |
545 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE." | |
546 :group 'gnus-article-saving | |
547 :type 'function) | |
548 | |
549 (defcustom gnus-mail-save-name 'gnus-plain-save-name | |
550 "A function generating a file name to save articles in Unix mail format. | |
551 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE." | |
552 :group 'gnus-article-saving | |
553 :type 'function) | |
554 | |
555 (defcustom gnus-folder-save-name 'gnus-folder-save-name | |
556 "A function generating a file name to save articles in MH folder. | |
557 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER." | |
558 :group 'gnus-article-saving | |
559 :type 'function) | |
560 | |
561 (defcustom gnus-file-save-name 'gnus-numeric-save-name | |
562 "A function generating a file name to save articles in article format. | |
563 The function is called with NEWSGROUP, HEADERS, and optional | |
564 LAST-FILE." | |
565 :group 'gnus-article-saving | |
566 :type 'function) | |
567 | |
568 (defcustom gnus-split-methods | |
569 '((gnus-article-archive-name) | |
570 (gnus-article-nndoc-name)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
571 "*Variable used to suggest where articles are to be saved. |
17493 | 572 For instance, if you would like to save articles related to Gnus in |
573 the file \"gnus-stuff\", and articles related to VM in \"vm-stuff\", | |
574 you could set this variable to something like: | |
575 | |
576 '((\"^Subject:.*gnus\\|^Newsgroups:.*gnus\" \"gnus-stuff\") | |
577 (\"^Subject:.*vm\\|^Xref:.*vm\" \"vm-stuff\")) | |
578 | |
579 This variable is an alist where the where the key is the match and the | |
580 value is a list of possible files to save in if the match is non-nil. | |
581 | |
582 If the match is a string, it is used as a regexp match on the | |
583 article. If the match is a symbol, that symbol will be funcalled | |
584 from the buffer of the article to be saved with the newsgroup as the | |
585 parameter. If it is a list, it will be evaled in the same buffer. | |
586 | |
587 If this form or function returns a string, this string will be used as | |
588 a possible file name; and if it returns a non-nil list, that list will | |
589 be used as possible file names." | |
590 :group 'gnus-article-saving | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
591 :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
|
592 (cons :value ("" "") regexp (repeat string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
593 (sexp :value nil)))) |
17493 | 594 |
595 (defcustom gnus-page-delimiter "^\^L" | |
596 "*Regexp describing what to use as article page delimiters. | |
597 The default value is \"^\^L\", which is a form linefeed at the | |
598 beginning of a line." | |
599 :type 'regexp | |
600 :group 'gnus-article-various) | |
601 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
602 (defcustom gnus-article-mode-line-format "Gnus: %g [%w] %S%m" |
17493 | 603 "*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
|
604 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
|
605 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
606 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
|
607 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
608 %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
|
609 %m The number of MIME parts in the article." |
17493 | 610 :type 'string |
611 :group 'gnus-article-various) | |
612 | |
613 (defcustom gnus-article-mode-hook nil | |
614 "*A hook for Gnus article mode." | |
615 :type 'hook | |
616 :group 'gnus-article-various) | |
617 | |
88155 | 618 (when (featurep 'xemacs) |
619 ;; Extracted from gnus-xmas-define in order to preserve user settings | |
620 (when (fboundp 'turn-off-scroll-in-place) | |
621 (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place)) | |
622 ;; Extracted from gnus-xmas-redefine in order to preserve user settings | |
623 (add-hook 'gnus-article-mode-hook 'gnus-xmas-article-menu-add)) | |
624 | |
17493 | 625 (defcustom gnus-article-menu-hook nil |
626 "*Hook run after the creation of the article mode menu." | |
627 :type 'hook | |
628 :group 'gnus-article-various) | |
629 | |
630 (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
|
631 "*A hook called after an article has been prepared in the article buffer." |
17493 | 632 :type 'hook |
633 :group 'gnus-article-various) | |
634 | |
88155 | 635 (make-obsolete-variable 'gnus-article-hide-pgp-hook |
636 "This variable is obsolete in Gnus 5.10.") | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
637 |
17493 | 638 (defcustom gnus-article-button-face 'bold |
639 "Face used for highlighting buttons in the article buffer. | |
640 | |
641 An article button is a piece of text that you can activate by pressing | |
642 `RET' or `mouse-2' above it." | |
643 :type 'face | |
644 :group 'gnus-article-buttons) | |
645 | |
646 (defcustom gnus-article-mouse-face 'highlight | |
647 "Face used for mouse highlighting in the article buffer. | |
648 | |
649 Article buttons will be displayed in this face when the cursor is | |
650 above them." | |
651 :type 'face | |
652 :group 'gnus-article-buttons) | |
653 | |
88155 | 654 (defcustom gnus-signature-face 'gnus-signature |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
655 "Face used for highlighting a signature in the article buffer. |
88155 | 656 Obsolete; use the face `gnus-signature' for customizations instead." |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
657 :type 'face |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
658 :group 'gnus-article-highlight |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
659 :group 'gnus-article-signature) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
660 |
88155 | 661 (defface gnus-signature |
32927
c0b62376988c
(gnus-signature-face): Use italics on all terminals that support it.
Jason Rumney <jasonr@gnu.org>
parents:
32210
diff
changeset
|
662 '((t |
88155 | 663 (:italic t))) |
17493 | 664 "Face used for highlighting a signature in the article buffer." |
665 :group 'gnus-article-highlight | |
666 :group 'gnus-article-signature) | |
88155 | 667 ;; backward-compatibility alias |
668 (put 'gnus-signature-face 'face-alias 'gnus-signature) | |
669 | |
670 (defface gnus-header-from | |
17493 | 671 '((((class color) |
672 (background dark)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
673 (:foreground "spring green")) |
17493 | 674 (((class color) |
675 (background light)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
676 (:foreground "red3")) |
17493 | 677 (t |
88155 | 678 (:italic t))) |
17493 | 679 "Face used for displaying from headers." |
680 :group 'gnus-article-headers | |
681 :group 'gnus-article-highlight) | |
88155 | 682 ;; backward-compatibility alias |
683 (put 'gnus-header-from-face 'face-alias 'gnus-header-from) | |
684 | |
685 (defface gnus-header-subject | |
17493 | 686 '((((class color) |
687 (background dark)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
688 (:foreground "SeaGreen3")) |
17493 | 689 (((class color) |
690 (background light)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
691 (:foreground "red4")) |
17493 | 692 (t |
88155 | 693 (:bold t :italic t))) |
17493 | 694 "Face used for displaying subject headers." |
695 :group 'gnus-article-headers | |
696 :group 'gnus-article-highlight) | |
88155 | 697 ;; backward-compatibility alias |
698 (put 'gnus-header-subject-face 'face-alias 'gnus-header-subject) | |
699 | |
700 (defface gnus-header-newsgroups | |
17493 | 701 '((((class color) |
702 (background dark)) | |
88155 | 703 (:foreground "yellow" :italic t)) |
17493 | 704 (((class color) |
705 (background light)) | |
88155 | 706 (:foreground "MidnightBlue" :italic t)) |
17493 | 707 (t |
88155 | 708 (:italic t))) |
709 "Face used for displaying newsgroups headers. | |
710 In the default setup this face is only used for crossposted | |
711 articles." | |
17493 | 712 :group 'gnus-article-headers |
713 :group 'gnus-article-highlight) | |
88155 | 714 ;; backward-compatibility alias |
715 (put 'gnus-header-newsgroups-face 'face-alias 'gnus-header-newsgroups) | |
716 | |
717 (defface gnus-header-name | |
17493 | 718 '((((class color) |
719 (background dark)) | |
720 (:foreground "SeaGreen")) | |
721 (((class color) | |
722 (background light)) | |
723 (:foreground "maroon")) | |
724 (t | |
88155 | 725 (:bold t))) |
17493 | 726 "Face used for displaying header names." |
727 :group 'gnus-article-headers | |
728 :group 'gnus-article-highlight) | |
88155 | 729 ;; backward-compatibility alias |
730 (put 'gnus-header-name-face 'face-alias 'gnus-header-name) | |
731 | |
732 (defface gnus-header-content | |
17493 | 733 '((((class color) |
734 (background dark)) | |
88155 | 735 (:foreground "forest green" :italic t)) |
17493 | 736 (((class color) |
737 (background light)) | |
88155 | 738 (:foreground "indianred4" :italic t)) |
17493 | 739 (t |
88155 | 740 (:italic t))) "Face used for displaying header content." |
17493 | 741 :group 'gnus-article-headers |
742 :group 'gnus-article-highlight) | |
88155 | 743 ;; backward-compatibility alias |
744 (put 'gnus-header-content-face 'face-alias 'gnus-header-content) | |
17493 | 745 |
746 (defcustom gnus-header-face-alist | |
88155 | 747 '(("From" nil gnus-header-from) |
748 ("Subject" nil gnus-header-subject) | |
749 ("Newsgroups:.*," nil gnus-header-newsgroups) | |
750 ("" gnus-header-name gnus-header-content)) | |
751 "*Controls highlighting of article headers. | |
17493 | 752 |
753 An alist of the form (HEADER NAME CONTENT). | |
754 | |
88155 | 755 HEADER is a regular expression which should match the name of a |
756 header and NAME and CONTENT are either face names or nil. | |
17493 | 757 |
758 The name of each header field will be displayed using the face | |
88155 | 759 specified by the first element in the list where HEADER matches |
760 the header name and NAME is non-nil. Similarly, the content will | |
761 be displayed by the first non-nil matching CONTENT face." | |
17493 | 762 :group 'gnus-article-headers |
763 :group 'gnus-article-highlight | |
764 :type '(repeat (list (regexp :tag "Header") | |
765 (choice :tag "Name" | |
766 (item :tag "skip" nil) | |
767 (face :value default)) | |
768 (choice :tag "Content" | |
769 (item :tag "skip" nil) | |
770 (face :value default))))) | |
771 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
772 (defcustom gnus-article-decode-hook |
88155 | 773 '(article-decode-charset article-decode-encoded-words |
774 article-decode-group-name article-decode-idna-rhs) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
775 "*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
|
776 :group 'gnus-article-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
777 :type 'hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
778 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
779 (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
|
780 "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
|
781 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
782 :type 'function) |
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 (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
|
785 "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
|
786 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
787 (defvar gnus-article-dumbquotes-map |
88155 | 788 '(("\200" "EUR") |
789 ("\202" ",") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
790 ("\203" "f") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
791 ("\204" ",,") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
792 ("\205" "...") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
793 ("\213" "<") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
794 ("\214" "OE") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
795 ("\221" "`") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
796 ("\222" "'") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
797 ("\223" "``") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
798 ("\224" "\"") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
799 ("\225" "*") |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
800 ("\226" "-") |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
801 ("\227" "--") |
88155 | 802 ("\230" "~") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
803 ("\231" "(TM)") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
804 ("\233" ">") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
805 ("\234" "oe") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
806 ("\264" "'")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
807 "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
|
808 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
809 (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
|
810 "List of MIME types that should be ignored by Gnus." |
33397 | 811 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
812 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
813 :type '(repeat regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
814 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
815 (defcustom gnus-unbuttonized-mime-types '(".*/.*") |
88155 | 816 "List of MIME types that should not be given buttons when rendered inline. |
817 See also `gnus-buttonized-mime-types' which may override this variable. | |
818 This variable is only used when `gnus-inhibit-mime-unbuttonizing' is nil." | |
33397 | 819 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
820 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
821 :type '(repeat regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
822 |
88155 | 823 (defcustom gnus-buttonized-mime-types nil |
824 "List of MIME types that should be given buttons when rendered inline. | |
825 If set, this variable overrides `gnus-unbuttonized-mime-types'. | |
826 To see e.g. security buttons you could set this to | |
827 `(\"multipart/signed\")'. You could also add \"multipart/alternative\" to | |
828 this list to display radio buttons that allow you to choose one of two | |
829 media types those mails include. See also `mm-discouraged-alternatives'. | |
830 This variable is only used when `gnus-inhibit-mime-unbuttonizing' is nil." | |
831 :version "22.1" | |
832 :group 'gnus-article-mime | |
833 :type '(repeat regexp)) | |
834 | |
835 (defcustom gnus-inhibit-mime-unbuttonizing nil | |
836 "If non-nil, all MIME parts get buttons. | |
837 When nil (the default value), then some MIME parts do not get buttons, | |
838 as described by the variables `gnus-buttonized-mime-types' and | |
839 `gnus-unbuttonized-mime-types'." | |
840 :version "22.1" | |
841 :group 'gnus-article-mime | |
842 :type 'boolean) | |
843 | |
844 (defcustom gnus-body-boundary-delimiter "_" | |
845 "String used to delimit header and body. | |
846 This variable is used by `gnus-article-treat-body-boundary' which can | |
847 be controlled by `gnus-treat-body-boundary'." | |
848 :version "22.1" | |
849 :group 'gnus-article-various | |
850 :type '(choice (item :tag "None" :value nil) | |
851 string)) | |
852 | |
853 (defcustom gnus-picon-databases '("/usr/lib/picon" "/usr/local/faces" | |
854 "/usr/share/picons") | |
855 "Defines the location of the faces database. | |
856 For information on obtaining this database of pretty pictures, please | |
857 see http://www.cs.indiana.edu/picons/ftp/index.html" | |
858 :version "22.1" | |
859 :type '(repeat directory) | |
860 :link '(url-link :tag "download" | |
861 "http://www.cs.indiana.edu/picons/ftp/index.html") | |
862 :link '(custom-manual "(gnus)Picons") | |
863 :group 'gnus-picon) | |
864 | |
865 (defun gnus-picons-installed-p () | |
866 "Say whether picons are installed on your machine." | |
867 (let ((installed nil)) | |
868 (dolist (database gnus-picon-databases) | |
869 (when (file-exists-p database) | |
870 (setq installed t))) | |
871 installed)) | |
872 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
873 (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
|
874 "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
|
875 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
|
876 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
|
877 :group 'gnus-article-mime |
88155 | 878 :type '(choice (const nil) |
879 function)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
880 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
881 (defcustom gnus-mime-multipart-functions nil |
33397 | 882 "An alist of MIME types to functions to display them." |
883 :version "21.1" | |
884 :group 'gnus-article-mime | |
885 :type 'alist) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
886 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
887 (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
|
888 "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
|
889 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
|
890 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
|
891 be added below it (otherwise)." |
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-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
894 :type 'boolean) |
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-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
|
897 "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
|
898 This is meant for people who want to view first matched part. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
899 For `undisplayed-alternative' (default), the first undisplayed |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
900 part or alternative part is used. For `undisplayed', the first |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
901 undisplayed part is used. For a function, the first part which |
88155 | 902 the function return t is used. For nil, the first part is |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
903 used." |
33397 | 904 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
905 :group 'gnus-article-mime |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
906 :type '(choice |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
907 (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
|
908 (item :tag "undisplayed" :value undisplayed) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
909 (item :tag "undisplayed or alternative" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
910 :value undisplayed-alternative) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
911 (function))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
912 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
913 (defcustom gnus-mime-action-alist |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
914 '(("save to file" . gnus-mime-save-part) |
88155 | 915 ("save and strip" . gnus-mime-save-part-and-strip) |
916 ("delete part" . gnus-mime-delete-part) | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
917 ("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
|
918 ("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
|
919 ("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
|
920 ("toggle display" . gnus-article-press-button) |
88155 | 921 ("toggle display" . gnus-article-view-part-as-charset) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
922 ("view as type" . gnus-mime-view-part-as-type) |
88155 | 923 ("view internally" . gnus-mime-view-part-internally) |
924 ("view externally" . gnus-mime-view-part-externally)) | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
925 "An alist of actions that run on the MIME attachment." |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
926 :group 'gnus-article-mime |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
927 :type '(repeat (cons (string :tag "name") |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
928 (function)))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
929 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
930 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
931 ;;; The treatment variables |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
932 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
933 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
934 (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
|
935 "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
|
936 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
937 (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
|
938 '(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
|
939 (const :tag "On" t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
940 (const :tag "Header" head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
941 (const :tag "Last" last) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
942 (integer :tag "Less") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
943 (repeat :tag "Groups" regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
944 (sexp :tag "Predicate"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
945 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
946 (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
|
947 '(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
|
948 (const :tag "Header" head))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
949 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
950 (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
|
951 "Parts to treat.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
952 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
953 (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
|
954 "Whether to inhibit treatment.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
955 |
88155 | 956 (defcustom gnus-treat-highlight-signature '(or t (typep "text/x-vcard")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
957 "Highlight the signature. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
958 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 959 See Info node `(gnus)Customizing Articles'." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
960 :group 'gnus-article-treat |
88155 | 961 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
962 :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
|
963 (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
|
964 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
965 (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
|
966 "Add buttons. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
967 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 968 See Info node `(gnus)Customizing Articles'." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
969 :group 'gnus-article-treat |
88155 | 970 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
971 :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
|
972 (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
|
973 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
974 (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
|
975 "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
|
976 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 977 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
978 :group 'gnus-article-treat |
88155 | 979 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
980 :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
|
981 (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
|
982 |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
983 (defcustom gnus-treat-emphasize |
34818
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
984 (and (or window-system |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
985 (featurep 'xemacs) |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
986 (>= (string-to-number emacs-version) 21)) |
2c66e24f2398
* gnus-art.el (article-treat-dumbquotes): Quote \.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34727
diff
changeset
|
987 50000) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
988 "Emphasize text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
989 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 990 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
991 :group 'gnus-article-treat |
88155 | 992 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
993 :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
|
994 (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
|
995 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
996 (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
|
997 "Remove carriage returns. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
998 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 999 See Info node `(gnus)Customizing Articles' for details." |
1000 :version "22.1" | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1001 :group 'gnus-article-treat |
88155 | 1002 :link '(custom-manual "(gnus)Customizing Articles") |
1003 :type gnus-article-treat-custom) | |
1004 | |
1005 (defcustom gnus-treat-unsplit-urls nil | |
1006 "Remove newlines from within URLs. | |
1007 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1008 See Info node `(gnus)Customizing Articles' for details." | |
1009 :version "22.1" | |
1010 :group 'gnus-article-treat | |
1011 :link '(custom-manual "(gnus)Customizing Articles") | |
1012 :type gnus-article-treat-custom) | |
1013 | |
1014 (defcustom gnus-treat-leading-whitespace nil | |
1015 "Remove leading whitespace in headers. | |
1016 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1017 See Info node `(gnus)Customizing Articles' for details." | |
1018 :version "22.1" | |
1019 :group 'gnus-article-treat | |
1020 :link '(custom-manual "(gnus)Customizing Articles") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1021 :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
|
1022 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1023 (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
|
1024 "Hide headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1025 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1026 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1027 :group 'gnus-article-treat |
88155 | 1028 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1029 :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
|
1030 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1031 (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
|
1032 "Hide boring headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1033 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1034 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1035 :group 'gnus-article-treat |
88155 | 1036 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1037 :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
|
1038 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1039 (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
|
1040 "Hide the signature. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1041 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1042 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1043 :group 'gnus-article-treat |
88155 | 1044 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1045 :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
|
1046 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1047 (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
|
1048 "Fill the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1049 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1050 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1051 :group 'gnus-article-treat |
88155 | 1052 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1053 :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
|
1054 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1055 (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
|
1056 "Hide cited text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1057 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1058 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1059 :group 'gnus-article-treat |
88155 | 1060 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1061 :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
|
1062 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1063 (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
|
1064 "Hide cited text. |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1065 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1066 See Info node `(gnus)Customizing Articles' for details." |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1067 :group 'gnus-article-treat |
88155 | 1068 :link '(custom-manual "(gnus)Customizing Articles") |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1069 :type gnus-article-treat-custom) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1070 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1071 (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
|
1072 "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
|
1073 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1074 See Info node `(gnus)Customizing Articles' for details." |
33397 | 1075 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1076 :group 'gnus-article-treat |
88155 | 1077 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1078 :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
|
1079 |
88155 | 1080 (make-obsolete-variable 'gnus-treat-strip-pgp |
1081 "This option is obsolete in Gnus 5.10.") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1082 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1083 (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
|
1084 "Strip PEM signatures. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1085 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1086 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1087 :group 'gnus-article-treat |
88155 | 1088 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1089 :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
|
1090 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1091 (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
|
1092 "Strip banners from articles. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1093 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
|
1094 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1095 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1096 :group 'gnus-article-treat |
88155 | 1097 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1098 :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
|
1099 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1100 (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
|
1101 "Highlight the headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1102 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1103 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1104 :group 'gnus-article-treat |
88155 | 1105 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1106 :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
|
1107 (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
|
1108 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1109 (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
|
1110 "Highlight cited text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1111 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1112 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1113 :group 'gnus-article-treat |
88155 | 1114 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1115 :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
|
1116 (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
|
1117 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1118 (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
|
1119 "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
|
1120 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1121 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1122 :group 'gnus-article-treat |
88155 | 1123 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1124 :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
|
1125 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1126 (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
|
1127 "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
|
1128 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1129 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1130 :group 'gnus-article-treat |
88155 | 1131 :link '(custom-manual "(gnus)Customizing Articles") |
1132 :type gnus-article-treat-head-custom) | |
1133 | |
1134 (defcustom gnus-treat-date-english nil | |
1135 "Display the Date in a format that can be read aloud in English. | |
1136 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1137 See Info node `(gnus)Customizing Articles' for details." | |
1138 :version "22.1" | |
1139 :group 'gnus-article-treat | |
1140 :link '(custom-manual "(gnus)Customizing Articles") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1141 :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
|
1142 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1143 (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
|
1144 "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
|
1145 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1146 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1147 :group 'gnus-article-treat |
88155 | 1148 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1149 :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
|
1150 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1151 (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
|
1152 "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
|
1153 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1154 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1155 :group 'gnus-article-treat |
88155 | 1156 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1157 :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
|
1158 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1159 (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
|
1160 "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
|
1161 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1162 See Info node `(gnus)Customizing Articles' for details." |
33397 | 1163 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1164 :group 'gnus-article-treat |
88155 | 1165 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1166 :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
|
1167 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1168 (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
|
1169 "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
|
1170 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
|
1171 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1172 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1173 :group 'gnus-article-treat |
88155 | 1174 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1175 :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
|
1176 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1177 (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
|
1178 "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
|
1179 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1180 See Info node `(gnus)Customizing Articles' for details." |
33397 | 1181 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1182 :group 'gnus-article-treat |
88155 | 1183 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1184 :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
|
1185 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1186 (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
|
1187 "Strip trailing blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1188 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1189 See Info node `(gnus)Customizing Articles' for details. |
1190 | |
1191 When set to t, it also strips trailing blanks in all MIME parts. | |
1192 Consider to use `last' instead." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1193 :group 'gnus-article-treat |
88155 | 1194 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1195 :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
|
1196 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1197 (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
|
1198 "Strip leading blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1199 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1200 See Info node `(gnus)Customizing Articles' for details. |
1201 | |
1202 When set to t, it also strips trailing blanks in all MIME parts." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1203 :group 'gnus-article-treat |
88155 | 1204 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1205 :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
|
1206 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1207 (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
|
1208 "Strip multiple blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1209 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1210 See Info node `(gnus)Customizing Articles' for details." |
1211 :group 'gnus-article-treat | |
1212 :link '(custom-manual "(gnus)Customizing Articles") | |
1213 :type gnus-article-treat-custom) | |
1214 | |
1215 (defcustom gnus-treat-unfold-headers 'head | |
1216 "Unfold folded header lines. | |
1217 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1218 See Info node `(gnus)Customizing Articles' for details." | |
1219 :version "22.1" | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1220 :group 'gnus-article-treat |
88155 | 1221 :link '(custom-manual "(gnus)Customizing Articles") |
1222 :type gnus-article-treat-custom) | |
1223 | |
1224 (defcustom gnus-treat-fold-headers nil | |
1225 "Fold headers. | |
1226 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1227 See Info node `(gnus)Customizing Articles' for details." | |
1228 :version "22.1" | |
1229 :group 'gnus-article-treat | |
1230 :link '(custom-manual "(gnus)Customizing Articles") | |
1231 :type gnus-article-treat-custom) | |
1232 | |
1233 (defcustom gnus-treat-fold-newsgroups 'head | |
1234 "Fold the Newsgroups and Followup-To headers. | |
1235 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1236 See Info node `(gnus)Customizing Articles' for details." | |
1237 :version "22.1" | |
1238 :group 'gnus-article-treat | |
1239 :link '(custom-manual "(gnus)Customizing Articles") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1240 :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
|
1241 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1242 (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
|
1243 "Treat overstrike highlighting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1244 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1245 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1246 :group 'gnus-article-treat |
88155 | 1247 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1248 :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
|
1249 (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
|
1250 |
88155 | 1251 (make-obsolete-variable 'gnus-treat-display-xface |
1252 'gnus-treat-display-x-face) | |
1253 | |
1254 (defcustom gnus-treat-display-x-face | |
1255 (and (not noninteractive) | |
1256 (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
|
1257 (image-type-available-p 'xbm) |
88155 | 1258 (string-match "^0x" (shell-command-to-string "uncompface")) |
1259 (executable-find "icontopbm")) | |
1260 (and (featurep 'xemacs) | |
1261 (featurep 'xface))) | |
31785 | 1262 'head) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1263 "Display X-Face headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1264 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1265 See Info node `(gnus)Customizing Articles' and Info node |
1266 `(gnus)X-Face' for details." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1267 :group 'gnus-article-treat |
35759 | 1268 :version "21.1" |
88155 | 1269 :link '(custom-manual "(gnus)Customizing Articles") |
1270 :link '(custom-manual "(gnus)X-Face") | |
1271 :type gnus-article-treat-head-custom | |
1272 :set (lambda (symbol value) | |
1273 (set-default | |
1274 symbol | |
1275 (cond ((or (boundp symbol) (get symbol 'saved-value)) | |
1276 value) | |
1277 ((boundp 'gnus-treat-display-xface) | |
1278 (message "\ | |
1279 ** gnus-treat-display-xface is an obsolete variable;\ | |
1280 use gnus-treat-display-x-face instead") | |
1281 (default-value 'gnus-treat-display-xface)) | |
1282 ((get 'gnus-treat-display-xface 'saved-value) | |
1283 (message "\ | |
1284 ** gnus-treat-display-xface is an obsolete variable;\ | |
1285 use gnus-treat-display-x-face instead") | |
1286 (eval (car (get 'gnus-treat-display-xface 'saved-value)))) | |
1287 (t | |
1288 value))))) | |
1289 (put 'gnus-treat-display-x-face 'highlight t) | |
1290 | |
1291 (defcustom gnus-treat-display-face | |
1292 (and (not noninteractive) | |
1293 (or (and (fboundp 'image-type-available-p) | |
1294 (image-type-available-p 'png)) | |
1295 (and (featurep 'xemacs) | |
1296 (featurep 'png))) | |
1297 'head) | |
1298 "Display Face headers. | |
1299 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1300 See Info node `(gnus)Customizing Articles' and Info node | |
1301 `(gnus)X-Face' for details." | |
1302 :group 'gnus-article-treat | |
1303 :version "22.1" | |
1304 :link '(custom-manual "(gnus)Customizing Articles") | |
1305 :link '(custom-manual "(gnus)X-Face") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1306 :type gnus-article-treat-head-custom) |
88155 | 1307 (put 'gnus-treat-display-face 'highlight t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1308 |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
1309 (defcustom gnus-treat-display-smileys |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1310 (if (or (and (featurep 'xemacs) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1311 (featurep 'xpm)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1312 (and (fboundp 'image-type-available-p) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1313 (image-type-available-p 'pbm))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1314 t nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1315 "Display smileys. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1316 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1317 See Info node `(gnus)Customizing Articles' and Info node |
1318 `(gnus)Smileys' for details." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1319 :group 'gnus-article-treat |
35759 | 1320 :version "21.1" |
88155 | 1321 :link '(custom-manual "(gnus)Customizing Articles") |
1322 :link '(custom-manual "(gnus)Smileys") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1323 :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
|
1324 (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
|
1325 |
88155 | 1326 (defcustom gnus-treat-from-picon |
1327 (if (and (gnus-image-type-available-p 'xpm) | |
1328 (gnus-picons-installed-p)) | |
1329 'head nil) | |
1330 "Display picons in the From header. | |
1331 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1332 See Info node `(gnus)Customizing Articles' and Info node | |
1333 `(gnus)Picons' for details." | |
1334 :version "22.1" | |
1335 :group 'gnus-article-treat | |
1336 :group 'gnus-picon | |
1337 :link '(custom-manual "(gnus)Customizing Articles") | |
1338 :link '(custom-manual "(gnus)Picons") | |
1339 :type gnus-article-treat-head-custom) | |
1340 (put 'gnus-treat-from-picon 'highlight t) | |
1341 | |
1342 (defcustom gnus-treat-mail-picon | |
1343 (if (and (gnus-image-type-available-p 'xpm) | |
1344 (gnus-picons-installed-p)) | |
1345 'head nil) | |
1346 "Display picons in To and Cc headers. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1347 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1348 See Info node `(gnus)Customizing Articles' and Info node |
1349 `(gnus)Picons' for details." | |
1350 :version "22.1" | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1351 :group 'gnus-article-treat |
88155 | 1352 :group 'gnus-picon |
1353 :link '(custom-manual "(gnus)Customizing Articles") | |
1354 :link '(custom-manual "(gnus)Picons") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1355 :type gnus-article-treat-head-custom) |
88155 | 1356 (put 'gnus-treat-mail-picon 'highlight t) |
1357 | |
1358 (defcustom gnus-treat-newsgroups-picon | |
1359 (if (and (gnus-image-type-available-p 'xpm) | |
1360 (gnus-picons-installed-p)) | |
1361 'head nil) | |
1362 "Display picons in the Newsgroups and Followup-To headers. | |
1363 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1364 See Info node `(gnus)Customizing Articles' and Info node | |
1365 `(gnus)Picons' for details." | |
1366 :version "22.1" | |
1367 :group 'gnus-article-treat | |
1368 :group 'gnus-picon | |
1369 :link '(custom-manual "(gnus)Customizing Articles") | |
1370 :link '(custom-manual "(gnus)Picons") | |
1371 :type gnus-article-treat-head-custom) | |
1372 (put 'gnus-treat-newsgroups-picon 'highlight t) | |
1373 | |
1374 (defcustom gnus-treat-body-boundary | |
1375 (if (or gnus-treat-newsgroups-picon | |
1376 gnus-treat-mail-picon | |
1377 gnus-treat-from-picon) | |
1378 'head nil) | |
1379 "Draw a boundary at the end of the headers. | |
1380 Valid values are nil and `head'. | |
1381 See Info node `(gnus)Customizing Articles' for details." | |
1382 :version "22.1" | |
1383 :group 'gnus-article-treat | |
1384 :link '(custom-manual "(gnus)Customizing Articles") | |
1385 :type gnus-article-treat-head-custom) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1386 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1387 (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
|
1388 "Capitalize sentence-starting words. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1389 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1390 See Info node `(gnus)Customizing Articles' for details." |
33397 | 1391 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1392 :group 'gnus-article-treat |
88155 | 1393 :link '(custom-manual "(gnus)Customizing Articles") |
1394 :type gnus-article-treat-custom) | |
1395 | |
1396 (defcustom gnus-treat-wash-html nil | |
1397 "Format as HTML. | |
1398 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1399 See Info node `(gnus)Customizing Articles' for details." | |
1400 :version "22.1" | |
1401 :group 'gnus-article-treat | |
1402 :link '(custom-manual "(gnus)Customizing Articles") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1403 :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
|
1404 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1405 (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
|
1406 "Fill long lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1407 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1408 See Info node `(gnus)Customizing Articles' for details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1409 :group 'gnus-article-treat |
88155 | 1410 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1411 :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
|
1412 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1413 (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
|
1414 "Play sounds. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1415 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1416 See Info node `(gnus)Customizing Articles' for details." |
33397 | 1417 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1418 :group 'gnus-article-treat |
88155 | 1419 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1420 :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
|
1421 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1422 (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
|
1423 "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
|
1424 Valid values are nil, t, `head', `last', an integer or a predicate. |
88155 | 1425 See Info node `(gnus)Customizing Articles' for details." |
33397 | 1426 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1427 :group 'gnus-article-treat |
88155 | 1428 :link '(custom-manual "(gnus)Customizing Articles") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1429 :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
|
1430 |
88155 | 1431 (defcustom gnus-treat-x-pgp-sig nil |
1432 "Verify X-PGP-Sig. | |
1433 To automatically treat X-PGP-Sig, set it to head. | |
1434 Valid values are nil, t, `head', `last', an integer or a predicate. | |
1435 See Info node `(gnus)Customizing Articles' for details." | |
1436 :version "22.1" | |
1437 :group 'gnus-article-treat | |
1438 :group 'mime-security | |
1439 :link '(custom-manual "(gnus)Customizing Articles") | |
1440 :type gnus-article-treat-custom) | |
1441 | |
1442 (defvar gnus-article-encrypt-protocol-alist | |
1443 '(("PGP" . mml2015-self-encrypt))) | |
1444 | |
1445 ;; Set to nil if more than one protocol added to | |
1446 ;; gnus-article-encrypt-protocol-alist. | |
1447 (defcustom gnus-article-encrypt-protocol "PGP" | |
1448 "The protocol used for encrypt articles. | |
1449 It is a string, such as \"PGP\". If nil, ask user." | |
1450 :version "22.1" | |
1451 :type 'string | |
1452 :group 'mime-security) | |
1453 | |
1454 (defvar gnus-article-wash-function nil | |
1455 "Function used for converting HTML into text.") | |
1456 | |
1457 (defcustom gnus-use-idna (and (condition-case nil (require 'idna) (file-error)) | |
1458 (mm-coding-system-p 'utf-8) | |
1459 (executable-find idna-program)) | |
1460 "Whether IDNA decoding of headers is used when viewing messages. | |
1461 This requires GNU Libidn, and by default only enabled if it is found." | |
1462 :version "22.1" | |
1463 :group 'gnus-article-headers | |
1464 :type 'boolean) | |
1465 | |
1466 (defcustom gnus-article-over-scroll nil | |
1467 "If non-nil, allow scrolling the article buffer even when there no more text." | |
1468 :version "22.1" | |
1469 :group 'gnus-article | |
1470 :type 'boolean) | |
1471 | |
17493 | 1472 ;;; Internal variables |
1473 | |
88155 | 1474 (defvar gnus-english-month-names |
1475 '("January" "February" "March" "April" "May" "June" "July" "August" | |
1476 "September" "October" "November" "December")) | |
1477 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1478 (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
|
1479 (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
|
1480 (defvar gnus-article-emphasis-alist nil) |
88155 | 1481 (defvar gnus-article-image-alist nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1482 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1483 (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
|
1484 (defvar gnus-treatment-function-alist |
88155 | 1485 '((gnus-treat-x-pgp-sig gnus-article-verify-x-pgp-sig) |
1486 (gnus-treat-strip-banner gnus-article-strip-banner) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1487 (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
|
1488 (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
|
1489 (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
|
1490 (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
|
1491 (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
|
1492 (gnus-treat-strip-cr gnus-article-remove-cr) |
88155 | 1493 (gnus-treat-unsplit-urls gnus-article-unsplit-urls) |
1494 (gnus-treat-date-ut gnus-article-date-ut) | |
1495 (gnus-treat-date-local gnus-article-date-local) | |
1496 (gnus-treat-date-english gnus-article-date-english) | |
1497 (gnus-treat-date-original gnus-article-date-original) | |
1498 (gnus-treat-date-user-defined gnus-article-date-user) | |
1499 (gnus-treat-date-iso8601 gnus-article-date-iso8601) | |
1500 (gnus-treat-date-lapsed gnus-article-date-lapsed) | |
1501 (gnus-treat-display-x-face gnus-article-display-x-face) | |
1502 (gnus-treat-display-face gnus-article-display-face) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1503 (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
|
1504 (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
|
1505 (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
|
1506 (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers) |
88155 | 1507 (gnus-treat-leading-whitespace gnus-article-remove-leading-whitespace) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1508 (gnus-treat-strip-pem gnus-article-hide-pem) |
88155 | 1509 (gnus-treat-from-picon gnus-treat-from-picon) |
1510 (gnus-treat-mail-picon gnus-treat-mail-picon) | |
1511 (gnus-treat-newsgroups-picon gnus-treat-newsgroups-picon) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1512 (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
|
1513 (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
|
1514 (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
|
1515 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
|
1516 (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
|
1517 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
|
1518 (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
|
1519 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
|
1520 (gnus-treat-overstrike gnus-article-treat-overstrike) |
88155 | 1521 (gnus-treat-unfold-headers gnus-article-treat-unfold-headers) |
1522 (gnus-treat-fold-headers gnus-article-treat-fold-headers) | |
1523 (gnus-treat-fold-newsgroups gnus-article-treat-fold-newsgroups) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1524 (gnus-treat-buttonize-head gnus-article-add-buttons-to-head) |
88155 | 1525 (gnus-treat-display-smileys gnus-treat-smiley) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1526 (gnus-treat-capitalize-sentences gnus-article-capitalize-sentences) |
88155 | 1527 (gnus-treat-wash-html gnus-article-wash-html) |
1528 (gnus-treat-emphasize gnus-article-emphasize) | |
1529 (gnus-treat-hide-citation gnus-article-hide-citation) | |
1530 (gnus-treat-hide-citation-maybe gnus-article-hide-citation-maybe) | |
1531 (gnus-treat-highlight-citation gnus-article-highlight-citation) | |
1532 (gnus-treat-body-boundary gnus-article-treat-body-boundary) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1533 (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
|
1534 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1535 (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
|
1536 (defvar article-lapsed-timer nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1537 (defvar gnus-article-current-summary nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1538 |
17493 | 1539 (defvar gnus-article-mode-syntax-table |
1540 (let ((table (copy-syntax-table text-mode-syntax-table))) | |
88155 | 1541 ;; This causes the citation match run O(2^n). |
1542 ;; (modify-syntax-entry ?- "w" table) | |
1543 (modify-syntax-entry ?> ")<" table) | |
1544 (modify-syntax-entry ?< "(>" table) | |
1545 ;; make M-. in article buffers work for `foo' strings | |
1546 (modify-syntax-entry ?' " " table) | |
1547 (modify-syntax-entry ?` " " table) | |
17493 | 1548 table) |
1549 "Syntax table used in article mode buffers. | |
1550 Initialized from `text-mode-syntax-table.") | |
1551 | |
1552 (defvar gnus-save-article-buffer nil) | |
1553 | |
1554 (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
|
1555 (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
|
1556 (?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
|
1557 gnus-summary-mode-line-format-alist)) |
17493 | 1558 |
1559 (defvar gnus-number-of-articles-to-be-saved nil) | |
1560 | |
1561 (defvar gnus-inhibit-hiding nil) | |
1562 | |
88155 | 1563 (defvar gnus-article-edit-mode nil) |
1564 | |
1565 ;;; Macros for dealing with the article buffer. | |
1566 | |
1567 (defmacro gnus-with-article-headers (&rest forms) | |
1568 `(save-excursion | |
1569 (set-buffer gnus-article-buffer) | |
1570 (save-restriction | |
1571 (let ((inhibit-read-only t) | |
1572 (inhibit-point-motion-hooks t) | |
1573 (case-fold-search t)) | |
1574 (article-narrow-to-head) | |
1575 ,@forms)))) | |
1576 | |
1577 (put 'gnus-with-article-headers 'lisp-indent-function 0) | |
1578 (put 'gnus-with-article-headers 'edebug-form-spec '(body)) | |
1579 | |
1580 (defmacro gnus-with-article-buffer (&rest forms) | |
1581 `(save-excursion | |
1582 (set-buffer gnus-article-buffer) | |
1583 (let ((inhibit-read-only t)) | |
1584 ,@forms))) | |
1585 | |
1586 (put 'gnus-with-article-buffer 'lisp-indent-function 0) | |
1587 (put 'gnus-with-article-buffer 'edebug-form-spec '(body)) | |
1588 | |
1589 (defun gnus-article-goto-header (header) | |
1590 "Go to HEADER, which is a regular expression." | |
1591 (re-search-forward (concat "^\\(" header "\\):") nil t)) | |
1592 | |
17493 | 1593 (defsubst gnus-article-hide-text (b e props) |
1594 "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
|
1595 (gnus-add-text-properties-when 'article-type nil b e props) |
17493 | 1596 (when (memq 'intangible props) |
1597 (put-text-property | |
1598 (max (1- b) (point-min)) | |
1599 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
|
1600 |
17493 | 1601 (defsubst gnus-article-unhide-text (b e) |
1602 "Remove hidden text properties from region between B and E." | |
1603 (remove-text-properties b e gnus-hidden-properties) | |
1604 (when (memq 'intangible gnus-hidden-properties) | |
1605 (put-text-property (max (1- b) (point-min)) | |
1606 b 'intangible nil))) | |
1607 | |
1608 (defun gnus-article-hide-text-type (b e type) | |
1609 "Hide text of TYPE between B and E." | |
88155 | 1610 (gnus-add-wash-type type) |
17493 | 1611 (gnus-article-hide-text |
1612 b e (cons 'article-type (cons type gnus-hidden-properties)))) | |
1613 | |
1614 (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
|
1615 "Unhide text of TYPE between B and E." |
88155 | 1616 (gnus-delete-wash-type type) |
17493 | 1617 (remove-text-properties |
1618 b e (cons 'article-type (cons type gnus-hidden-properties))) | |
1619 (when (memq 'intangible gnus-hidden-properties) | |
1620 (put-text-property (max (1- b) (point-min)) | |
1621 b 'intangible nil))) | |
1622 | |
1623 (defun gnus-article-hide-text-of-type (type) | |
1624 "Hide text of TYPE in the current buffer." | |
1625 (save-excursion | |
1626 (let ((b (point-min)) | |
1627 (e (point-max))) | |
1628 (while (setq b (text-property-any b e 'article-type type)) | |
1629 (add-text-properties b (incf b) gnus-hidden-properties))))) | |
1630 | |
1631 (defun gnus-article-delete-text-of-type (type) | |
1632 "Delete text of TYPE in the current buffer." | |
1633 (save-excursion | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1634 (let ((b (point-min))) |
88155 | 1635 (if (eq type 'multipart) |
1636 ;; Remove MIME buttons associated with multipart/alternative parts. | |
1637 (progn | |
1638 (goto-char b) | |
1639 (while (if (get-text-property (point) 'gnus-part) | |
1640 (setq b (point)) | |
1641 (when (setq b (next-single-property-change (point) | |
1642 'gnus-part)) | |
1643 (goto-char b) | |
1644 t)) | |
1645 (end-of-line) | |
1646 (skip-chars-forward "\n") | |
1647 (when (eq (get-text-property b 'article-type) 'multipart) | |
1648 (delete-region b (point))))) | |
1649 (while (setq b (text-property-any b (point-max) 'article-type type)) | |
1650 (delete-region | |
1651 b (or (text-property-not-all b (point-max) 'article-type type) | |
1652 (point-max)))))))) | |
17493 | 1653 |
1654 (defun gnus-article-delete-invisible-text () | |
1655 "Delete all invisible text in the current buffer." | |
1656 (save-excursion | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1657 (let ((b (point-min))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1658 (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
|
1659 (delete-region |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1660 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
|
1661 (point-max))))))) |
17493 | 1662 |
1663 (defun gnus-article-text-type-exists-p (type) | |
1664 "Say whether any text of type TYPE exists in the buffer." | |
1665 (text-property-any (point-min) (point-max) 'article-type type)) | |
1666 | |
1667 (defsubst gnus-article-header-rank () | |
1668 "Give the rank of the string HEADER as given by `gnus-sorted-header-list'." | |
1669 (let ((list gnus-sorted-header-list) | |
88155 | 1670 (i 1)) |
17493 | 1671 (while list |
88155 | 1672 (if (looking-at (car list)) |
1673 (setq list nil) | |
1674 (setq list (cdr list)) | |
1675 (incf i))) | |
1676 i)) | |
17493 | 1677 |
1678 (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
|
1679 "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
|
1680 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1681 ;; 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
|
1682 (unless gnus-inhibit-hiding |
88155 | 1683 (let ((inhibit-read-only nil) |
1684 (case-fold-search t) | |
1685 (max (1+ (length gnus-sorted-header-list))) | |
1686 (inhibit-point-motion-hooks t) | |
1687 (cur (current-buffer)) | |
1688 ignored visible beg) | |
1689 (save-excursion | |
1690 ;; `gnus-ignored-headers' and `gnus-visible-headers' may be | |
1691 ;; group parameters, so we should go to the summary buffer. | |
1692 (when (prog1 | |
1693 (condition-case nil | |
1694 (progn (set-buffer gnus-summary-buffer) t) | |
1695 (error nil)) | |
1696 (setq ignored (when (not gnus-visible-headers) | |
1697 (cond ((stringp gnus-ignored-headers) | |
1698 gnus-ignored-headers) | |
1699 ((listp gnus-ignored-headers) | |
1700 (mapconcat 'identity | |
1701 gnus-ignored-headers | |
1702 "\\|")))) | |
1703 visible (cond ((stringp gnus-visible-headers) | |
1704 gnus-visible-headers) | |
1705 ((and gnus-visible-headers | |
1706 (listp gnus-visible-headers)) | |
1707 (mapconcat 'identity | |
1708 gnus-visible-headers | |
1709 "\\|"))))) | |
1710 (set-buffer cur)) | |
1711 (save-restriction | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1712 ;; 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
|
1713 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1714 ;; 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
|
1715 (while (looking-at "From ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1716 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1717 (unless (bobp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1718 (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
|
1719 ;; 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
|
1720 ;; 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
|
1721 ;; `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
|
1722 ;; 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
|
1723 ;; article buffer. |
88155 | 1724 (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
|
1725 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1726 ;; 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
|
1727 (put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1728 (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
|
1729 (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
|
1730 (and ignored |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1731 (not (looking-at ignored)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1732 (gnus-article-header-rank) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1733 (+ 2 max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1734 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1735 (message-sort-headers-1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1736 (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
|
1737 (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
|
1738 ;; We delete the unwanted headers. |
88155 | 1739 (gnus-add-wash-type 'headers) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1740 (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
|
1741 '(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
|
1742 (delete-region beg (point-max)))))))) |
17493 | 1743 |
1744 (defun article-hide-boring-headers (&optional arg) | |
1745 "Toggle hiding of headers that aren't very interesting. | |
1746 If given a negative prefix, always show; if given a positive prefix, | |
1747 always hide." | |
1748 (interactive (gnus-article-hidden-arg)) | |
1749 (when (and (not (gnus-article-check-hidden-text 'boring-headers arg)) | |
1750 (not gnus-show-all-headers)) | |
1751 (save-excursion | |
1752 (save-restriction | |
88155 | 1753 (let ((inhibit-read-only t) |
17493 | 1754 (list gnus-boring-article-headers) |
1755 (inhibit-point-motion-hooks t) | |
1756 elem) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1757 (article-narrow-to-head) |
17493 | 1758 (while list |
1759 (setq elem (pop list)) | |
1760 (goto-char (point-min)) | |
1761 (cond | |
1762 ;; Hide empty headers. | |
1763 ((eq elem 'empty) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1764 (while (re-search-forward "^[^: \t]+:[ \t]*\n[^ \t]" nil t) |
17493 | 1765 (forward-line -1) |
1766 (gnus-article-hide-text-type | |
88155 | 1767 (gnus-point-at-bol) |
17493 | 1768 (progn |
1769 (end-of-line) | |
1770 (if (re-search-forward "^[^ \t]" nil t) | |
1771 (match-beginning 0) | |
1772 (point-max))) | |
1773 'boring-headers))) | |
1774 ;; Hide boring Newsgroups header. | |
1775 ((eq elem 'newsgroups) | |
88155 | 1776 (when (gnus-string-equal |
1777 (gnus-fetch-field "newsgroups") | |
1778 (gnus-group-real-name | |
1779 (if (boundp 'gnus-newsgroup-name) | |
1780 gnus-newsgroup-name | |
1781 ""))) | |
17493 | 1782 (gnus-article-hide-header "newsgroups"))) |
88155 | 1783 ((eq elem 'to-address) |
1784 (let ((to (message-fetch-field "to")) | |
1785 (to-address | |
1786 (gnus-parameter-to-address | |
1787 (if (boundp 'gnus-newsgroup-name) | |
1788 gnus-newsgroup-name "")))) | |
1789 (when (and to to-address | |
1790 (ignore-errors | |
1791 (gnus-string-equal | |
1792 ;; only one address in To | |
1793 (nth 1 (mail-extract-address-components to)) | |
1794 to-address))) | |
1795 (gnus-article-hide-header "to")))) | |
1796 ((eq elem 'to-list) | |
1797 (let ((to (message-fetch-field "to")) | |
1798 (to-list | |
1799 (gnus-parameter-to-list | |
1800 (if (boundp 'gnus-newsgroup-name) | |
1801 gnus-newsgroup-name "")))) | |
1802 (when (and to to-list | |
1803 (ignore-errors | |
1804 (gnus-string-equal | |
1805 ;; only one address in To | |
1806 (nth 1 (mail-extract-address-components to)) | |
1807 to-list))) | |
1808 (gnus-article-hide-header "to")))) | |
1809 ((eq elem 'cc-list) | |
1810 (let ((cc (message-fetch-field "cc")) | |
1811 (to-list | |
1812 (gnus-parameter-to-list | |
1813 (if (boundp 'gnus-newsgroup-name) | |
1814 gnus-newsgroup-name "")))) | |
1815 (when (and cc to-list | |
1816 (ignore-errors | |
1817 (gnus-string-equal | |
1818 ;; only one address in CC | |
1819 (nth 1 (mail-extract-address-components cc)) | |
1820 to-list))) | |
1821 (gnus-article-hide-header "cc")))) | |
17493 | 1822 ((eq elem 'followup-to) |
88155 | 1823 (when (gnus-string-equal |
1824 (message-fetch-field "followup-to") | |
1825 (message-fetch-field "newsgroups")) | |
17493 | 1826 (gnus-article-hide-header "followup-to"))) |
1827 ((eq elem 'reply-to) | |
88155 | 1828 (if (gnus-group-find-parameter |
1829 gnus-newsgroup-name 'broken-reply-to) | |
1830 (gnus-article-hide-header "reply-to") | |
1831 (let ((from (message-fetch-field "from")) | |
1832 (reply-to (message-fetch-field "reply-to"))) | |
1833 (when | |
1834 (and | |
17493 | 1835 from reply-to |
1836 (ignore-errors | |
1837 (equal | |
88155 | 1838 (sort (mapcar |
1839 (lambda (x) (downcase (cadr x))) | |
1840 (mail-extract-address-components from t)) | |
1841 'string<) | |
1842 (sort (mapcar | |
1843 (lambda (x) (downcase (cadr x))) | |
1844 (mail-extract-address-components reply-to t)) | |
1845 'string<)))) | |
1846 (gnus-article-hide-header "reply-to"))))) | |
17493 | 1847 ((eq elem 'date) |
1848 (let ((date (message-fetch-field "date"))) | |
1849 (when (and date | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1850 (< (days-between (current-time-string) date) |
17493 | 1851 4)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1852 (gnus-article-hide-header "date")))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1853 ((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
|
1854 (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
|
1855 (cc (message-fetch-field "cc"))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1856 (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
|
1857 (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
|
1858 (when (> (length cc) 1024) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1859 (gnus-article-hide-header "cc")))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1860 ((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
|
1861 (let ((to-count 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1862 (cc-count 0)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1863 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1864 (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
|
1865 (setq to-count (1+ to-count))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1866 (when (> to-count 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1867 (while (> to-count 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1868 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1869 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1870 (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
|
1871 (forward-line -1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1872 (narrow-to-region (point) (point-max)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1873 (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
|
1874 (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
|
1875 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1876 (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
|
1877 (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
|
1878 (when (> cc-count 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1879 (while (> cc-count 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1880 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1881 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1882 (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
|
1883 (forward-line -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1884 (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
|
1885 (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
|
1886 (setq cc-count (1- cc-count))))))))))))) |
17493 | 1887 |
1888 (defun gnus-article-hide-header (header) | |
1889 (save-excursion | |
1890 (goto-char (point-min)) | |
1891 (when (re-search-forward (concat "^" header ":") nil t) | |
1892 (gnus-article-hide-text-type | |
88155 | 1893 (gnus-point-at-bol) |
17493 | 1894 (progn |
1895 (end-of-line) | |
1896 (if (re-search-forward "^[^ \t]" nil t) | |
1897 (match-beginning 0) | |
1898 (point-max))) | |
1899 'boring-headers)))) | |
1900 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1901 (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
|
1902 "Length of normalized headers.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1903 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1904 (defun article-normalize-headers () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1905 "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
|
1906 (interactive) |
88155 | 1907 (let ((inhibit-read-only t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1908 column) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1909 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1910 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1911 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1912 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1913 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1914 ((< (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
|
1915 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
|
1916 (end-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1917 (insert (make-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1918 (- 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
|
1919 ? ))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1920 ((> 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
|
1921 (gnus-put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1922 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1923 (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
|
1924 (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1925 (gnus-point-at-eol) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1926 'invisible t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1927 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1928 ;; Do nothing. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1929 )) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1930 (forward-line 1)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1931 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1932 (defun article-treat-dumbquotes () |
88155 | 1933 "Translate M****s*** sm*rtq**t*s and other symbols into proper text. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1934 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
|
1935 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
|
1936 |
88155 | 1937 Sm*rtq**t*s are M****s***'s unilateral extension to the |
1938 iso-8859-1 character map in an attempt to provide more quoting | |
1939 characters. If you see something like \\222 or \\264 where | |
1940 you're expecting some kind of apostrophe or quotation mark, then | |
1941 try this wash." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1942 (interactive) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1943 (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
|
1944 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1945 (defun article-translate-characters (from to) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1946 "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
|
1947 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
|
1948 characters to translate to." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1949 (save-excursion |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1950 (when (article-goto-body) |
88155 | 1951 (let ((inhibit-read-only t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1952 (x (make-string 225 ?x)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1953 (i -1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1954 (while (< (incf i) (length x)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1955 (aset x i i)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1956 (setq i 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1957 (while (< i (length from)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1958 (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
|
1959 (incf i)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1960 (translate-region (point) (point-max) x))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1961 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1962 (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
|
1963 "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
|
1964 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
|
1965 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1966 (when (article-goto-body) |
88155 | 1967 (let ((inhibit-read-only t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1968 elem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1969 (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
|
1970 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1971 (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
|
1972 (replace-match (cadr elem))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1973 |
17493 | 1974 (defun article-treat-overstrike () |
1975 "Translate overstrikes into bold text." | |
1976 (interactive) | |
1977 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1978 (when (article-goto-body) |
88155 | 1979 (let ((inhibit-read-only t)) |
17493 | 1980 (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
|
1981 (let ((next (char-after)) |
17493 | 1982 (previous (char-after (- (point) 2)))) |
1983 ;; We do the boldification/underlining by hiding the | |
1984 ;; overstrikes and putting the proper text property | |
1985 ;; on the letters. | |
1986 (cond | |
1987 ((eq next previous) | |
1988 (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike) | |
1989 (put-text-property (point) (1+ (point)) 'face 'bold)) | |
1990 ((eq next ?_) | |
1991 (gnus-article-hide-text-type | |
1992 (1- (point)) (1+ (point)) 'overstrike) | |
1993 (put-text-property | |
1994 (- (point) 2) (1- (point)) 'face 'underline)) | |
1995 ((eq previous ?_) | |
1996 (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike) | |
1997 (put-text-property | |
1998 (point) (1+ (point)) 'face 'underline))))))))) | |
1999 | |
88155 | 2000 (defun gnus-article-treat-unfold-headers () |
2001 "Unfold folded message headers. | |
2002 Only the headers that fit into the current window width will be | |
2003 unfolded." | |
2004 (interactive) | |
2005 (gnus-with-article-headers | |
2006 (let (length) | |
2007 (while (not (eobp)) | |
2008 (save-restriction | |
2009 (mail-header-narrow-to-field) | |
2010 (let ((header (buffer-string))) | |
2011 (with-temp-buffer | |
2012 (insert header) | |
2013 (goto-char (point-min)) | |
2014 (while (re-search-forward "\n[\t ]" nil t) | |
2015 (replace-match " " t t))) | |
2016 (setq length (- (point-max) (point-min) 1))) | |
2017 (when (< length (window-width)) | |
2018 (while (re-search-forward "\n[\t ]" nil t) | |
2019 (replace-match " " t t))) | |
2020 (goto-char (point-max))))))) | |
2021 | |
2022 (defun gnus-article-treat-fold-headers () | |
2023 "Fold message headers." | |
2024 (interactive) | |
2025 (gnus-with-article-headers | |
2026 (while (not (eobp)) | |
2027 (save-restriction | |
2028 (mail-header-narrow-to-field) | |
2029 (mail-header-fold-field) | |
2030 (goto-char (point-max)))))) | |
2031 | |
2032 (defun gnus-treat-smiley () | |
2033 "Toggle display of textual emoticons (\"smileys\") as small graphical icons." | |
2034 (interactive) | |
2035 (gnus-with-article-buffer | |
2036 (if (memq 'smiley gnus-article-wash-types) | |
2037 (gnus-delete-images 'smiley) | |
2038 (article-goto-body) | |
2039 (let ((images (smiley-region (point) (point-max)))) | |
2040 (when images | |
2041 (gnus-add-wash-type 'smiley) | |
2042 (dolist (image images) | |
2043 (gnus-add-image 'smiley image))))))) | |
2044 | |
2045 (defun gnus-article-remove-images () | |
2046 "Remove all images from the article buffer." | |
2047 (interactive) | |
2048 (gnus-with-article-buffer | |
2049 (dolist (elem gnus-article-image-alist) | |
2050 (gnus-delete-images (car elem))))) | |
2051 | |
2052 (defun gnus-article-treat-fold-newsgroups () | |
2053 "Unfold folded message headers. | |
2054 Only the headers that fit into the current window width will be | |
2055 unfolded." | |
2056 (interactive) | |
2057 (gnus-with-article-headers | |
2058 (while (gnus-article-goto-header "newsgroups\\|followup-to") | |
2059 (save-restriction | |
2060 (mail-header-narrow-to-field) | |
2061 (while (re-search-forward ", *" nil t) | |
2062 (replace-match ", " t t)) | |
2063 (mail-header-fold-field) | |
2064 (goto-char (point-max)))))) | |
2065 | |
2066 (defun gnus-article-treat-body-boundary () | |
2067 "Place a boundary line at the end of the headers." | |
2068 (interactive) | |
2069 (when (and gnus-body-boundary-delimiter | |
2070 (> (length gnus-body-boundary-delimiter) 0)) | |
2071 (gnus-with-article-headers | |
2072 (goto-char (point-max)) | |
2073 (let ((start (point))) | |
2074 (insert "X-Boundary: ") | |
2075 (gnus-add-text-properties start (point) '(invisible t intangible t)) | |
2076 (insert (let (str) | |
2077 (while (>= (1- (window-width)) (length str)) | |
2078 (setq str (concat str gnus-body-boundary-delimiter))) | |
2079 (substring str 0 (1- (window-width)))) | |
2080 "\n") | |
2081 (gnus-put-text-property start (point) 'gnus-decoration 'header))))) | |
2082 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2083 (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
|
2084 "Fill lines that are wider than the window width." |
17493 | 2085 (interactive) |
2086 (save-excursion | |
88155 | 2087 (let ((inhibit-read-only t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2088 (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
|
2089 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2090 (article-goto-body) |
43273
b8391c00e2c9
* gnus-art.el (gnus-article-edit-mode): Use define-derived-mode.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
43166
diff
changeset
|
2091 (let ((adaptive-fill-mode nil)) ;Why? -sm |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2092 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2093 (end-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2094 (when (>= (current-column) (min fill-column width)) |
88155 | 2095 (narrow-to-region (min (1+ (point)) (point-max)) |
2096 (gnus-point-at-bol)) | |
2097 (let ((goback (point-marker))) | |
2098 (fill-paragraph nil) | |
2099 (goto-char (marker-position goback))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2100 (widen)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2101 (forward-line 1))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2102 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2103 (defun article-capitalize-sentences () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2104 "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
|
2105 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2106 (save-excursion |
88155 | 2107 (let ((inhibit-read-only t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2108 (paragraph-start "^[\n\^L]")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2109 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2110 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2111 (capitalize-word 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2112 (forward-sentence))))) |
17493 | 2113 |
2114 (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
|
2115 "Remove trailing CRs and then translate remaining CRs into LFs." |
17493 | 2116 (interactive) |
2117 (save-excursion | |
88155 | 2118 (let ((inhibit-read-only t)) |
17493 | 2119 (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
|
2120 (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
|
2121 (replace-match "" t t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2122 (goto-char (point-min)) |
17493 | 2123 (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
|
2124 (replace-match "\n" t t))))) |
17493 | 2125 |
2126 (defun article-remove-trailing-blank-lines () | |
2127 "Remove all trailing blank lines from the article." | |
2128 (interactive) | |
2129 (save-excursion | |
88155 | 2130 (let ((inhibit-read-only t)) |
17493 | 2131 (goto-char (point-max)) |
2132 (delete-region | |
2133 (point) | |
2134 (progn | |
2135 (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
|
2136 (looking-at "^[ \t]*$") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2137 (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
|
2138 (point) (gnus-point-at-eol)))) |
17493 | 2139 (forward-line -1)) |
2140 (forward-line 1) | |
2141 (point)))))) | |
2142 | |
88155 | 2143 (defun article-display-face () |
2144 "Display any Face headers in the header." | |
2145 (interactive) | |
2146 (let ((wash-face-p buffer-read-only)) | |
2147 (gnus-with-article-headers | |
2148 ;; When displaying parts, this function can be called several times on | |
2149 ;; the same article, without any intended toggle semantic (as typing `W | |
2150 ;; D d' would have). So face deletion must occur only when we come from | |
2151 ;; an interactive command, that is when the *Article* buffer is | |
2152 ;; read-only. | |
2153 (if (and wash-face-p (memq 'face gnus-article-wash-types)) | |
2154 (gnus-delete-images 'face) | |
2155 (let (face faces from) | |
2156 (save-current-buffer | |
2157 (when (and wash-face-p | |
2158 (gnus-buffer-live-p gnus-original-article-buffer) | |
2159 (not (re-search-forward "^Face:[\t ]*" nil t))) | |
2160 (set-buffer gnus-original-article-buffer)) | |
2161 (save-restriction | |
2162 (mail-narrow-to-head) | |
2163 (while (gnus-article-goto-header "Face") | |
2164 (push (mail-header-field-value) faces)))) | |
2165 (when faces | |
2166 (goto-char (point-min)) | |
2167 (let ((from (gnus-article-goto-header "from")) | |
2168 png image) | |
2169 (unless from | |
2170 (insert "From:") | |
2171 (setq from (point)) | |
2172 (insert "[no `from' set]\n")) | |
2173 (while faces | |
2174 (when (setq png (gnus-convert-face-to-png (pop faces))) | |
2175 (setq image (gnus-create-image png 'png t)) | |
2176 (goto-char from) | |
2177 (gnus-add-wash-type 'face) | |
2178 (gnus-add-image 'face image) | |
2179 (gnus-put-image image nil 'face)))))))))) | |
2180 | |
17493 | 2181 (defun article-display-x-face (&optional force) |
2182 "Look for an X-Face header and display it if present." | |
2183 (interactive (list 'force)) | |
88155 | 2184 (let ((wash-face-p buffer-read-only)) ;; When type `W f' |
2185 (gnus-with-article-headers | |
2186 ;; Delete the old process, if any. | |
2187 (when (process-status "article-x-face") | |
2188 (delete-process "article-x-face")) | |
2189 ;; See the comment in `article-display-face'. | |
2190 (if (and wash-face-p (memq 'xface gnus-article-wash-types)) | |
2191 ;; We have already displayed X-Faces, so we remove them | |
2192 ;; instead. | |
2193 (gnus-delete-images 'xface) | |
2194 ;; Display X-Faces. | |
2195 (let (x-faces from face) | |
2196 (save-current-buffer | |
2197 (when (and wash-face-p | |
2198 (gnus-buffer-live-p gnus-original-article-buffer) | |
2199 (not (re-search-forward "^X-Face:[\t ]*" nil t))) | |
2200 ;; If type `W f', use gnus-original-article-buffer, | |
2201 ;; otherwise use the current buffer because displaying | |
2202 ;; RFC822 parts calls this function too. | |
2203 (set-buffer gnus-original-article-buffer)) | |
2204 (save-restriction | |
2205 (mail-narrow-to-head) | |
2206 (while (gnus-article-goto-header "X-Face") | |
2207 (push (mail-header-field-value) x-faces)) | |
2208 (setq from (message-fetch-field "from")))) | |
2209 ;; Sending multiple EOFs to xv doesn't work, so we only do a | |
2210 ;; single external face. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2211 (when (stringp gnus-article-x-face-command) |
88155 | 2212 (setq x-faces (list (car x-faces)))) |
2213 (when (and x-faces | |
2214 gnus-article-x-face-command | |
2215 (or force | |
2216 ;; Check whether this face is censored. | |
2217 (not gnus-article-x-face-too-ugly) | |
2218 (and from | |
2219 (not (string-match gnus-article-x-face-too-ugly | |
2220 from))))) | |
2221 (while (setq face (pop x-faces)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2222 ;; We display the face. |
88155 | 2223 (cond ((stringp gnus-article-x-face-command) |
2224 ;; The command is a string, so we interpret the command | |
2225 ;; as a, well, command, and fork it off. | |
2226 (let ((process-connection-type nil)) | |
2227 (gnus-set-process-query-on-exit-flag | |
2228 (start-process | |
2229 "article-x-face" nil shell-file-name | |
2230 shell-command-switch gnus-article-x-face-command) | |
2231 nil) | |
2232 (with-temp-buffer | |
2233 (insert face) | |
2234 (process-send-region "article-x-face" | |
2235 (point-min) (point-max))) | |
2236 (process-send-eof "article-x-face"))) | |
2237 ((functionp gnus-article-x-face-command) | |
2238 ;; The command is a lisp function, so we call it. | |
2239 (funcall gnus-article-x-face-command face)) | |
2240 (t | |
2241 (error "%s is not a function" | |
2242 gnus-article-x-face-command)))))))))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2243 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2244 (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
|
2245 "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
|
2246 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2247 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2248 (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
|
2249 (let ((inhibit-point-motion-hooks t) |
88155 | 2250 (inhibit-read-only t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2251 (mail-parse-charset gnus-newsgroup-charset) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2252 (mail-parse-ignored-charsets |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2253 (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
|
2254 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2255 (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
|
2256 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2257 (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
|
2258 "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
|
2259 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
|
2260 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2261 (let ((inhibit-point-motion-hooks t) (case-fold-search t) |
88155 | 2262 (inhibit-read-only t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2263 (mail-parse-charset gnus-newsgroup-charset) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2264 (mail-parse-ignored-charsets |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2265 (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
|
2266 (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
|
2267 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2268 gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2269 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
|
2270 (save-excursion |
17493 | 2271 (save-restriction |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2272 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2273 (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
|
2274 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
|
2275 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
|
2276 (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
|
2277 charset (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2278 (prompt |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2279 (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
|
2280 (ctl |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2281 (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
|
2282 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
|
2283 (when cte |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2284 (setq cte (mail-header-strip cte))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2285 (if (and ctl (not (string-match "/" (car ctl)))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2286 (setq ctl nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2287 (goto-char (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2288 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2289 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2290 (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
|
2291 (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
|
2292 (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
|
2293 ;; 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
|
2294 (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
|
2295 (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
|
2296 (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
|
2297 (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
|
2298 (mm-decode-body |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2299 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
|
2300 (gnus-strip-whitespace cte)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2301 (car ctl))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2302 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2303 (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
|
2304 "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
|
2305 (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
|
2306 (mail-parse-charset gnus-newsgroup-charset) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2307 (mail-parse-ignored-charsets |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2308 (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
|
2309 (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
|
2310 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2311 gnus-newsgroup-ignored-charsets)) |
88155 | 2312 (inhibit-read-only t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2313 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2314 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2315 (funcall gnus-decode-header-function (point-min) (point-max))))) |
17493 | 2316 |
88155 | 2317 (defun article-decode-group-name () |
2318 "Decode group names in `Newsgroups:'." | |
2319 (let ((inhibit-point-motion-hooks t) | |
2320 (inhibit-read-only t) | |
2321 (method (gnus-find-method-for-group gnus-newsgroup-name))) | |
2322 (when (and (or gnus-group-name-charset-method-alist | |
2323 gnus-group-name-charset-group-alist) | |
2324 (gnus-buffer-live-p gnus-original-article-buffer)) | |
2325 (save-restriction | |
2326 (article-narrow-to-head) | |
2327 (with-current-buffer gnus-original-article-buffer | |
2328 (goto-char (point-min))) | |
2329 (while (re-search-forward | |
2330 "^Newsgroups:\\(\\(.\\|\n[\t ]\\)*\\)\n[^\t ]" nil t) | |
2331 (replace-match (save-match-data | |
2332 (gnus-decode-newsgroups | |
2333 ;; XXX how to use data in article buffer? | |
2334 (with-current-buffer gnus-original-article-buffer | |
2335 (re-search-forward | |
2336 "^Newsgroups:\\(\\(.\\|\n[\t ]\\)*\\)\n[^\t ]" | |
2337 nil t) | |
2338 (match-string 1)) | |
2339 gnus-newsgroup-name method)) | |
2340 t t nil 1)) | |
2341 (goto-char (point-min)) | |
2342 (with-current-buffer gnus-original-article-buffer | |
2343 (goto-char (point-min))) | |
2344 (while (re-search-forward | |
2345 "^Followup-To:\\(\\(.\\|\n[\t ]\\)*\\)\n[^\t ]" nil t) | |
2346 (replace-match (save-match-data | |
2347 (gnus-decode-newsgroups | |
2348 ;; XXX how to use data in article buffer? | |
2349 (with-current-buffer gnus-original-article-buffer | |
2350 (re-search-forward | |
2351 "^Followup-To:\\(\\(.\\|\n[\t ]\\)*\\)\n[^\t ]" | |
2352 nil t) | |
2353 (match-string 1)) | |
2354 gnus-newsgroup-name method)) | |
2355 t t nil 1)))))) | |
2356 | |
2357 (autoload 'idna-to-unicode "idna") | |
2358 | |
2359 (defun article-decode-idna-rhs () | |
2360 "Decode IDNA strings in RHS in various headers in current buffer. | |
2361 The following headers are decoded: From:, To:, Cc:, Reply-To:, | |
2362 Mail-Reply-To: and Mail-Followup-To:." | |
2363 (when gnus-use-idna | |
2364 (save-restriction | |
2365 (let ((inhibit-point-motion-hooks t) | |
2366 (inhibit-read-only t)) | |
2367 (article-narrow-to-head) | |
2368 (goto-char (point-min)) | |
2369 (while (re-search-forward "@[^ \t\n\r,>]*\\(xn--[-A-Za-z0-9.]*\\)[ \t\n\r,>]" nil t) | |
2370 (let (ace unicode) | |
2371 (when (save-match-data | |
2372 (and (setq ace (match-string 1)) | |
2373 (save-excursion | |
2374 (and (re-search-backward "^[^ \t]" nil t) | |
2375 (looking-at "From\\|To\\|Cc\\|Reply-To\\|Mail-Reply-To\\|Mail-Followup-To"))) | |
2376 (setq unicode (idna-to-unicode ace)))) | |
2377 (unless (string= ace unicode) | |
2378 (replace-match unicode nil nil nil 1))))))))) | |
2379 | |
2380 (defun article-de-quoted-unreadable (&optional force read-charset) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2381 "Translate a quoted-printable-encoded article. |
17493 | 2382 If FORCE, decode the article whether it is marked as quoted-printable |
88155 | 2383 or not. |
2384 If READ-CHARSET, ask for a coding system." | |
2385 (interactive (list 'force current-prefix-arg)) | |
17493 | 2386 (save-excursion |
88155 | 2387 (let ((inhibit-read-only t) type charset) |
31785 | 2388 (if (gnus-buffer-live-p gnus-original-article-buffer) |
2389 (with-current-buffer gnus-original-article-buffer | |
2390 (setq type | |
2391 (gnus-fetch-field "content-transfer-encoding")) | |
2392 (let* ((ct (gnus-fetch-field "content-type")) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2393 (ctl (and ct |
31785 | 2394 (ignore-errors |
2395 (mail-header-parse-content-type ct))))) | |
2396 (setq charset (and ctl | |
2397 (mail-content-type-get ctl 'charset))) | |
2398 (if (stringp charset) | |
2399 (setq charset (intern (downcase charset))))))) | |
88155 | 2400 (if read-charset |
2401 (setq charset (mm-read-coding-system "Charset: " charset))) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2402 (unless charset |
31785 | 2403 (setq charset gnus-newsgroup-charset)) |
17493 | 2404 (when (or force |
32210 | 2405 (and type (let ((case-fold-search t)) |
2406 (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
|
2407 (article-goto-body) |
32210 | 2408 (quoted-printable-decode-region |
2409 (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
|
2410 |
88155 | 2411 (defun article-de-base64-unreadable (&optional force read-charset) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2412 "Translate a base64 article. |
88155 | 2413 If FORCE, decode the article whether it is marked as base64 not. |
2414 If READ-CHARSET, ask for a coding system." | |
2415 (interactive (list 'force current-prefix-arg)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2416 (save-excursion |
88155 | 2417 (let ((inhibit-read-only t) type charset) |
31785 | 2418 (if (gnus-buffer-live-p gnus-original-article-buffer) |
2419 (with-current-buffer gnus-original-article-buffer | |
2420 (setq type | |
2421 (gnus-fetch-field "content-transfer-encoding")) | |
2422 (let* ((ct (gnus-fetch-field "content-type")) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2423 (ctl (and ct |
31785 | 2424 (ignore-errors |
2425 (mail-header-parse-content-type ct))))) | |
2426 (setq charset (and ctl | |
2427 (mail-content-type-get ctl 'charset))) | |
2428 (if (stringp charset) | |
2429 (setq charset (intern (downcase charset))))))) | |
88155 | 2430 (if read-charset |
2431 (setq charset (mm-read-coding-system "Charset: " charset))) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2432 (unless charset |
31785 | 2433 (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
|
2434 (when (or force |
32210 | 2435 (and type (let ((case-fold-search t)) |
2436 (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
|
2437 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2438 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2439 (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
|
2440 (base64-decode-region (point-min) (point-max)) |
32210 | 2441 (mm-decode-coding-region |
2442 (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
|
2443 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2444 (eval-when-compile |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2445 (require 'rfc1843)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2446 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2447 (defun article-decode-HZ () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2448 "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
|
2449 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2450 (require 'rfc1843) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2451 (save-excursion |
88155 | 2452 (let ((inhibit-read-only t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2453 (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
|
2454 |
88155 | 2455 (defun article-unsplit-urls () |
2456 "Remove the newlines that some other mailers insert into URLs." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2457 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2458 (save-excursion |
88155 | 2459 (let ((inhibit-read-only t)) |
2460 (goto-char (point-min)) | |
2461 (while (re-search-forward | |
2462 "\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t) | |
2463 (replace-match "\\1\\3" t))) | |
2464 (when (interactive-p) | |
2465 (gnus-treat-article nil)))) | |
2466 | |
2467 | |
2468 (defun article-wash-html (&optional read-charset) | |
2469 "Format an HTML article. | |
2470 If READ-CHARSET, ask for a coding system." | |
2471 (interactive "P") | |
2472 (save-excursion | |
2473 (let ((inhibit-read-only t) | |
31785 | 2474 charset) |
88155 | 2475 (when (gnus-buffer-live-p gnus-original-article-buffer) |
2476 (with-current-buffer gnus-original-article-buffer | |
2477 (let* ((ct (gnus-fetch-field "content-type")) | |
2478 (ctl (and ct | |
2479 (ignore-errors | |
2480 (mail-header-parse-content-type ct))))) | |
2481 (setq charset (and ctl | |
2482 (mail-content-type-get ctl 'charset))) | |
2483 (when (stringp charset) | |
2484 (setq charset (intern (downcase charset))))))) | |
2485 (when read-charset | |
2486 (setq charset (mm-read-coding-system "Charset: " charset))) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2487 (unless charset |
31785 | 2488 (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
|
2489 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2490 (save-window-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2491 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2492 (narrow-to-region (point) (point-max)) |
88155 | 2493 (let* ((func (or gnus-article-wash-function mm-text-html-renderer)) |
2494 (entry (assq func mm-text-html-washer-alist))) | |
2495 (when entry | |
2496 (setq func (cdr entry))) | |
2497 (cond | |
2498 ((functionp func) | |
2499 (funcall func)) | |
2500 (t | |
2501 (apply (car func) (cdr func)))))))))) | |
2502 | |
2503 (defun gnus-article-wash-html-with-w3 () | |
2504 "Wash the current buffer with w3." | |
2505 (mm-setup-w3) | |
2506 (let ((w3-strict-width (window-width)) | |
2507 (url-standalone-mode t) | |
2508 (url-gateway-unplugged t) | |
2509 (w3-honor-stylesheets nil)) | |
2510 (condition-case () | |
2511 (w3-region (point-min) (point-max)) | |
2512 (error)))) | |
2513 | |
2514 (defun gnus-article-wash-html-with-w3m () | |
2515 "Wash the current buffer with emacs-w3m." | |
2516 (mm-setup-w3m) | |
2517 (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp) | |
2518 w3m-force-redisplay) | |
2519 (w3m-region (point-min) (point-max))) | |
2520 (when (and mm-inline-text-html-with-w3m-keymap | |
2521 (boundp 'w3m-minor-mode-map) | |
2522 w3m-minor-mode-map) | |
2523 (add-text-properties | |
2524 (point-min) (point-max) | |
2525 (list 'keymap w3m-minor-mode-map | |
2526 ;; Put the mark meaning this part was rendered by emacs-w3m. | |
2527 'mm-inline-text-html-with-w3m t)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2528 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2529 (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
|
2530 "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
|
2531 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
|
2532 (interactive) |
88155 | 2533 (let ((inhibit-point-motion-hooks t) |
2534 (regexp (if (consp gnus-list-identifiers) | |
2535 (mapconcat 'identity gnus-list-identifiers " *\\|") | |
2536 gnus-list-identifiers)) | |
2537 (inhibit-read-only t)) | |
2538 (when regexp | |
2539 (save-excursion | |
2540 (save-restriction | |
2541 (article-narrow-to-head) | |
2542 (goto-char (point-min)) | |
2543 (while (re-search-forward | |
2544 (concat "^Subject: +\\(R[Ee]: +\\)*\\(" regexp " *\\)") | |
2545 nil t) | |
2546 (delete-region (match-beginning 2) (match-end 0)) | |
2547 (beginning-of-line)) | |
2548 (when (re-search-forward | |
2549 "^Subject: +\\(\\(R[Ee]: +\\)+\\)R[Ee]: +" nil t) | |
2550 (delete-region (match-beginning 1) (match-end 1)))))))) | |
17493 | 2551 |
2552 (defun article-hide-pem (&optional arg) | |
2553 "Toggle hiding of any PEM headers and signatures in the current article. | |
2554 If given a negative prefix, always show; if given a positive prefix, | |
2555 always hide." | |
2556 (interactive (gnus-article-hidden-arg)) | |
2557 (unless (gnus-article-check-hidden-text 'pem arg) | |
2558 (save-excursion | |
88155 | 2559 (let ((inhibit-read-only t) end) |
17493 | 2560 (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
|
2561 ;; 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
|
2562 (when (and (search-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2563 "\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
|
2564 nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2565 (setq end (1+ (match-beginning 0)))) |
88155 | 2566 (gnus-add-wash-type 'pem) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2567 (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
|
2568 end |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2569 (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
|
2570 (match-end 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2571 (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2572 'pem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2573 ;; 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
|
2574 (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
|
2575 nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2576 (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
|
2577 (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
|
2578 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2579 (defun article-strip-banner () |
88155 | 2580 "Strip the banners specified by the `banner' group parameter and by |
2581 `gnus-article-address-banner-alist'." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2582 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2583 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2584 (save-restriction |
88155 | 2585 (let ((inhibit-point-motion-hooks t)) |
2586 (when (gnus-parameter-banner gnus-newsgroup-name) | |
2587 (article-really-strip-banner | |
2588 (gnus-parameter-banner gnus-newsgroup-name))) | |
2589 (when gnus-article-address-banner-alist | |
2590 (article-really-strip-banner | |
2591 (let ((from (save-restriction | |
2592 (widen) | |
2593 (article-narrow-to-head) | |
2594 (mail-fetch-field "from")))) | |
2595 (when (and from | |
2596 (setq from | |
2597 (caar (mail-header-parse-addresses from)))) | |
2598 (catch 'found | |
2599 (dolist (pair gnus-article-address-banner-alist) | |
2600 (when (string-match (car pair) from) | |
2601 (throw 'found (cdr pair))))))))))))) | |
2602 | |
2603 (defun article-really-strip-banner (banner) | |
2604 "Strip the banner specified by the argument." | |
2605 (save-excursion | |
2606 (save-restriction | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2607 (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
|
2608 (gnus-signature-limit nil) |
88155 | 2609 (inhibit-read-only t)) |
2610 (article-goto-body) | |
2611 (cond | |
2612 ((eq banner 'signature) | |
2613 (when (gnus-article-narrow-to-signature) | |
2614 (widen) | |
2615 (forward-line -1) | |
2616 (delete-region (point) (point-max)))) | |
2617 ((symbolp banner) | |
2618 (if (setq banner (cdr (assq banner gnus-article-banner-alist))) | |
2619 (while (re-search-forward banner nil t) | |
2620 (delete-region (match-beginning 0) (match-end 0))))) | |
2621 ((stringp banner) | |
2622 (while (re-search-forward banner nil t) | |
2623 (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
|
2624 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2625 (defun article-babel () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2626 "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
|
2627 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2628 (require 'babel) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2629 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2630 (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
|
2631 (when (article-goto-body) |
88155 | 2632 (let* ((inhibit-read-only t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2633 (start (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2634 (end (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2635 (orig (buffer-substring start end)) |
88155 | 2636 (trans (babel-as-string orig))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2637 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2638 (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
|
2639 (delete-region start end) |
88155 | 2640 (insert trans)))))) |
17493 | 2641 |
2642 (defun article-hide-signature (&optional arg) | |
2643 "Hide the signature in the current article. | |
2644 If given a negative prefix, always show; if given a positive prefix, | |
2645 always hide." | |
2646 (interactive (gnus-article-hidden-arg)) | |
2647 (unless (gnus-article-check-hidden-text 'signature arg) | |
2648 (save-excursion | |
2649 (save-restriction | |
88155 | 2650 (let ((inhibit-read-only t)) |
17493 | 2651 (when (gnus-article-narrow-to-signature) |
2652 (gnus-article-hide-text-type | |
88155 | 2653 (point-min) (point-max) 'signature)))))) |
2654 (gnus-set-mode-line 'article)) | |
17493 | 2655 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2656 (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
|
2657 "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
|
2658 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2659 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2660 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2661 (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
|
2662 (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
|
2663 (gnus-delete-line))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2664 |
17493 | 2665 (defun article-strip-leading-blank-lines () |
2666 "Remove all blank lines from the beginning of the article." | |
2667 (interactive) | |
2668 (save-excursion | |
2669 (let ((inhibit-point-motion-hooks t) | |
88155 | 2670 (inhibit-read-only t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2671 (when (article-goto-body) |
17493 | 2672 (while (and (not (eobp)) |
2673 (looking-at "[ \t]*$")) | |
2674 (gnus-delete-line)))))) | |
2675 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2676 (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
|
2677 "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
|
2678 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
|
2679 (narrow-to-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2680 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2681 (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
|
2682 (1- (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2683 (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2684 (goto-char (point-min))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2685 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2686 (defun article-goto-body () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2687 "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
|
2688 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2689 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2690 ;; 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
|
2691 ;; MIME body parts. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2692 (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
|
2693 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2694 ((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
|
2695 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2696 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2697 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2698 nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2699 |
17493 | 2700 (defun article-strip-multiple-blank-lines () |
2701 "Replace consecutive blank lines with one empty line." | |
2702 (interactive) | |
2703 (save-excursion | |
2704 (let ((inhibit-point-motion-hooks t) | |
88155 | 2705 (inhibit-read-only t)) |
17493 | 2706 ;; 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
|
2707 (article-goto-body) |
17493 | 2708 (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
|
2709 (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
|
2710 (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
|
2711 (replace-match "" nil t))) |
17493 | 2712 ;; 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
|
2713 (article-goto-body) |
88155 | 2714 (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
|
2715 (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
|
2716 (match-beginning 0) (match-end 0)) |
88155 | 2717 (delete-region (match-beginning 1) (match-end 1))))))) |
17493 | 2718 |
2719 (defun article-strip-leading-space () | |
2720 "Remove all white space from the beginning of the lines in the article." | |
2721 (interactive) | |
2722 (save-excursion | |
2723 (let ((inhibit-point-motion-hooks t) | |
88155 | 2724 (inhibit-read-only t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2725 (article-goto-body) |
17493 | 2726 (while (re-search-forward "^[ \t]+" nil t) |
2727 (replace-match "" t t))))) | |
2728 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2729 (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
|
2730 "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
|
2731 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2732 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2733 (let ((inhibit-point-motion-hooks t) |
88155 | 2734 (inhibit-read-only t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2735 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2736 (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
|
2737 (replace-match "" t t))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2738 |
17493 | 2739 (defun article-strip-blank-lines () |
2740 "Strip leading, trailing and multiple blank lines." | |
2741 (interactive) | |
2742 (article-strip-leading-blank-lines) | |
2743 (article-remove-trailing-blank-lines) | |
2744 (article-strip-multiple-blank-lines)) | |
2745 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2746 (defun article-strip-all-blank-lines () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2747 "Strip all blank lines." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2748 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2749 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2750 (let ((inhibit-point-motion-hooks t) |
88155 | 2751 (inhibit-read-only t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2752 (article-goto-body) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2753 (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
|
2754 (replace-match "" t t))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2755 |
17493 | 2756 (defun gnus-article-narrow-to-signature () |
2757 "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
|
2758 (let ((inhibit-point-motion-hooks t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2759 (when (gnus-article-search-signature) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2760 (forward-line 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2761 ;; 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
|
2762 ;; to be a signature. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2763 (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
|
2764 (list gnus-signature-limit))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2765 limit limited) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2766 (while (setq limit (pop limits)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2767 (if (or (and (integerp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2768 (< (- (point-max) (point)) limit)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2769 (and (floatp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2770 (< (count-lines (point) (point-max)) limit)) |
88155 | 2771 (and (functionp limit) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2772 (funcall limit)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2773 (and (stringp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2774 (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
|
2775 () ; This limit did not succeed. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2776 (setq limited t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2777 limits nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2778 (unless limited |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2779 (narrow-to-region (point) (point-max)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2780 t))))) |
17493 | 2781 |
2782 (defun gnus-article-search-signature () | |
2783 "Search the current buffer for the signature separator. | |
2784 Put point at the beginning of the signature separator." | |
2785 (let ((cur (point))) | |
2786 (goto-char (point-max)) | |
2787 (if (if (stringp gnus-signature-separator) | |
2788 (re-search-backward gnus-signature-separator nil t) | |
2789 (let ((seps gnus-signature-separator)) | |
2790 (while (and seps | |
2791 (not (re-search-backward (car seps) nil t))) | |
2792 (pop seps)) | |
2793 seps)) | |
2794 t | |
2795 (goto-char cur) | |
2796 nil))) | |
2797 | |
2798 (defun gnus-article-hidden-arg () | |
2799 "Return the current prefix arg as a number, or 0 if no prefix." | |
2800 (list (if current-prefix-arg | |
2801 (prefix-numeric-value current-prefix-arg) | |
2802 0))) | |
2803 | |
2804 (defun gnus-article-check-hidden-text (type arg) | |
2805 "Return nil if hiding is necessary. | |
42206 | 2806 Arg can be nil or a number. nil and positive means hide, negative |
17493 | 2807 means show, 0 means toggle." |
2808 (save-excursion | |
2809 (save-restriction | |
2810 (let ((hide (gnus-article-hidden-text-p type))) | |
2811 (cond | |
2812 ((or (null arg) | |
2813 (> arg 0)) | |
2814 nil) | |
2815 ((< arg 0) | |
34833
aaf69bc74739
* gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34818
diff
changeset
|
2816 (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
|
2817 t) |
17493 | 2818 (t |
2819 (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
|
2820 (progn |
aaf69bc74739
* gnus-art.el (gnus-article-check-hidden-text): Return t.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
34818
diff
changeset
|
2821 (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
|
2822 t) |
17493 | 2823 nil))))))) |
2824 | |
2825 (defun gnus-article-hidden-text-p (type) | |
2826 "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
|
2827 (let ((pos (text-property-any (point-min) (point-max) 'article-type type))) |
17493 | 2828 (while (and pos |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2829 (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
|
2830 (not (get-text-property pos 'dummy-invisible))) |
17493 | 2831 (setq pos |
2832 (text-property-any (1+ pos) (point-max) 'article-type type))) | |
2833 (if pos | |
2834 'hidden | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2835 nil))) |
17493 | 2836 |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2837 (defun gnus-article-show-hidden-text (type &optional dummy) |
17493 | 2838 "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
|
2839 Originally it is hide instead of DUMMY." |
88155 | 2840 (let ((inhibit-read-only t) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2841 (inhibit-point-motion-hooks t)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2842 (gnus-remove-text-properties-when |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2843 'article-type type |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
2844 (point-min) (point-max) |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
2845 (cons 'article-type (cons type |
88155 | 2846 gnus-hidden-properties))) |
2847 (gnus-delete-wash-type type))) | |
17493 | 2848 |
2849 (defconst article-time-units | |
2850 `((year . ,(* 365.25 24 60 60)) | |
2851 (week . ,(* 7 24 60 60)) | |
2852 (day . ,(* 24 60 60)) | |
2853 (hour . ,(* 60 60)) | |
2854 (minute . 60) | |
2855 (second . 1)) | |
2856 "Mapping from time units to seconds.") | |
2857 | |
88155 | 2858 (defun gnus-article-forward-header () |
2859 "Move point to the start of the next header. | |
2860 If the current header is a continuation header, this can be several | |
2861 lines forward." | |
2862 (let ((ended nil)) | |
2863 (while (not ended) | |
2864 (forward-line 1) | |
2865 (if (looking-at "[ \t]+[^ \t]") | |
2866 (forward-line 1) | |
2867 (setq ended t))))) | |
2868 | |
2869 (defun article-date-ut (&optional type highlight) | |
17493 | 2870 "Convert DATE date to universal time in the current article. |
2871 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
|
2872 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
|
2873 `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
|
2874 should replace the \"Date:\" one, or should be added below it." |
17493 | 2875 (interactive (list 'ut t)) |
88155 | 2876 (let* ((tdate-regexp "^Date:[ \t]\\|^X-Sent:[ \t]") |
2877 (date-regexp (cond ((not gnus-article-date-lapsed-new-header) | |
2878 tdate-regexp) | |
2879 ((eq type 'lapsed) | |
2880 "^X-Sent:[ \t]") | |
2881 (article-lapsed-timer | |
2882 "^Date:[ \t]") | |
2883 (t | |
2884 tdate-regexp))) | |
2885 (case-fold-search t) | |
2886 (inhibit-read-only t) | |
17493 | 2887 (inhibit-point-motion-hooks t) |
88155 | 2888 pos date bface eface) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2889 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2890 (save-restriction |
88155 | 2891 (widen) |
2892 (goto-char (point-min)) | |
2893 (while (or (setq date (get-text-property (setq pos (point)) | |
2894 'original-date)) | |
2895 (when (setq pos (next-single-property-change | |
2896 (point) 'original-date)) | |
2897 (setq date (get-text-property pos 'original-date)) | |
2898 t)) | |
2899 (narrow-to-region pos (or (text-property-any pos (point-max) | |
2900 'original-date nil) | |
2901 (point-max))) | |
2902 (goto-char (point-min)) | |
2903 (when (re-search-forward tdate-regexp nil t) | |
2904 (setq bface (get-text-property (gnus-point-at-bol) 'face) | |
2905 eface (get-text-property (1- (gnus-point-at-eol)) 'face))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2906 (goto-char (point-min)) |
88155 | 2907 (setq pos nil) |
2908 ;; Delete any old Date headers. | |
2909 (while (re-search-forward date-regexp nil t) | |
2910 (if pos | |
2911 (delete-region (gnus-point-at-bol) | |
2912 (progn | |
2913 (gnus-article-forward-header) | |
2914 (point))) | |
2915 (delete-region (gnus-point-at-bol) | |
2916 (progn | |
2917 (gnus-article-forward-header) | |
2918 (forward-char -1) | |
2919 (point))) | |
2920 (setq pos (point)))) | |
2921 (when (and (not pos) | |
2922 (re-search-forward tdate-regexp nil t)) | |
2923 (forward-line 1)) | |
2924 (gnus-goto-char pos) | |
2925 (insert (article-make-date-line date (or type 'ut))) | |
2926 (unless pos | |
2927 (insert "\n") | |
2928 (forward-line -1)) | |
2929 ;; Do highlighting. | |
2930 (beginning-of-line) | |
2931 (when (looking-at "\\([^:]+\\): *\\(.*\\)$") | |
2932 (put-text-property (match-beginning 1) (1+ (match-end 1)) | |
2933 'face bface) | |
2934 (put-text-property (match-beginning 2) (match-end 2) | |
2935 'face eface)) | |
2936 (put-text-property (point-min) (1- (point-max)) 'original-date date) | |
2937 (goto-char (point-max)) | |
2938 (widen)))))) | |
17493 | 2939 |
2940 (defun article-make-date-line (date type) | |
2941 "Return a DATE line of TYPE." | |
88155 | 2942 (unless (memq type '(local ut original user iso8601 lapsed english)) |
2943 (error "Unknown conversion type: %s" type)) | |
2944 (condition-case () | |
2945 (let ((time (date-to-time date))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2946 (cond |
88155 | 2947 ;; Convert to the local timezone. |
2948 ((eq type 'local) | |
2949 (let ((tz (car (current-time-zone time)))) | |
2950 (format "Date: %s %s%02d%02d" (current-time-string time) | |
2951 (if (> tz 0) "+" "-") (/ (abs tz) 3600) | |
2952 (/ (% (abs tz) 3600) 60)))) | |
2953 ;; Convert to Universal Time. | |
2954 ((eq type 'ut) | |
2955 (concat "Date: " | |
2956 (current-time-string | |
2957 (let* ((e (parse-time-string date)) | |
2958 (tm (apply 'encode-time e)) | |
2959 (ms (car tm)) | |
2960 (ls (- (cadr tm) (car (current-time-zone time))))) | |
2961 (cond ((< ls 0) (list (1- ms) (+ ls 65536))) | |
2962 ((> ls 65535) (list (1+ ms) (- ls 65536))) | |
2963 (t (list ms ls))))) | |
2964 " UT")) | |
2965 ;; Get the original date from the article. | |
2966 ((eq type 'original) | |
2967 (concat "Date: " (if (string-match "\n+$" date) | |
2968 (substring date 0 (match-beginning 0)) | |
2969 date))) | |
2970 ;; Let the user define the format. | |
2971 ((eq type 'user) | |
2972 (let ((format (or (condition-case nil | |
2973 (with-current-buffer gnus-summary-buffer | |
2974 gnus-article-time-format) | |
2975 (error nil)) | |
2976 gnus-article-time-format))) | |
2977 (if (functionp format) | |
2978 (funcall format time) | |
2979 (concat "Date: " (format-time-string format time))))) | |
2980 ;; ISO 8601. | |
2981 ((eq type 'iso8601) | |
2982 (let ((tz (car (current-time-zone time)))) | |
2983 (concat | |
2984 "Date: " | |
2985 (format-time-string "%Y%m%dT%H%M%S" time) | |
2986 (format "%s%02d%02d" | |
2987 (if (> tz 0) "+" "-") (/ (abs tz) 3600) | |
2988 (/ (% (abs tz) 3600) 60))))) | |
2989 ;; Do an X-Sent lapsed format. | |
2990 ((eq type 'lapsed) | |
2991 ;; If the date is seriously mangled, the timezone functions are | |
2992 ;; liable to bug out, so we ignore all errors. | |
2993 (let* ((now (current-time)) | |
2994 (real-time (subtract-time now time)) | |
2995 (real-sec (and real-time | |
2996 (+ (* (float (car real-time)) 65536) | |
2997 (cadr real-time)))) | |
2998 (sec (and real-time (abs real-sec))) | |
2999 num prev) | |
3000 (cond | |
3001 ((null real-time) | |
3002 "X-Sent: Unknown") | |
3003 ((zerop sec) | |
3004 "X-Sent: Now") | |
3005 (t | |
3006 (concat | |
3007 "X-Sent: " | |
3008 ;; This is a bit convoluted, but basically we go | |
3009 ;; through the time units for years, weeks, etc, | |
3010 ;; and divide things to see whether that results | |
3011 ;; in positive answers. | |
3012 (mapconcat | |
3013 (lambda (unit) | |
3014 (if (zerop (setq num (ffloor (/ sec (cdr unit))))) | |
3015 ;; The (remaining) seconds are too few to | |
3016 ;; be divided into this time unit. | |
3017 "" | |
3018 ;; It's big enough, so we output it. | |
3019 (setq sec (- sec (* num (cdr unit)))) | |
3020 (prog1 | |
3021 (concat (if prev ", " "") (int-to-string | |
3022 (floor num)) | |
3023 " " (symbol-name (car unit)) | |
3024 (if (> num 1) "s" "")) | |
3025 (setq prev t)))) | |
3026 article-time-units "") | |
3027 ;; If dates are odd, then it might appear like the | |
3028 ;; article was sent in the future. | |
3029 (if (> real-sec 0) | |
3030 " ago" | |
3031 " in the future")))))) | |
3032 ;; Display the date in proper English | |
3033 ((eq type 'english) | |
3034 (let ((dtime (decode-time time))) | |
3035 (concat | |
3036 "Date: the " | |
3037 (number-to-string (nth 3 dtime)) | |
3038 (let ((digit (% (nth 3 dtime) 10))) | |
3039 (cond | |
3040 ((memq (nth 3 dtime) '(11 12 13)) "th") | |
3041 ((= digit 1) "st") | |
3042 ((= digit 2) "nd") | |
3043 ((= digit 3) "rd") | |
3044 (t "th"))) | |
3045 " of " | |
3046 (nth (1- (nth 4 dtime)) gnus-english-month-names) | |
3047 " " | |
3048 (number-to-string (nth 5 dtime)) | |
3049 " at " | |
3050 (format "%02d" (nth 2 dtime)) | |
3051 ":" | |
3052 (format "%02d" (nth 1 dtime))))))) | |
3053 (error | |
3054 (format "Date: %s (from Gnus)" date)))) | |
17493 | 3055 |
3056 (defun article-date-local (&optional highlight) | |
3057 "Convert the current article date to the local timezone." | |
3058 (interactive (list t)) | |
3059 (article-date-ut 'local highlight)) | |
3060 | |
88155 | 3061 (defun article-date-english (&optional highlight) |
3062 "Convert the current article date to something that is proper English." | |
3063 (interactive (list t)) | |
3064 (article-date-ut 'english highlight)) | |
3065 | |
17493 | 3066 (defun article-date-original (&optional highlight) |
3067 "Convert the current article date to what it was originally. | |
3068 This is only useful if you have used some other date conversion | |
3069 function and want to see what the date was before converting." | |
3070 (interactive (list t)) | |
3071 (article-date-ut 'original highlight)) | |
3072 | |
3073 (defun article-date-lapsed (&optional highlight) | |
3074 "Convert the current article date to time lapsed since it was sent." | |
3075 (interactive (list t)) | |
3076 (article-date-ut 'lapsed highlight)) | |
3077 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3078 (defun article-update-date-lapsed () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3079 "Function to be run from a timer to update the lapsed time line." |
88155 | 3080 (save-match-data |
3081 (let (deactivate-mark) | |
3082 (save-excursion | |
3083 (ignore-errors | |
3084 (walk-windows | |
3085 (lambda (w) | |
3086 (set-buffer (window-buffer w)) | |
3087 (when (eq major-mode 'gnus-article-mode) | |
3088 (let ((mark (point-marker))) | |
3089 (goto-char (point-min)) | |
3090 (when (re-search-forward "^X-Sent:" nil t) | |
3091 (article-date-lapsed t)) | |
3092 (goto-char (marker-position mark)) | |
3093 (move-marker mark nil)))) | |
3094 nil 'visible)))))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3095 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3096 (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
|
3097 "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
|
3098 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
|
3099 is to run." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3100 (interactive "p") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3101 (unless n |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3102 (setq n 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3103 (gnus-stop-date-timer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3104 (setq article-lapsed-timer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3105 (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
|
3106 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3107 (defun gnus-stop-date-timer () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3108 "Stop the X-Sent timer." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3109 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3110 (when article-lapsed-timer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3111 (nnheader-cancel-timer article-lapsed-timer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3112 (setq article-lapsed-timer nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3113 |
17493 | 3114 (defun article-date-user (&optional highlight) |
3115 "Convert the current article date to the user-defined format. | |
3116 This format is defined by the `gnus-article-time-format' variable." | |
3117 (interactive (list t)) | |
3118 (article-date-ut 'user highlight)) | |
3119 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3120 (defun article-date-iso8601 (&optional highlight) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3121 "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
|
3122 (interactive (list t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3123 (article-date-ut 'iso8601 highlight)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3124 |
88155 | 3125 (defmacro gnus-article-save-original-date (&rest forms) |
3126 "Save the original date as a text property and evaluate FORMS." | |
3127 `(let* ((case-fold-search t) | |
3128 (start (progn | |
3129 (goto-char (point-min)) | |
3130 (when (and (re-search-forward "^date:[\t\n ]+" nil t) | |
3131 (not (bolp))) | |
3132 (match-end 0)))) | |
3133 (date (when (and start | |
3134 (re-search-forward "[\t ]*\n\\([^\t ]\\|\\'\\)" | |
3135 nil t)) | |
3136 (buffer-substring-no-properties start | |
3137 (match-beginning 0))))) | |
3138 (goto-char (point-max)) | |
3139 (skip-chars-backward "\n") | |
3140 (put-text-property (point-min) (point) 'original-date date) | |
3141 ,@forms | |
3142 (goto-char (point-max)) | |
3143 (skip-chars-backward "\n") | |
3144 (put-text-property (point-min) (point) 'original-date date))) | |
3145 | |
3146 ;; (defun article-show-all () | |
3147 ;; "Show all hidden text in the article buffer." | |
3148 ;; (interactive) | |
3149 ;; (save-excursion | |
3150 ;; (let ((inhibit-read-only t)) | |
3151 ;; (gnus-article-unhide-text (point-min) (point-max))))) | |
3152 | |
3153 (defun article-remove-leading-whitespace () | |
3154 "Remove excessive whitespace from all headers." | |
17493 | 3155 (interactive) |
3156 (save-excursion | |
88155 | 3157 (save-restriction |
3158 (let ((inhibit-read-only t)) | |
3159 (article-narrow-to-head) | |
3160 (goto-char (point-min)) | |
3161 (while (re-search-forward "^[^ :]+: \\([ \t]+\\)" nil t) | |
3162 (delete-region (match-beginning 1) (match-end 1))))))) | |
17493 | 3163 |
3164 (defun article-emphasize (&optional arg) | |
3165 "Emphasize text according to `gnus-emphasis-alist'." | |
3166 (interactive (gnus-article-hidden-arg)) | |
3167 (unless (gnus-article-check-hidden-text 'emphasis arg) | |
3168 (save-excursion | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
3169 (let ((alist (or |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3170 (condition-case nil |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
3171 (with-current-buffer gnus-summary-buffer |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
3172 gnus-article-emphasis-alist) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3173 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3174 gnus-emphasis-alist)) |
88155 | 3175 (inhibit-read-only t) |
17493 | 3176 (props (append '(article-type emphasis) |
3177 gnus-hidden-properties)) | |
3178 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
|
3179 (article-goto-body) |
17493 | 3180 (setq beg (point)) |
3181 (while (setq elem (pop alist)) | |
3182 (goto-char beg) | |
3183 (setq regexp (car elem) | |
3184 invisible (nth 1 elem) | |
3185 visible (nth 2 elem) | |
3186 face (nth 3 elem)) | |
3187 (while (re-search-forward regexp nil t) | |
88155 | 3188 (when (and (match-beginning visible) (match-beginning invisible)) |
3189 (gnus-article-hide-text | |
3190 (match-beginning invisible) (match-end invisible) props) | |
3191 (gnus-article-unhide-text-type | |
3192 (match-beginning visible) (match-end visible) 'emphasis) | |
3193 (gnus-put-overlay-excluding-newlines | |
3194 (match-beginning visible) (match-end visible) 'face face) | |
3195 (gnus-add-wash-type 'emphasis) | |
3196 (goto-char (match-end invisible))))))))) | |
17493 | 3197 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3198 (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
|
3199 "Setup newsgroup emphasis alist." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3200 (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
|
3201 (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
|
3202 (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
|
3203 (make-local-variable 'gnus-article-emphasis-alist) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
3204 (setq gnus-article-emphasis-alist |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
3205 (nconc |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3206 (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
|
3207 (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
|
3208 (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
|
3209 (setq alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3210 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
|
3211 highlight) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3212 (copy-sequence highlight-words) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3213 (if gnus-newsgroup-name |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
3214 (copy-sequence (gnus-group-find-parameter |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3215 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
|
3216 gnus-emphasis-alist))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3217 |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
3218 (eval-when-compile |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35838
diff
changeset
|
3219 (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
|
3220 (defvar gnus-summary-post-menu)) |
17493 | 3221 |
3222 ;;; Saving functions. | |
3223 | |
3224 (defun gnus-article-save (save-buffer file &optional num) | |
3225 "Save the currently selected article." | |
3226 (unless gnus-save-all-headers | |
3227 ;; Remove headers according to `gnus-saved-headers'. | |
3228 (let ((gnus-visible-headers | |
3229 (or gnus-saved-headers gnus-visible-headers)) | |
3230 (gnus-article-buffer save-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3231 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3232 (set-buffer save-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3233 (article-hide-headers 1 t)))) |
17493 | 3234 (save-window-excursion |
3235 (if (not gnus-default-article-saver) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3236 (error "No default saver is defined") |
17493 | 3237 ;; !!! 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
|
3238 ;; `gnus-save-article-buffer' (or so they think), but we |
17493 | 3239 ;; bind that variable to our save-buffer. |
3240 (set-buffer gnus-article-buffer) | |
3241 (let* ((gnus-save-article-buffer save-buffer) | |
3242 (filename | |
3243 (cond | |
3244 ((not gnus-prompt-before-saving) 'default) | |
3245 ((eq gnus-prompt-before-saving 'always) nil) | |
3246 (t file))) | |
3247 (gnus-number-of-articles-to-be-saved | |
3248 (when (eq gnus-prompt-before-saving t) | |
3249 num))) ; Magic | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3250 (set-buffer gnus-article-current-summary) |
17493 | 3251 (funcall gnus-default-article-saver filename))))) |
3252 | |
3253 (defun gnus-read-save-file-name (prompt &optional filename | |
3254 function group headers variable) | |
3255 (let ((default-name | |
3256 (funcall function group headers (symbol-value variable))) | |
3257 result) | |
33077 | 3258 (setq result |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
3259 (expand-file-name |
33077 | 3260 (cond |
3261 ((eq filename 'default) | |
3262 default-name) | |
3263 ((eq filename t) | |
3264 default-name) | |
3265 (filename filename) | |
3266 (t | |
3267 (let* ((split-name (gnus-get-split-value gnus-split-methods)) | |
3268 (prompt | |
3269 (format prompt | |
3270 (if (and gnus-number-of-articles-to-be-saved | |
3271 (> gnus-number-of-articles-to-be-saved 1)) | |
3272 (format "these %d articles" | |
3273 gnus-number-of-articles-to-be-saved) | |
3274 "this article"))) | |
3275 (file | |
3276 ;; Let the split methods have their say. | |
3277 (cond | |
3278 ;; No split name was found. | |
3279 ((null split-name) | |
3280 (read-file-name | |
3281 (concat prompt " (default " | |
88155 | 3282 (file-name-nondirectory default-name) "): ") |
33077 | 3283 (file-name-directory default-name) |
3284 default-name)) | |
3285 ;; A single group name is returned. | |
3286 ((stringp split-name) | |
3287 (setq default-name | |
3288 (funcall function split-name headers | |
3289 (symbol-value variable))) | |
3290 (read-file-name | |
3291 (concat prompt " (default " | |
88155 | 3292 (file-name-nondirectory default-name) "): ") |
33077 | 3293 (file-name-directory default-name) |
3294 default-name)) | |
3295 ;; A single split name was found | |
3296 ((= 1 (length split-name)) | |
3297 (let* ((name (expand-file-name | |
88155 | 3298 (car split-name) |
3299 gnus-article-save-directory)) | |
33077 | 3300 (dir (cond ((file-directory-p name) |
3301 (file-name-as-directory name)) | |
3302 ((file-exists-p name) name) | |
3303 (t gnus-article-save-directory)))) | |
3304 (read-file-name | |
88155 | 3305 (concat prompt " (default " name "): ") |
33077 | 3306 dir name))) |
3307 ;; A list of splits was found. | |
3308 (t | |
3309 (setq split-name (nreverse split-name)) | |
3310 (let (result) | |
3311 (let ((file-name-history | |
3312 (nconc split-name file-name-history))) | |
3313 (setq result | |
3314 (expand-file-name | |
3315 (read-file-name | |
88155 | 3316 (concat prompt " (`M-p' for defaults): ") |
33077 | 3317 gnus-article-save-directory |
3318 (car split-name)) | |
3319 gnus-article-save-directory))) | |
3320 (car (push result file-name-history))))))) | |
3321 ;; Create the directory. | |
3322 (gnus-make-directory (file-name-directory file)) | |
88155 | 3323 ;; If we have read a directory, we append the default file name. |
33077 | 3324 (when (file-directory-p file) |
88155 | 3325 (setq file (expand-file-name (file-name-nondirectory |
3326 default-name) | |
33077 | 3327 (file-name-as-directory file)))) |
3328 ;; Possibly translate some characters. | |
3329 (nnheader-translate-file-chars file)))))) | |
17493 | 3330 (gnus-make-directory (file-name-directory result)) |
3331 (set variable result))) | |
3332 | |
3333 (defun gnus-article-archive-name (group) | |
3334 "Return the first instance of an \"Archive-name\" in the current buffer." | |
3335 (let ((case-fold-search t)) | |
3336 (when (re-search-forward "archive-name: *\\([^ \n\t]+\\)[ \t]*$" nil t) | |
3337 (nnheader-concat gnus-article-save-directory | |
3338 (match-string 1))))) | |
3339 | |
3340 (defun gnus-article-nndoc-name (group) | |
3341 "If GROUP is an nndoc group, return the name of the parent group." | |
3342 (when (eq (car (gnus-find-method-for-group group)) 'nndoc) | |
3343 (gnus-group-get-parameter group 'save-article-group))) | |
3344 | |
3345 (defun gnus-summary-save-in-rmail (&optional filename) | |
3346 "Append this article to Rmail file. | |
3347 Optional argument FILENAME specifies file name. | |
3348 Directory to save to is default to `gnus-article-save-directory'." | |
3349 (setq filename (gnus-read-save-file-name | |
88155 | 3350 "Save %s in rmail file" filename |
17493 | 3351 gnus-rmail-save-name gnus-newsgroup-name |
3352 gnus-current-headers 'gnus-newsgroup-last-rmail)) | |
3353 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
3354 (save-excursion | |
3355 (save-restriction | |
3356 (widen) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3357 (gnus-output-to-rmail filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3358 filename) |
17493 | 3359 |
3360 (defun gnus-summary-save-in-mail (&optional filename) | |
3361 "Append this article to Unix mail file. | |
3362 Optional argument FILENAME specifies file name. | |
3363 Directory to save to is default to `gnus-article-save-directory'." | |
3364 (setq filename (gnus-read-save-file-name | |
88155 | 3365 "Save %s in Unix mail file" filename |
17493 | 3366 gnus-mail-save-name gnus-newsgroup-name |
3367 gnus-current-headers 'gnus-newsgroup-last-mail)) | |
3368 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
3369 (save-excursion | |
3370 (save-restriction | |
3371 (widen) | |
3372 (if (and (file-readable-p filename) | |
88155 | 3373 (file-regular-p filename) |
17493 | 3374 (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
|
3375 (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
|
3376 (gnus-output-to-mail filename))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3377 filename) |
17493 | 3378 |
3379 (defun gnus-summary-save-in-file (&optional filename overwrite) | |
3380 "Append this article to file. | |
3381 Optional argument FILENAME specifies file name. | |
3382 Directory to save to is default to `gnus-article-save-directory'." | |
3383 (setq filename (gnus-read-save-file-name | |
88155 | 3384 "Save %s in file" filename |
17493 | 3385 gnus-file-save-name gnus-newsgroup-name |
3386 gnus-current-headers 'gnus-newsgroup-last-file)) | |
3387 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
3388 (save-excursion | |
3389 (save-restriction | |
3390 (widen) | |
3391 (when (and overwrite | |
3392 (file-exists-p filename)) | |
3393 (delete-file filename)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3394 (gnus-output-to-file filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3395 filename) |
17493 | 3396 |
3397 (defun gnus-summary-write-to-file (&optional filename) | |
88155 | 3398 "Write this article to a file, overwriting it if the file exists. |
17493 | 3399 Optional argument FILENAME specifies file name. |
3400 The directory to save in defaults to `gnus-article-save-directory'." | |
3401 (gnus-summary-save-in-file nil t)) | |
3402 | |
3403 (defun gnus-summary-save-body-in-file (&optional filename) | |
3404 "Append this article body to a file. | |
3405 Optional argument FILENAME specifies file name. | |
3406 The directory to save in defaults to `gnus-article-save-directory'." | |
3407 (setq filename (gnus-read-save-file-name | |
88155 | 3408 "Save %s body in file" filename |
17493 | 3409 gnus-file-save-name gnus-newsgroup-name |
3410 gnus-current-headers 'gnus-newsgroup-last-file)) | |
3411 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
3412 (save-excursion | |
3413 (save-restriction | |
3414 (widen) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3415 (when (article-goto-body) |
17493 | 3416 (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
|
3417 (gnus-output-to-file filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3418 filename) |
17493 | 3419 |
3420 (defun gnus-summary-save-in-pipe (&optional command) | |
3421 "Pipe this article to subprocess." | |
3422 (setq command | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3423 (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
|
3424 gnus-last-shell-command) |
17493 | 3425 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
|
3426 ((stringp command) |
53eebdb81828
2001-02-01 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35759
diff
changeset
|
3427 command) |
17493 | 3428 (t (read-string |
3429 (format | |
3430 "Shell command on %s: " | |
3431 (if (and gnus-number-of-articles-to-be-saved | |
3432 (> gnus-number-of-articles-to-be-saved 1)) | |
3433 (format "these %d articles" | |
3434 gnus-number-of-articles-to-be-saved) | |
3435 "this article")) | |
3436 gnus-last-shell-command)))) | |
3437 (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
|
3438 (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
|
3439 (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
|
3440 (error "A command is required"))) |
17493 | 3441 (gnus-eval-in-buffer-window gnus-article-buffer |
3442 (save-restriction | |
3443 (widen) | |
3444 (shell-command-on-region (point-min) (point-max) command nil))) | |
3445 (setq gnus-last-shell-command command)) | |
3446 | |
88155 | 3447 (defmacro gnus-read-string (prompt &optional initial-contents history |
3448 default-value) | |
3449 "Like `read-string' but allow for older XEmacsen that don't have the 5th arg." | |
3450 (if (and (featurep 'xemacs) | |
3451 (< emacs-minor-version 2)) | |
3452 `(read-string ,prompt ,initial-contents ,history) | |
3453 `(read-string ,prompt ,initial-contents ,history ,default-value))) | |
3454 | |
3455 (defun gnus-summary-pipe-to-muttprint (&optional command) | |
3456 "Pipe this article to muttprint." | |
3457 (setq command (gnus-read-string | |
3458 "Print using command: " gnus-summary-muttprint-program | |
3459 nil gnus-summary-muttprint-program)) | |
3460 (gnus-summary-save-in-pipe command)) | |
3461 | |
17493 | 3462 ;;; Article file names when saving. |
3463 | |
3464 (defun gnus-capitalize-newsgroup (newsgroup) | |
3465 "Capitalize NEWSGROUP name." | |
3466 (when (not (zerop (length newsgroup))) | |
3467 (concat (char-to-string (upcase (aref newsgroup 0))) | |
3468 (substring newsgroup 1)))) | |
3469 | |
3470 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file) | |
3471 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
3472 If variable `gnus-use-long-file-name' is non-nil, it is ~/News/News.group/num. | |
3473 Otherwise, it is like ~/News/news/group/num." | |
3474 (let ((default | |
3475 (expand-file-name | |
3476 (concat (if (gnus-use-long-file-name 'not-save) | |
3477 (gnus-capitalize-newsgroup newsgroup) | |
3478 (gnus-newsgroup-directory-form newsgroup)) | |
3479 "/" (int-to-string (mail-header-number headers))) | |
3480 gnus-article-save-directory))) | |
3481 (if (and last-file | |
3482 (string-equal (file-name-directory default) | |
3483 (file-name-directory last-file)) | |
3484 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
3485 default | |
3486 (or last-file default)))) | |
3487 | |
3488 (defun gnus-numeric-save-name (newsgroup headers &optional last-file) | |
3489 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
3490 If variable `gnus-use-long-file-name' is non-nil, it is | |
3491 ~/News/news.group/num. Otherwise, it is like ~/News/news/group/num." | |
3492 (let ((default | |
3493 (expand-file-name | |
3494 (concat (if (gnus-use-long-file-name 'not-save) | |
3495 newsgroup | |
3496 (gnus-newsgroup-directory-form newsgroup)) | |
3497 "/" (int-to-string (mail-header-number headers))) | |
3498 gnus-article-save-directory))) | |
3499 (if (and last-file | |
3500 (string-equal (file-name-directory default) | |
3501 (file-name-directory last-file)) | |
3502 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
3503 default | |
3504 (or last-file default)))) | |
3505 | |
3506 (defun gnus-plain-save-name (newsgroup headers &optional last-file) | |
3507 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
3508 If variable `gnus-use-long-file-name' is non-nil, it is | |
3509 ~/News/news.group. Otherwise, it is like ~/News/news/group/news." | |
3510 (or last-file | |
3511 (expand-file-name | |
3512 (if (gnus-use-long-file-name 'not-save) | |
3513 newsgroup | |
88155 | 3514 (file-relative-name |
3515 (expand-file-name "news" (gnus-newsgroup-directory-form newsgroup)) | |
3516 default-directory)) | |
17493 | 3517 gnus-article-save-directory))) |
3518 | |
88155 | 3519 (defun gnus-sender-save-name (newsgroup headers &optional last-file) |
3520 "Generate file name from sender." | |
3521 (let ((from (mail-header-from headers))) | |
3522 (expand-file-name | |
3523 (if (and from (string-match "\\([^ <]+\\)@" from)) | |
3524 (match-string 1 from) | |
3525 "nobody") | |
3526 gnus-article-save-directory))) | |
3527 | |
3528 (defun article-verify-x-pgp-sig () | |
3529 "Verify X-PGP-Sig." | |
3530 (interactive) | |
3531 (if (gnus-buffer-live-p gnus-original-article-buffer) | |
3532 (let ((sig (with-current-buffer gnus-original-article-buffer | |
3533 (gnus-fetch-field "X-PGP-Sig"))) | |
3534 items info headers) | |
3535 (when (and sig | |
3536 mml2015-use | |
3537 (mml2015-clear-verify-function)) | |
3538 (with-temp-buffer | |
3539 (insert-buffer-substring gnus-original-article-buffer) | |
3540 (setq items (split-string sig)) | |
3541 (message-narrow-to-head) | |
3542 (let ((inhibit-point-motion-hooks t) | |
3543 (case-fold-search t)) | |
3544 ;; Don't verify multiple headers. | |
3545 (setq headers (mapconcat (lambda (header) | |
3546 (concat header ": " | |
3547 (mail-fetch-field header) | |
3548 "\n")) | |
3549 (split-string (nth 1 items) ",") ""))) | |
3550 (delete-region (point-min) (point-max)) | |
3551 (insert "-----BEGIN PGP SIGNED MESSAGE-----\n\n") | |
3552 (insert "X-Signed-Headers: " (nth 1 items) "\n") | |
3553 (insert headers) | |
3554 (widen) | |
3555 (forward-line) | |
3556 (while (not (eobp)) | |
3557 (if (looking-at "^-") | |
3558 (insert "- ")) | |
3559 (forward-line)) | |
3560 (insert "\n-----BEGIN PGP SIGNATURE-----\n") | |
3561 (insert "Version: " (car items) "\n\n") | |
3562 (insert (mapconcat 'identity (cddr items) "\n")) | |
3563 (insert "\n-----END PGP SIGNATURE-----\n") | |
3564 (let ((mm-security-handle (list (format "multipart/signed")))) | |
3565 (mml2015-clean-buffer) | |
3566 (let ((coding-system-for-write (or gnus-newsgroup-charset | |
3567 'iso-8859-1))) | |
3568 (funcall (mml2015-clear-verify-function))) | |
3569 (setq info | |
3570 (or (mm-handle-multipart-ctl-parameter | |
3571 mm-security-handle 'gnus-details) | |
3572 (mm-handle-multipart-ctl-parameter | |
3573 mm-security-handle 'gnus-info))))) | |
3574 (when info | |
3575 (let ((inhibit-read-only t) bface eface) | |
3576 (save-restriction | |
3577 (message-narrow-to-head) | |
3578 (goto-char (point-max)) | |
3579 (forward-line -1) | |
3580 (setq bface (get-text-property (gnus-point-at-bol) 'face) | |
3581 eface (get-text-property (1- (gnus-point-at-eol)) 'face)) | |
3582 (message-remove-header "X-Gnus-PGP-Verify") | |
3583 (if (re-search-forward "^X-PGP-Sig:" nil t) | |
3584 (forward-line) | |
3585 (goto-char (point-max))) | |
3586 (narrow-to-region (point) (point)) | |
3587 (insert "X-Gnus-PGP-Verify: " info "\n") | |
3588 (goto-char (point-min)) | |
3589 (forward-line) | |
3590 (while (not (eobp)) | |
3591 (if (not (looking-at "^[ \t]")) | |
3592 (insert " ")) | |
3593 (forward-line)) | |
3594 ;; Do highlighting. | |
3595 (goto-char (point-min)) | |
3596 (when (looking-at "\\([^:]+\\): *") | |
3597 (put-text-property (match-beginning 1) (1+ (match-end 1)) | |
3598 'face bface) | |
3599 (put-text-property (match-end 0) (point-max) | |
3600 'face eface))))))))) | |
3601 | |
3602 (defun article-verify-cancel-lock () | |
3603 "Verify Cancel-Lock header." | |
3604 (interactive) | |
3605 (if (gnus-buffer-live-p gnus-original-article-buffer) | |
3606 (canlock-verify gnus-original-article-buffer))) | |
3607 | |
17493 | 3608 (eval-and-compile |
3609 (mapcar | |
3610 (lambda (func) | |
3611 (let (afunc gfunc) | |
3612 (if (consp func) | |
3613 (setq afunc (car func) | |
3614 gfunc (cdr func)) | |
3615 (setq afunc func | |
3616 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
|
3617 (defalias gfunc |
88155 | 3618 (when (fboundp afunc) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3619 `(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
|
3620 ,(documentation afunc t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3621 (interactive (list t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3622 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3623 (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
|
3624 (if interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3625 (call-interactively ',afunc) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3626 (apply ',afunc args)))))))) |
17493 | 3627 '(article-hide-headers |
88155 | 3628 article-verify-x-pgp-sig |
3629 article-verify-cancel-lock | |
17493 | 3630 article-hide-boring-headers |
3631 article-treat-overstrike | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3632 article-fill-long-lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3633 article-capitalize-sentences |
17493 | 3634 article-remove-cr |
88155 | 3635 article-remove-leading-whitespace |
17493 | 3636 article-display-x-face |
88155 | 3637 article-display-face |
17493 | 3638 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
|
3639 article-de-base64-unreadable |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3640 article-decode-HZ |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3641 article-wash-html |
88155 | 3642 article-unsplit-urls |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3643 article-hide-list-identifiers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3644 article-strip-banner |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3645 article-babel |
17493 | 3646 article-hide-pem |
3647 article-hide-signature | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3648 article-strip-headers-in-body |
17493 | 3649 article-remove-trailing-blank-lines |
3650 article-strip-leading-blank-lines | |
3651 article-strip-multiple-blank-lines | |
3652 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
|
3653 article-strip-trailing-space |
17493 | 3654 article-strip-blank-lines |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3655 article-strip-all-blank-lines |
17493 | 3656 article-date-local |
88155 | 3657 article-date-english |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3658 article-date-iso8601 |
17493 | 3659 article-date-original |
3660 article-date-ut | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3661 article-decode-mime-words |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3662 article-decode-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3663 article-decode-encoded-words |
17493 | 3664 article-date-user |
3665 article-date-lapsed | |
3666 article-emphasize | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3667 article-treat-dumbquotes |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3668 article-normalize-headers |
88155 | 3669 ;; (article-show-all . gnus-article-show-all-headers) |
3670 ))) | |
17493 | 3671 |
3672 ;;; | |
3673 ;;; Gnus article mode | |
3674 ;;; | |
3675 | |
3676 (put 'gnus-article-mode 'mode-class 'special) | |
3677 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3678 (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
|
3679 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3680 (gnus-define-keys gnus-article-mode-map |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3681 " " gnus-article-goto-next-page |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3682 "\177" gnus-article-goto-prev-page |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3683 [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
|
3684 [backspace] gnus-article-goto-prev-page |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3685 "\C-c^" gnus-article-refer-article |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3686 "h" gnus-article-show-summary |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3687 "s" gnus-article-show-summary |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3688 "\C-c\C-m" gnus-article-mail |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3689 "?" 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
|
3690 "e" gnus-summary-edit-article |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3691 "<" beginning-of-buffer |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3692 ">" end-of-buffer |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3693 "\C-c\C-i" gnus-info-find-node |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3694 "\C-c\C-b" gnus-bug |
88155 | 3695 "R" gnus-article-reply-with-original |
3696 "F" gnus-article-followup-with-original | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
3697 "\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
|
3698 "\C-hc" gnus-article-describe-key-briefly |
17493 | 3699 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3700 "\C-d" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3701 "\M-*" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3702 "\M-#" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3703 "\M-^" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3704 "\M-g" gnus-article-read-summary-keys) |
17493 | 3705 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3706 (substitute-key-definition |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
3707 'undefined 'gnus-article-read-summary-keys gnus-article-mode-map) |
17493 | 3708 |
3709 (defun gnus-article-make-menu-bar () | |
88155 | 3710 (unless (boundp 'gnus-article-commands-menu) |
3711 (gnus-summary-make-menu-bar)) | |
17493 | 3712 (gnus-turn-off-edit-menu 'article) |
3713 (unless (boundp 'gnus-article-article-menu) | |
3714 (easy-menu-define | |
3715 gnus-article-article-menu gnus-article-mode-map "" | |
3716 '("Article" | |
3717 ["Scroll forwards" gnus-article-goto-next-page t] | |
3718 ["Scroll backwards" gnus-article-goto-prev-page t] | |
3719 ["Show summary" gnus-article-show-summary t] | |
3720 ["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
|
3721 ["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
|
3722 ["Send a bug report" gnus-bug t])) |
17493 | 3723 |
3724 (easy-menu-define | |
3725 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
|
3726 ;; Fixme: this should use :active (and maybe :visible). |
17493 | 3727 '("Treatment" |
3728 ["Hide headers" gnus-article-hide-headers t] | |
3729 ["Hide signature" gnus-article-hide-signature t] | |
3730 ["Hide citation" gnus-article-hide-citation t] | |
3731 ["Treat overstrike" gnus-article-treat-overstrike t] | |
3732 ["Remove carriage return" gnus-article-remove-cr t] | |
88155 | 3733 ["Remove leading whitespace" gnus-article-remove-leading-whitespace t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3734 ["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
|
3735 ["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
|
3736 ["Treat html" gnus-article-wash-html t] |
88155 | 3737 ["Remove newlines from within URLs" gnus-article-unsplit-urls t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3738 ["Decode HZ" gnus-article-decode-HZ t])) |
17493 | 3739 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3740 ;; Note "Commands" menu is defined in gnus-sum.el for consistency |
17493 | 3741 |
88155 | 3742 ;; Note "Post" menu is defined in gnus-sum.el for consistency |
17493 | 3743 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3744 (gnus-run-hooks 'gnus-article-menu-hook))) |
17493 | 3745 |
3746 (defun gnus-article-mode () | |
3747 "Major mode for displaying an article. | |
3748 | |
3749 All normal editing commands are switched off. | |
3750 | |
3751 The following commands are available in addition to all summary mode | |
3752 commands: | |
3753 \\<gnus-article-mode-map> | |
3754 \\[gnus-article-next-page]\t Scroll the article one page forwards | |
3755 \\[gnus-article-prev-page]\t Scroll the article one page backwards | |
3756 \\[gnus-article-refer-article]\t Go to the article referred to by an article id near point | |
3757 \\[gnus-article-show-summary]\t Display the summary buffer | |
3758 \\[gnus-article-mail]\t Send a reply to the address near point | |
3759 \\[gnus-article-describe-briefly]\t Describe the current mode briefly | |
3760 \\[gnus-info-find-node]\t Go to the Gnus info node" | |
3761 (interactive) | |
88155 | 3762 (kill-all-local-variables) |
17493 | 3763 (gnus-simplify-mode-line) |
3764 (setq mode-name "Article") | |
3765 (setq major-mode 'gnus-article-mode) | |
3766 (make-local-variable 'minor-mode-alist) | |
3767 (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
|
3768 (when (gnus-visual-p 'article-menu 'menu) |
88155 | 3769 (gnus-article-make-menu-bar) |
3770 (when gnus-summary-tool-bar-map | |
3771 (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map))) | |
17493 | 3772 (gnus-update-format-specifications nil 'article-mode) |
3773 (set (make-local-variable 'page-delimiter) gnus-page-delimiter) | |
88155 | 3774 (set (make-local-variable 'gnus-page-broken) nil) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3775 (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
|
3776 (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
|
3777 (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
|
3778 (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
|
3779 (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
|
3780 (make-local-variable 'gnus-article-wash-types) |
88155 | 3781 (make-local-variable 'gnus-article-image-alist) |
3782 (make-local-variable 'gnus-article-charset) | |
3783 (make-local-variable 'gnus-article-ignored-charsets) | |
3784 ;; Prevent recent Emacsen from displaying non-break space as "\ ". | |
3785 (set (make-local-variable 'nobreak-char-display) nil) | |
17493 | 3786 (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
|
3787 (buffer-disable-undo) |
17493 | 3788 (setq buffer-read-only t) |
3789 (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
|
3790 (mm-enable-multibyte) |
88155 | 3791 (gnus-run-mode-hooks 'gnus-article-mode-hook)) |
17493 | 3792 |
3793 (defun gnus-article-setup-buffer () | |
3794 "Initialize the article buffer." | |
3795 (let* ((name (if gnus-single-article-buffer "*Article*" | |
3796 (concat "*Article " gnus-newsgroup-name "*"))) | |
3797 (original | |
3798 (progn (string-match "\\*Article" name) | |
3799 (concat " *Original Article" | |
3800 (substring name (match-end 0)))))) | |
3801 (setq gnus-article-buffer name) | |
3802 (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
|
3803 (setq gnus-article-mime-handle-alist nil) |
17493 | 3804 ;; This might be a variable local to the summary buffer. |
3805 (unless gnus-single-article-buffer | |
3806 (save-excursion | |
3807 (set-buffer gnus-summary-buffer) | |
3808 (setq gnus-article-buffer name) | |
3809 (setq gnus-original-article-buffer original) | |
3810 (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
|
3811 (gnus-article-setup-highlight-words) |
17493 | 3812 ;; Init original article buffer. |
3813 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3814 (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
|
3815 (mm-enable-multibyte) |
17493 | 3816 (setq major-mode 'gnus-original-article-mode) |
3817 (make-local-variable 'gnus-original-article)) | |
88155 | 3818 (if (and (get-buffer name) |
3819 (with-current-buffer name | |
3820 (if gnus-article-edit-mode | |
3821 (if (y-or-n-p "Article mode edit in progress; discard? ") | |
3822 (progn | |
3823 (set-buffer-modified-p nil) | |
3824 (gnus-kill-buffer name) | |
3825 (message "") | |
3826 nil) | |
3827 (error "Action aborted")) | |
3828 t))) | |
17493 | 3829 (save-excursion |
3830 (set-buffer name) | |
88155 | 3831 (set (make-local-variable 'gnus-article-edit-mode) nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3832 (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
|
3833 (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
|
3834 (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
|
3835 ;; Set it to nil in article-buffer! |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
3836 (setq gnus-article-mime-handle-alist nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3837 (buffer-disable-undo) |
17493 | 3838 (setq buffer-read-only t) |
88155 | 3839 ;; This list just keeps growing if we don't reset it. |
3840 (setq gnus-button-marker-list nil) | |
17493 | 3841 (unless (eq major-mode 'gnus-article-mode) |
3842 (gnus-article-mode)) | |
3843 (current-buffer)) | |
3844 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3845 (set-buffer (gnus-get-buffer-create name)) |
17493 | 3846 (gnus-article-mode) |
3847 (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
|
3848 (gnus-summary-set-local-parameters gnus-newsgroup-name) |
17493 | 3849 (current-buffer))))) |
3850 | |
3851 ;; Set article window start at LINE, where LINE is the number of lines | |
3852 ;; from the head of the article. | |
3853 (defun gnus-article-set-window-start (&optional line) | |
3854 (set-window-start | |
88155 | 3855 (gnus-get-buffer-window gnus-article-buffer t) |
17493 | 3856 (save-excursion |
3857 (set-buffer gnus-article-buffer) | |
3858 (goto-char (point-min)) | |
3859 (if (not line) | |
3860 (point-min) | |
3861 (gnus-message 6 "Moved to bookmark") | |
3862 (search-forward "\n\n" nil t) | |
3863 (forward-line line) | |
3864 (point))))) | |
3865 | |
3866 (defun gnus-article-prepare (article &optional all-headers header) | |
3867 "Prepare ARTICLE in article mode buffer. | |
3868 ARTICLE should either be an article number or a Message-ID. | |
3869 If ARTICLE is an id, HEADER should be the article headers. | |
3870 If ALL-HEADERS is non-nil, no headers are hidden." | |
3871 (save-excursion | |
3872 ;; Make sure we start in a summary buffer. | |
3873 (unless (eq major-mode 'gnus-summary-mode) | |
3874 (set-buffer gnus-summary-buffer)) | |
3875 (setq gnus-summary-buffer (current-buffer)) | |
3876 (let* ((gnus-article (if header (mail-header-number header) article)) | |
3877 (summary-buffer (current-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3878 (gnus-tmp-internal-hook gnus-article-internal-prepare-hook) |
17493 | 3879 (group gnus-newsgroup-name) |
3880 result) | |
3881 (save-excursion | |
3882 (gnus-article-setup-buffer) | |
3883 (set-buffer gnus-article-buffer) | |
3884 ;; Deactivate active regions. | |
3885 (when (and (boundp 'transient-mark-mode) | |
3886 transient-mark-mode) | |
3887 (setq mark-active nil)) | |
88155 | 3888 (if (not (setq result (let ((inhibit-read-only t)) |
17493 | 3889 (gnus-request-article-this-buffer |
3890 article group)))) | |
3891 ;; There is no such article. | |
3892 (save-excursion | |
3893 (when (and (numberp article) | |
3894 (not (memq article gnus-newsgroup-sparse))) | |
3895 (setq gnus-article-current | |
3896 (cons gnus-newsgroup-name article)) | |
3897 (set-buffer gnus-summary-buffer) | |
3898 (setq gnus-current-article article) | |
88155 | 3899 (if (and (memq article gnus-newsgroup-undownloaded) |
3900 (not (gnus-online (gnus-find-method-for-group | |
3901 gnus-newsgroup-name)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3902 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3903 (gnus-summary-set-agent-mark article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3904 (message "Message marked for downloading")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3905 (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
|
3906 (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
|
3907 (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
|
3908 (if (or (eq result 'pseudo) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3909 (eq result 'nneething)) |
17493 | 3910 (progn |
3911 (save-excursion | |
3912 (set-buffer summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3913 (push article gnus-newsgroup-history) |
17493 | 3914 (setq gnus-last-article gnus-current-article |
3915 gnus-current-article 0 | |
3916 gnus-current-headers nil | |
3917 gnus-article-current nil) | |
3918 (if (eq result 'nneething) | |
3919 (gnus-configure-windows 'summary) | |
3920 (gnus-configure-windows 'article)) | |
3921 (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
|
3922 (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
|
3923 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
|
3924 (gnus-set-mode-line 'article))) |
17493 | 3925 ;; The result from the `request' was an actual article - |
3926 ;; or at least some text that is now displayed in the | |
3927 ;; article buffer. | |
3928 (when (and (numberp article) | |
3929 (not (eq article gnus-current-article))) | |
3930 ;; Seems like a new article has been selected. | |
3931 ;; `gnus-current-article' must be an article number. | |
3932 (save-excursion | |
3933 (set-buffer summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3934 (push article gnus-newsgroup-history) |
17493 | 3935 (setq gnus-last-article gnus-current-article |
3936 gnus-current-article article | |
3937 gnus-current-headers | |
3938 (gnus-summary-article-header gnus-current-article) | |
3939 gnus-article-current | |
3940 (cons gnus-newsgroup-name gnus-current-article)) | |
3941 (unless (vectorp gnus-current-headers) | |
3942 (setq gnus-current-headers nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3943 (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
|
3944 (when (gnus-summary-show-thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3945 ;; 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
|
3946 ;; 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
|
3947 ;; 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
|
3948 ;; So we go again. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3949 (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
|
3950 (gnus-run-hooks 'gnus-mark-article-hook) |
17493 | 3951 (gnus-set-mode-line 'summary) |
3952 (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
|
3953 (gnus-run-hooks 'gnus-visual-mark-article-hook)) |
17493 | 3954 ;; Set the global newsgroup variables here. |
3955 (gnus-set-global-variables) | |
3956 (setq gnus-have-all-headers | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3957 (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
|
3958 (save-excursion |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3959 (gnus-configure-windows 'article)) |
17493 | 3960 (when (or (numberp article) |
3961 (stringp article)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3962 (gnus-article-prepare-display) |
17493 | 3963 ;; Do page break. |
3964 (goto-char (point-min)) | |
88155 | 3965 (when gnus-break-pages |
3966 (gnus-narrow-to-page))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3967 (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
|
3968 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
|
3969 (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
|
3970 (article-goto-body) |
88155 | 3971 (unless (bobp) |
3972 (forward-line -1)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3973 (set-window-point (get-buffer-window (current-buffer)) (point)) |
17493 | 3974 (gnus-configure-windows 'article) |
3975 t)))))) | |
3976 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3977 ;;;###autoload |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3978 (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
|
3979 "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
|
3980 ;; 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
|
3981 ;; 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
|
3982 (let ((gnus-article-buffer (current-buffer)) |
88155 | 3983 buffer-read-only |
3984 (inhibit-read-only t)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3985 (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
|
3986 (gnus-article-mode)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3987 (setq buffer-read-only nil |
88155 | 3988 gnus-article-wash-types nil |
3989 gnus-article-image-alist nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3990 (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
|
3991 (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
|
3992 (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
|
3993 (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
|
3994 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3995 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3996 ;;; Gnus MIME viewing functions |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3997 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3998 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3999 (defvar gnus-mime-button-line-format "%{%([%p. %d%T]%)%}%e\n" |
88155 | 4000 "Format of the MIME buttons. |
4001 | |
4002 Valid specifiers include: | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4003 %t The MIME type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4004 %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
|
4005 %n The `name' parameter |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4006 %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
|
4007 %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
|
4008 %p The part identifier number |
88155 | 4009 %e Dots if the part isn't displayed |
4010 | |
4011 General format specifiers can also be used. See Info node | |
4012 `(gnus)Formatting Variables'.") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4013 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4014 (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
|
4015 '((?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
|
4016 (?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
|
4017 (?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
|
4018 (?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
|
4019 (?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
|
4020 (?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
|
4021 (?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
|
4022 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4023 (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
|
4024 '((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
|
4025 (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
|
4026 (gnus-mime-view-part-as-type "t" "View As Type...") |
88155 | 4027 (gnus-mime-view-part-as-charset "C" "View As charset...") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4028 (gnus-mime-save-part "o" "Save...") |
88155 | 4029 (gnus-mime-save-part-and-strip "\C-o" "Save and Strip") |
4030 (gnus-mime-delete-part "d" "Delete part") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4031 (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
|
4032 (gnus-mime-inline-part "i" "View As Text, In This Buffer") |
88155 | 4033 (gnus-mime-view-part-internally "E" "View Internally") |
4034 (gnus-mime-view-part-externally "e" "View Externally") | |
4035 (gnus-mime-print-part "p" "Print") | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4036 (gnus-mime-pipe-part "|" "Pipe To Command...") |
88155 | 4037 (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
|
4038 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4039 (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
|
4040 (if gnus-article-mime-handle-alist-1 |
88155 | 4041 (if (eq 1 (length gnus-article-mime-handle-alist-1)) |
4042 " (1 part)" | |
4043 (format " (%d parts)" (length gnus-article-mime-handle-alist-1))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4044 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4045 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4046 (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
|
4047 (let ((map (make-sparse-keymap))) |
88155 | 4048 (unless (>= (string-to-number emacs-version) 21) |
4049 ;; XEmacs doesn't care. | |
4050 (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
|
4051 (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
|
4052 (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
|
4053 (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
|
4054 (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
|
4055 map)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4056 |
88155 | 4057 (easy-menu-define |
4058 gnus-mime-button-menu gnus-mime-button-map "MIME button menu." | |
4059 `("MIME Part" | |
4060 ,@(mapcar (lambda (c) | |
4061 (vector (caddr c) (car c) :enable t)) | |
4062 gnus-mime-button-commands))) | |
4063 | |
4064 (eval-when-compile | |
4065 (define-compiler-macro popup-menu (&whole form | |
4066 menu &optional position prefix) | |
4067 (if (and (fboundp 'popup-menu) | |
4068 (not (memq 'popup-menu (assoc "lmenu" load-history)))) | |
4069 form | |
4070 ;; Gnus is probably running under Emacs 20. | |
4071 `(let* ((menu (cdr ,menu)) | |
4072 (response (x-popup-menu | |
4073 t (list (car menu) | |
4074 (cons "" (mapcar (lambda (c) | |
4075 (cons (caddr c) (car c))) | |
4076 (cdr menu))))))) | |
4077 (if response | |
4078 (call-interactively (nth 3 (assq response menu)))))))) | |
4079 | |
4080 (defun gnus-mime-button-menu (event prefix) | |
4081 "Construct a context-sensitive menu of MIME commands." | |
4082 (interactive "e\nP") | |
4083 (save-window-excursion | |
4084 (let ((pos (event-start event))) | |
4085 (select-window (posn-window pos)) | |
4086 (goto-char (posn-point pos)) | |
4087 (gnus-article-check-buffer) | |
4088 (popup-menu gnus-mime-button-menu nil prefix)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4089 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4090 (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
|
4091 "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
|
4092 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4093 (save-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4094 (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
|
4095 (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
|
4096 (mail-parse-charset gnus-newsgroup-charset) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
4097 (mail-parse-ignored-charsets |
88155 | 4098 (with-current-buffer gnus-summary-buffer |
4099 gnus-newsgroup-ignored-charsets))) | |
4100 (when handles | |
4101 (mm-remove-parts handles) | |
4102 (goto-char (point-min)) | |
4103 (or (search-forward "\n\n") (goto-char (point-max))) | |
4104 (let ((inhibit-read-only t)) | |
4105 (delete-region (point) (point-max)) | |
4106 (mm-display-parts handles)))))) | |
4107 | |
4108 (defun gnus-mime-save-part-and-strip () | |
4109 "Save the MIME part under point then replace it with an external body." | |
4110 (interactive) | |
4111 (gnus-article-check-buffer) | |
4112 (when (gnus-group-read-only-p) | |
4113 (error "The current group does not support deleting of parts")) | |
4114 (when (mm-complicated-handles gnus-article-mime-handles) | |
4115 (error "\ | |
4116 The current article has a complicated MIME structure, giving up...")) | |
4117 (when (gnus-yes-or-no-p "\ | |
4118 Deleting parts may malfunction or destroy the article; continue? ") | |
4119 (let* ((data (get-text-property (point) 'gnus-data)) | |
4120 file param | |
4121 (handles gnus-article-mime-handles)) | |
4122 (setq file (and data (mm-save-part data))) | |
4123 (when file | |
4124 (with-current-buffer (mm-handle-buffer data) | |
4125 (erase-buffer) | |
4126 (insert "Content-Type: " (mm-handle-media-type data)) | |
4127 (mml-insert-parameter-string (cdr (mm-handle-type data)) | |
4128 '(charset)) | |
4129 (insert "\n") | |
4130 (insert "Content-ID: " (message-make-message-id) "\n") | |
4131 (insert "Content-Transfer-Encoding: binary\n") | |
4132 (insert "\n")) | |
4133 (setcdr data | |
4134 (cdr (mm-make-handle nil | |
4135 `("message/external-body" | |
4136 (access-type . "LOCAL-FILE") | |
4137 (name . ,file))))) | |
4138 (set-buffer gnus-summary-buffer) | |
4139 (gnus-article-edit-article | |
4140 `(lambda () | |
4141 (erase-buffer) | |
4142 (let ((mail-parse-charset (or gnus-article-charset | |
4143 ',gnus-newsgroup-charset)) | |
4144 (mail-parse-ignored-charsets | |
4145 (or gnus-article-ignored-charsets | |
4146 ',gnus-newsgroup-ignored-charsets)) | |
4147 (mbl mml-buffer-list)) | |
4148 (setq mml-buffer-list nil) | |
4149 (insert-buffer-substring gnus-original-article-buffer) | |
4150 (mime-to-mml ',handles) | |
4151 (setq gnus-article-mime-handles nil) | |
4152 (let ((mbl1 mml-buffer-list)) | |
4153 (setq mml-buffer-list mbl) | |
4154 (set (make-local-variable 'mml-buffer-list) mbl1)) | |
4155 (gnus-make-local-hook 'kill-buffer-hook) | |
4156 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))) | |
4157 `(lambda (no-highlight) | |
4158 (let ((mail-parse-charset (or gnus-article-charset | |
4159 ',gnus-newsgroup-charset)) | |
4160 (message-options message-options) | |
4161 (message-options-set-recipient) | |
4162 (mail-parse-ignored-charsets | |
4163 (or gnus-article-ignored-charsets | |
4164 ',gnus-newsgroup-ignored-charsets))) | |
4165 (mml-to-mime) | |
4166 (mml-destroy-buffers) | |
4167 (remove-hook 'kill-buffer-hook | |
4168 'mml-destroy-buffers t) | |
4169 (kill-local-variable 'mml-buffer-list)) | |
4170 (gnus-summary-edit-article-done | |
4171 ,(or (mail-header-references gnus-current-headers) "") | |
4172 ,(gnus-group-read-only-p) | |
4173 ,gnus-summary-buffer no-highlight))))))) | |
4174 | |
4175 (defun gnus-mime-delete-part () | |
4176 "Delete the MIME part under point. | |
4177 Replace it with some information about the removed part." | |
4178 (interactive) | |
4179 (gnus-article-check-buffer) | |
4180 (when (gnus-group-read-only-p) | |
4181 (error "The current group does not support deleting of parts")) | |
4182 (when (mm-complicated-handles gnus-article-mime-handles) | |
4183 (error "\ | |
4184 The current article has a complicated MIME structure, giving up...")) | |
4185 (when (gnus-yes-or-no-p "\ | |
4186 Deleting parts may malfunction or destroy the article; continue? ") | |
4187 (let* ((data (get-text-property (point) 'gnus-data)) | |
4188 (handles gnus-article-mime-handles) | |
4189 (none "(none)") | |
4190 (description | |
4191 (or | |
4192 (mail-decode-encoded-word-string (or (mm-handle-description data) | |
4193 none)))) | |
4194 (filename | |
4195 (or (mail-content-type-get (mm-handle-disposition data) 'filename) | |
4196 none)) | |
4197 (type (mm-handle-media-type data))) | |
4198 (unless data | |
4199 (error "No MIME part under point")) | |
4200 (with-current-buffer (mm-handle-buffer data) | |
4201 (let ((bsize (format "%s" (buffer-size)))) | |
4202 (erase-buffer) | |
4203 (insert | |
4204 (concat | |
4205 ",----\n" | |
4206 "| The following attachment has been deleted:\n" | |
4207 "|\n" | |
4208 "| Type: " type "\n" | |
4209 "| Filename: " filename "\n" | |
4210 "| Size (encoded): " bsize " Byte\n" | |
4211 "| Description: " description "\n" | |
4212 "`----\n")) | |
4213 (setcdr data | |
4214 (cdr (mm-make-handle | |
4215 nil `("text/plain") nil nil | |
4216 (list "attachment") | |
4217 (format "Deleted attachment (%s bytes)" bsize)))))) | |
4218 (set-buffer gnus-summary-buffer) | |
4219 ;; FIXME: maybe some of the following code (borrowed from | |
4220 ;; `gnus-mime-save-part-and-strip') isn't necessary? | |
4221 (gnus-article-edit-article | |
4222 `(lambda () | |
4223 (erase-buffer) | |
4224 (let ((mail-parse-charset (or gnus-article-charset | |
4225 ',gnus-newsgroup-charset)) | |
4226 (mail-parse-ignored-charsets | |
4227 (or gnus-article-ignored-charsets | |
4228 ',gnus-newsgroup-ignored-charsets)) | |
4229 (mbl mml-buffer-list)) | |
4230 (setq mml-buffer-list nil) | |
4231 (insert-buffer-substring gnus-original-article-buffer) | |
4232 (mime-to-mml ',handles) | |
4233 (setq gnus-article-mime-handles nil) | |
4234 (let ((mbl1 mml-buffer-list)) | |
4235 (setq mml-buffer-list mbl) | |
4236 (set (make-local-variable 'mml-buffer-list) mbl1)) | |
4237 (gnus-make-local-hook 'kill-buffer-hook) | |
4238 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))) | |
4239 `(lambda (no-highlight) | |
4240 (let ((mail-parse-charset (or gnus-article-charset | |
4241 ',gnus-newsgroup-charset)) | |
4242 (message-options message-options) | |
4243 (message-options-set-recipient) | |
4244 (mail-parse-ignored-charsets | |
4245 (or gnus-article-ignored-charsets | |
4246 ',gnus-newsgroup-ignored-charsets))) | |
4247 (mml-to-mime) | |
4248 (mml-destroy-buffers) | |
4249 (remove-hook 'kill-buffer-hook | |
4250 'mml-destroy-buffers t) | |
4251 (kill-local-variable 'mml-buffer-list)) | |
4252 (gnus-summary-edit-article-done | |
4253 ,(or (mail-header-references gnus-current-headers) "") | |
4254 ,(gnus-group-read-only-p) | |
4255 ,gnus-summary-buffer no-highlight))))) | |
4256 ;; Not in `gnus-mime-save-part-and-strip': | |
4257 (gnus-article-edit-done) | |
4258 (gnus-summary-expand-window) | |
4259 (gnus-summary-show-article)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4260 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4261 (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
|
4262 "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
|
4263 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4264 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4265 (let ((data (get-text-property (point) 'gnus-data))) |
88155 | 4266 (when data |
4267 (mm-save-part data)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4268 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4269 (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
|
4270 "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
|
4271 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4272 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4273 (let ((data (get-text-property (point) 'gnus-data))) |
88155 | 4274 (when data |
4275 (mm-pipe-part data)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4276 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4277 (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
|
4278 "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
|
4279 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4280 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4281 (let ((data (get-text-property (point) 'gnus-data))) |
88155 | 4282 (when data |
4283 (setq gnus-article-mime-handles | |
4284 (mm-merge-handles | |
4285 gnus-article-mime-handles (setq data (copy-sequence data)))) | |
4286 (mm-interactively-view-part data)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4287 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4288 (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
|
4289 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4290 (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
|
4291 (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
|
4292 'name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4293 (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
|
4294 (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
|
4295 |
88155 | 4296 (defun gnus-mime-view-part-as-type (&optional mime-type) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4297 "Choose a MIME media type, and view the part as such." |
88155 | 4298 (interactive) |
4299 (unless mime-type | |
4300 (setq mime-type (completing-read | |
4301 "View as MIME type: " | |
4302 (mapcar #'list (mailcap-mime-types)) | |
4303 nil nil | |
4304 (gnus-mime-view-part-as-type-internal)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4305 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4306 (let ((handle (get-text-property (point) 'gnus-data))) |
88155 | 4307 (when handle |
4308 (setq handle | |
4309 (mm-make-handle (mm-handle-buffer handle) | |
4310 (cons mime-type (cdr (mm-handle-type handle))) | |
4311 (mm-handle-encoding handle) | |
4312 (mm-handle-undisplayer handle) | |
4313 (mm-handle-disposition handle) | |
4314 (mm-handle-description handle) | |
4315 nil | |
4316 (mm-handle-id handle))) | |
4317 (setq gnus-article-mime-handles | |
4318 (mm-merge-handles gnus-article-mime-handles handle)) | |
4319 (gnus-mm-display-part handle)))) | |
4320 | |
4321 (eval-when-compile | |
4322 (require 'jka-compr)) | |
4323 | |
4324 ;; jka-compr.el uses a "sh -c" to direct stderr to err-file, but these days | |
4325 ;; emacs can do that itself. | |
4326 ;; | |
4327 (defun gnus-mime-jka-compr-maybe-uncompress () | |
4328 "Uncompress the current buffer if `auto-compression-mode' is enabled. | |
4329 The uncompress method used is derived from `buffer-file-name'." | |
4330 (when (and (fboundp 'jka-compr-installed-p) | |
4331 (jka-compr-installed-p)) | |
4332 (let ((info (jka-compr-get-compression-info buffer-file-name))) | |
4333 (when info | |
4334 (let ((basename (file-name-nondirectory buffer-file-name)) | |
4335 (args (jka-compr-info-uncompress-args info)) | |
4336 (prog (jka-compr-info-uncompress-program info)) | |
4337 (message (jka-compr-info-uncompress-message info)) | |
4338 (err-file (jka-compr-make-temp-name))) | |
4339 (if message | |
4340 (message "%s %s..." message basename)) | |
4341 (unwind-protect | |
4342 (unless (memq (apply 'call-process-region | |
4343 (point-min) (point-max) | |
4344 prog | |
4345 t (list t err-file) nil | |
4346 args) | |
4347 jka-compr-acceptable-retval-list) | |
4348 (jka-compr-error prog args basename message err-file)) | |
4349 (jka-compr-delete-temp-file err-file))))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4350 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4351 (defun gnus-mime-copy-part (&optional handle) |
88155 | 4352 "Put the MIME part under point into a new buffer. |
4353 If `auto-compression-mode' is enabled, compressed files like .gz and .bz2 | |
4354 are decompressed." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4355 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4356 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4357 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) |
88155 | 4358 (contents (and handle (mm-get-part handle))) |
4359 (base (and handle | |
4360 (file-name-nondirectory | |
4361 (or | |
4362 (mail-content-type-get (mm-handle-type handle) 'name) | |
4363 (mail-content-type-get (mm-handle-disposition handle) | |
4364 'filename) | |
4365 "*decoded*")))) | |
4366 (buffer (and base (generate-new-buffer base)))) | |
4367 (when contents | |
4368 (switch-to-buffer buffer) | |
4369 (insert contents) | |
4370 ;; We do it this way to make `normal-mode' set the appropriate mode. | |
4371 (unwind-protect | |
4372 (progn | |
4373 (setq buffer-file-name (expand-file-name base)) | |
4374 (gnus-mime-jka-compr-maybe-uncompress) | |
4375 (normal-mode)) | |
4376 (setq buffer-file-name nil)) | |
4377 (goto-char (point-min))))) | |
4378 | |
4379 (defun gnus-mime-print-part (&optional handle filename) | |
4380 "Print the MIME part under point." | |
4381 (interactive (list nil (ps-print-preprint current-prefix-arg))) | |
4382 (gnus-article-check-buffer) | |
4383 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) | |
4384 (contents (and handle (mm-get-part handle))) | |
4385 (file (mm-make-temp-file (expand-file-name "mm." mm-tmp-directory))) | |
4386 (printer (mailcap-mime-info (mm-handle-media-type handle) "print"))) | |
4387 (when contents | |
4388 (if printer | |
4389 (unwind-protect | |
4390 (progn | |
4391 (mm-save-part-to-file handle file) | |
4392 (call-process shell-file-name nil | |
4393 (generate-new-buffer " *mm*") | |
4394 nil | |
4395 shell-command-switch | |
4396 (mm-mailcap-command | |
4397 printer file (mm-handle-type handle)))) | |
4398 (delete-file file)) | |
4399 (with-temp-buffer | |
4400 (insert contents) | |
4401 (gnus-print-buffer)) | |
4402 (ps-despool filename))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4403 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4404 (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
|
4405 "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
|
4406 (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
|
4407 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4408 (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
|
4409 contents charset |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4410 (b (point)) |
88155 | 4411 (inhibit-read-only t)) |
4412 (when handle | |
4413 (if (and (not arg) (mm-handle-undisplayer handle)) | |
4414 (mm-remove-part handle) | |
4415 (setq contents (mm-get-part handle)) | |
4416 (cond | |
4417 ((not arg) | |
4418 (setq charset (or (mail-content-type-get | |
4419 (mm-handle-type handle) 'charset) | |
4420 gnus-newsgroup-charset))) | |
4421 ((numberp arg) | |
4422 (if (mm-handle-undisplayer handle) | |
4423 (mm-remove-part handle)) | |
4424 (setq charset | |
4425 (or (cdr (assq arg | |
4426 gnus-summary-show-article-charset-alist)) | |
4427 (mm-read-coding-system "Charset: ")))) | |
4428 (t | |
4429 (if (mm-handle-undisplayer handle) | |
4430 (mm-remove-part handle)))) | |
4431 (forward-line 2) | |
4432 (mm-insert-inline | |
4433 handle | |
4434 (if (and charset | |
4435 (setq charset (mm-charset-to-coding-system | |
4436 charset)) | |
4437 (not (eq charset 'ascii))) | |
4438 (mm-decode-coding-string contents charset) | |
4439 (mm-string-to-multibyte contents))) | |
4440 (goto-char b))))) | |
4441 | |
4442 (defun gnus-mime-view-part-as-charset (&optional handle arg) | |
4443 "Insert the MIME part under point into the current buffer using the | |
4444 specified charset." | |
4445 (interactive (list nil current-prefix-arg)) | |
4446 (gnus-article-check-buffer) | |
4447 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) | |
4448 contents charset | |
4449 (b (point)) | |
4450 (inhibit-read-only t)) | |
4451 (when handle | |
4452 (if (mm-handle-undisplayer handle) | |
4453 (mm-remove-part handle)) | |
4454 (let ((gnus-newsgroup-charset | |
4455 (or (cdr (assq arg | |
4456 gnus-summary-show-article-charset-alist)) | |
4457 (mm-read-coding-system "Charset: "))) | |
4458 (gnus-newsgroup-ignored-charsets 'gnus-all)) | |
4459 (gnus-article-press-button))))) | |
4460 | |
4461 (defun gnus-mime-view-part-externally (&optional handle) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4462 "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
|
4463 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4464 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4465 (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
|
4466 (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
|
4467 (mm-inlined-types nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4468 (mail-parse-charset gnus-newsgroup-charset) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
4469 (mail-parse-ignored-charsets |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4470 (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
|
4471 gnus-newsgroup-ignored-charsets))) |
88155 | 4472 (when handle |
4473 (if (mm-handle-undisplayer handle) | |
4474 (mm-remove-part handle) | |
4475 (mm-display-part handle))))) | |
4476 | |
4477 (defun gnus-mime-view-part-internally (&optional handle) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4478 "View the MIME part under point with an internal viewer. |
88155 | 4479 If no internal viewer is available, use an external viewer." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4480 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4481 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4482 (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
|
4483 (mm-inlined-types '(".*")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4484 (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
|
4485 (mail-parse-charset gnus-newsgroup-charset) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
4486 (mail-parse-ignored-charsets |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4487 (save-excursion (set-buffer gnus-summary-buffer) |
88155 | 4488 gnus-newsgroup-ignored-charsets)) |
4489 (inhibit-read-only t)) | |
4490 (when handle | |
4491 (if (mm-handle-undisplayer handle) | |
4492 (mm-remove-part handle) | |
4493 (mm-display-part handle))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4494 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4495 (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
|
4496 "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
|
4497 (interactive |
88155 | 4498 (list (completing-read "Action: " gnus-mime-action-alist nil t))) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4499 (gnus-article-check-buffer) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4500 (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
|
4501 (if action-pair |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4502 (funcall (cdr action-pair))))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4503 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4504 (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
|
4505 (save-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4506 (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
|
4507 (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
|
4508 (error "No such part")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4509 (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
|
4510 (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
|
4511 (funcall function handle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4512 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4513 (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
|
4514 "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
|
4515 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4516 (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
|
4517 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4518 (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
|
4519 "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
|
4520 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4521 (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
|
4522 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4523 (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
|
4524 "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
|
4525 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4526 (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
|
4527 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4528 (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
|
4529 "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
|
4530 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4531 (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
|
4532 |
88155 | 4533 (defun gnus-article-view-part-as-charset (n) |
4534 "View MIME part N using a specified charset. | |
4535 N is the numerical prefix." | |
4536 (interactive "p") | |
4537 (gnus-article-part-wrapper n 'gnus-mime-view-part-as-charset)) | |
4538 | |
4539 (defun gnus-article-view-part-externally (n) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4540 "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
|
4541 (interactive "p") |
88155 | 4542 (gnus-article-part-wrapper n 'gnus-mime-view-part-externally)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4543 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4544 (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
|
4545 "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
|
4546 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4547 (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
|
4548 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4549 (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
|
4550 (if condition |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4551 (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
|
4552 (while (setq ihandle (pop alist)) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
4553 (if (and (cond |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4554 ((functionp condition) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4555 (funcall condition (cdr ihandle))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
4556 ((eq condition 'undisplayed) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4557 (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
|
4558 (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
|
4559 "multipart/alternative")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4560 ((eq condition 'undisplayed-alternative) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4561 (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
|
4562 (t t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4563 (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
|
4564 (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
|
4565 (setq n (car ihandle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4566 (or n 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4567 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4568 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4569 (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
|
4570 "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
|
4571 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4572 (save-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4573 (set-buffer gnus-article-buffer) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
4574 (or (numberp n) (setq n (gnus-article-mime-match-handle-first |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4575 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
|
4576 (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
|
4577 (error "No such part")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4578 (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
|
4579 (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
|
4580 (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
|
4581 (gnus-article-press-button) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4582 (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
|
4583 (gnus-set-window-start))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4584 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4585 (defsubst gnus-article-mime-total-parts () |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4586 (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
|
4587 1 ;; single part |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4588 (1- (length gnus-article-mime-handles)))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4589 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4590 (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
|
4591 "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
|
4592 (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
|
4593 (point (point)) |
88155 | 4594 (inhibit-read-only t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4595 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4596 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4597 (let ((window (selected-window)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4598 (mail-parse-charset gnus-newsgroup-charset) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
4599 (mail-parse-ignored-charsets |
88155 | 4600 (if (gnus-buffer-live-p gnus-summary-buffer) |
4601 (save-excursion | |
4602 (set-buffer gnus-summary-buffer) | |
4603 gnus-newsgroup-ignored-charsets) | |
4604 nil))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4605 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4606 (unwind-protect |
88155 | 4607 (let ((win (gnus-get-buffer-window (current-buffer) t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4608 (beg (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4609 (when win |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4610 (select-window win)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4611 (goto-char point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4612 (forward-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4613 (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
|
4614 ;; 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
|
4615 (mm-display-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4616 (save-restriction |
88155 | 4617 (narrow-to-region (point) |
4618 (if (eobp) (point) (1+ (point)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4619 (mm-display-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4620 ;; 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
|
4621 ;; 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
|
4622 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4623 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4624 (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
|
4625 (gnus-treat-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4626 nil id |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4627 (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
|
4628 (mm-handle-media-type handle))))) |
88155 | 4629 (if (window-live-p window) |
4630 (select-window window))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4631 (goto-char point) |
88155 | 4632 (gnus-delete-line) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4633 (gnus-insert-mime-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4634 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
|
4635 (goto-char point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4636 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4637 (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
|
4638 "Go to MIME part N." |
88155 | 4639 (gnus-goto-char (text-property-any (point-min) (point-max) 'gnus-part n))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4640 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4641 (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
|
4642 (let ((gnus-tmp-name |
88155 | 4643 (or (mail-content-type-get (mm-handle-type handle) 'name) |
4644 (mail-content-type-get (mm-handle-disposition handle) 'filename) | |
4645 (mail-content-type-get (mm-handle-type handle) 'url) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4646 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4647 (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
|
4648 (gnus-tmp-description |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4649 (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
|
4650 ""))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4651 (gnus-tmp-dots |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4652 (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
|
4653 (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
|
4654 "" "...")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4655 (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
|
4656 (buffer-size))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4657 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
|
4658 (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
|
4659 (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
|
4660 (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
|
4661 (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
|
4662 (concat "; " gnus-tmp-name)))) |
88155 | 4663 (unless (equal gnus-tmp-description "") |
4664 (setq gnus-tmp-type-long (concat " --- " gnus-tmp-type-long))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4665 (unless (bolp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4666 (insert "\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4667 (setq b (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4668 (gnus-eval-format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4669 gnus-mime-button-line-format gnus-mime-button-line-format-alist |
88155 | 4670 `(,@(gnus-local-map-property gnus-mime-button-map) |
4671 gnus-callback gnus-mm-display-part | |
4672 gnus-part ,gnus-tmp-id | |
4673 article-type annotation | |
4674 gnus-data ,handle)) | |
4675 (setq e (if (bolp) | |
4676 ;; Exclude a newline. | |
4677 (1- (point)) | |
4678 (point))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4679 (widget-convert-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4680 'link b e |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4681 :mime-handle handle |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4682 :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
|
4683 :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
|
4684 :help-echo |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4685 (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
|
4686 ;; 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
|
4687 ;; wid-edit (XEmacs only). |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4688 (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
|
4689 (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
|
4690 (format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4691 "%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
|
4692 (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
|
4693 ;; 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
|
4694 ;; window, overlay, position. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4695 (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
|
4696 (if overlay |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4697 (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
|
4698 (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
|
4699 :mime-handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4700 (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
|
4701 "hide" "show") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4702 (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
|
4703 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4704 (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
|
4705 (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
|
4706 (gnus-article-press-button)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4707 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4708 (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
|
4709 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4710 (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
|
4711 "Display the MIME parts." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4712 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4713 (save-selected-window |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4714 (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
|
4715 (point (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4716 (when window |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4717 (select-window window) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4718 ;; 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
|
4719 ;; 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
|
4720 (set-window-point window point))) |
88155 | 4721 (let* ((handles (or ihandles |
4722 (mm-dissect-buffer nil gnus-article-loose-mime) | |
4723 (and gnus-article-emulate-mime | |
4724 (mm-uu-dissect)))) | |
4725 (inhibit-read-only t) handle name type b e display) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4726 (when (and (not ihandles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4727 (not gnus-displaying-mime)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4728 ;; 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
|
4729 (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
|
4730 (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
|
4731 (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
|
4732 (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
|
4733 ;; 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
|
4734 (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
|
4735 (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
|
4736 (if (and handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4737 (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
|
4738 (cdr handles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4739 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4740 (when (and (not ihandles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4741 (not gnus-displaying-mime)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4742 ;; 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
|
4743 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4744 (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
|
4745 (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
|
4746 (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
|
4747 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4748 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4749 (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
|
4750 (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
|
4751 (widen))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4752 (unless ihandles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4753 ;; Highlight the headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4754 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4755 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4756 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4757 (narrow-to-region (point-min) (point)) |
88155 | 4758 (gnus-article-save-original-date |
4759 (gnus-treat-article 'head))))))))) | |
4760 | |
4761 (defcustom gnus-mime-display-multipart-as-mixed nil | |
4762 "Display \"multipart\" parts as \"multipart/mixed\". | |
4763 | |
4764 If t, it overrides nil values of | |
4765 `gnus-mime-display-multipart-alternative-as-mixed' and | |
4766 `gnus-mime-display-multipart-related-as-mixed'." | |
4767 :group 'gnus-article-mime | |
4768 :type 'boolean) | |
4769 | |
4770 (defcustom gnus-mime-display-multipart-alternative-as-mixed nil | |
4771 "Display \"multipart/alternative\" parts as \"multipart/mixed\"." | |
4772 :version "22.1" | |
4773 :group 'gnus-article-mime | |
4774 :type 'boolean) | |
4775 | |
4776 (defcustom gnus-mime-display-multipart-related-as-mixed nil | |
4777 "Display \"multipart/related\" parts as \"multipart/mixed\". | |
4778 | |
4779 If displaying \"text/html\" is discouraged \(see | |
4780 `mm-discouraged-alternatives'\) images or other material inside a | |
4781 \"multipart/related\" part might be overlooked when this variable is nil." | |
4782 :version "22.1" | |
4783 :group 'gnus-article-mime | |
4784 :type 'boolean) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4785 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4786 (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
|
4787 (cond |
88155 | 4788 ;; Maybe a broken MIME message. |
4789 ((null handle)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4790 ;; Single part. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4791 ((not (stringp (car handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4792 (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
|
4793 ;; User-defined multipart |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4794 ((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
|
4795 (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
|
4796 handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4797 ;; multipart/alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4798 ((and (equal (car handle) "multipart/alternative") |
88155 | 4799 (not (or gnus-mime-display-multipart-as-mixed |
4800 gnus-mime-display-multipart-alternative-as-mixed))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4801 (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
|
4802 (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
|
4803 (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
|
4804 ;; multipart/related |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4805 ((and (equal (car handle) "multipart/related") |
88155 | 4806 (not (or gnus-mime-display-multipart-as-mixed |
4807 gnus-mime-display-multipart-related-as-mixed))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4808 ;;;!!!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
|
4809 ;;;!!!to the first part. |
88155 | 4810 ;;(gnus-mime-display-part (cadr handle)) |
4811 ;;;!!! Most multipart/related is an HTML message plus images. | |
4812 ;;;!!! Unfortunately we are unable to let W3 display those | |
4813 ;;;!!! included images, so we just display it as a mixed multipart. | |
4814 ;;(gnus-mime-display-mixed (cdr handle)) | |
4815 ;;;!!! No, w3 can display everything just fine. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4816 (gnus-mime-display-part (cadr handle))) |
88155 | 4817 ((equal (car handle) "multipart/signed") |
4818 (gnus-add-wash-type 'signed) | |
4819 (gnus-mime-display-security handle)) | |
4820 ((equal (car handle) "multipart/encrypted") | |
4821 (gnus-add-wash-type 'encrypted) | |
4822 (gnus-mime-display-security handle)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4823 ;; 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
|
4824 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4825 (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
|
4826 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4827 (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
|
4828 (if (stringp (car handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4829 (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
|
4830 (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
|
4831 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4832 (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
|
4833 (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
|
4834 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4835 (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
|
4836 (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
|
4837 (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
|
4838 (not-attachment t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4839 (move nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4840 display text) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4841 (catch 'ignored |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4842 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4843 (while ignored |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4844 (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
|
4845 (throw 'ignored nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4846 (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
|
4847 (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
|
4848 (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
|
4849 (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
|
4850 "inline") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4851 (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
|
4852 (mm-automatic-display-p handle) |
88155 | 4853 (or (and |
4854 (mm-inlinable-p handle) | |
4855 (mm-inlined-p handle)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4856 (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
|
4857 (setq display t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4858 (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
|
4859 (setq text t))) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4860 (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
|
4861 beg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4862 (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
|
4863 (when (or (not display) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4864 (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
|
4865 ;(gnus-article-insert-newline) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4866 (gnus-insert-mime-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4867 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
|
4868 (gnus-article-insert-newline) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4869 ;(gnus-article-insert-newline) |
88155 | 4870 ;; Remember modify the number of forward lines. |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4871 (setq move t)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4872 (setq beg (point)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4873 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4874 (display |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4875 (when move |
88155 | 4876 (forward-line -1) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4877 (setq beg (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4878 (let ((mail-parse-charset gnus-newsgroup-charset) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
4879 (mail-parse-ignored-charsets |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4880 (save-excursion (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4881 (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
|
4882 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4883 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4884 (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
|
4885 (goto-char (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4886 ((and text not-attachment) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4887 (when move |
88155 | 4888 (forward-line -1) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4889 (setq beg (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4890 (gnus-article-insert-newline) |
88155 | 4891 (mm-insert-inline |
4892 handle | |
4893 (let ((charset (mail-content-type-get (mm-handle-type handle) | |
4894 'charset))) | |
4895 (cond ((not charset) | |
4896 (mm-string-as-multibyte (mm-get-part handle))) | |
4897 ((eq charset 'gnus-decoded) | |
4898 (with-current-buffer (mm-handle-buffer handle) | |
4899 (buffer-string))) | |
4900 (t | |
4901 (mm-decode-string (mm-get-part handle) charset))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4902 (goto-char (point-max)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4903 ;; Do highlighting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4904 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4905 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4906 (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
|
4907 (gnus-treat-article |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
4908 nil id |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4909 (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
|
4910 (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
|
4911 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4912 (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
|
4913 "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
|
4914 (unless gnus-inhibit-mime-unbuttonizing |
88155 | 4915 (when (catch 'found |
4916 (let ((types gnus-unbuttonized-mime-types)) | |
4917 (while types | |
4918 (when (string-match (pop types) type) | |
4919 (throw 'found t))))) | |
4920 (not (catch 'found | |
4921 (let ((types gnus-buttonized-mime-types)) | |
4922 (while types | |
4923 (when (string-match (pop types) type) | |
4924 (throw 'found t))))))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4925 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4926 (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
|
4927 "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
|
4928 (gnus-put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4929 (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
|
4930 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4931 (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
|
4932 (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
|
4933 (ihandles handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4934 (point (point)) |
88155 | 4935 handle (inhibit-read-only t) from props begend not-pref) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4936 (save-window-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4937 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4938 (when ibegend |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4939 (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
|
4940 (or (cdr ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4941 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4942 (goto-char (car ibegend)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4943 (forward-line 2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4944 (point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4945 (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
|
4946 (mm-remove-parts handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4947 (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
|
4948 ;; Do the toggle. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4949 (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
|
4950 (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
|
4951 (when (or ibegend |
88155 | 4952 (not preferred) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4953 (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
|
4954 "multipart/alternative"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4955 (gnus-add-text-properties |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4956 (setq from (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4957 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4958 (insert (format "%d. " id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4959 (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4960 `(gnus-callback |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4961 (lambda (handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4962 (unless ,(not ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4963 (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
|
4964 ',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
|
4965 (gnus-mime-display-alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4966 ',ihandles ',not-pref ',begend ,id)) |
88155 | 4967 ,@(gnus-local-map-property 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
|
4968 ,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
|
4969 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
|
4970 gnus-part ,id |
88155 | 4971 article-type multipart)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4972 (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
|
4973 :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
|
4974 :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
|
4975 ;; Do the handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4976 (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
|
4977 (gnus-add-text-properties |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4978 (setq from (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4979 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4980 (insert (format "(%c) %-18s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4981 (if (equal handle preferred) ?* ? ) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4982 (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
|
4983 (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4984 `(gnus-callback |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4985 (lambda (handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4986 (unless ,(not ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4987 (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
|
4988 ',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
|
4989 (gnus-mime-display-alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4990 ',ihandles ',handle ',begend ,id)) |
88155 | 4991 ,@(gnus-local-map-property 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
|
4992 ,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
|
4993 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
|
4994 gnus-part ,id |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4995 gnus-data ,handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4996 (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
|
4997 :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
|
4998 :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
|
4999 (insert " ")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5000 (insert "\n\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5001 (when preferred |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5002 (if (stringp (car preferred)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5003 (gnus-display-mime preferred) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5004 (let ((mail-parse-charset gnus-newsgroup-charset) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
5005 (mail-parse-ignored-charsets |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5006 (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
|
5007 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5008 (mm-display-part preferred) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5009 ;; Do highlighting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5010 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5011 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5012 (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
|
5013 (gnus-treat-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5014 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
|
5015 (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
|
5016 (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
|
5017 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5018 (setcdr begend (point-marker))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5019 (when ibegend |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5020 (goto-char point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5021 |
88155 | 5022 (defconst gnus-article-wash-status-strings |
5023 (let ((alist '((cite "c" "Possible hidden citation text" | |
5024 " " "All citation text visible") | |
5025 (headers "h" "Hidden headers" | |
5026 " " "All headers visible.") | |
5027 (pgp "p" "Encrypted or signed message status hidden" | |
5028 " " "No hidden encryption nor digital signature status") | |
5029 (signature "s" "Signature has been hidden" | |
5030 " " "Signature is visible") | |
5031 (overstrike "o" "Overstrike (^H) characters applied" | |
5032 " " "No overstrike characters applied") | |
5033 (emphasis "e" "/*_Emphasis_*/ characters applied" | |
5034 " " "No /*_emphasis_*/ characters applied"))) | |
5035 result) | |
5036 (dolist (entry alist result) | |
5037 (let ((key (nth 0 entry)) | |
5038 (on (copy-sequence (nth 1 entry))) | |
5039 (on-help (nth 2 entry)) | |
5040 (off (copy-sequence (nth 3 entry))) | |
5041 (off-help (nth 4 entry))) | |
5042 (put-text-property 0 1 'help-echo on-help on) | |
5043 (put-text-property 0 1 'help-echo off-help off) | |
5044 (push (list key on off) result)))) | |
5045 "Alist of strings describing wash status in the mode line. | |
5046 Each entry has the form (KEY ON OF), where the KEY is a symbol | |
5047 representing the particular washing function, ON is the string to use | |
5048 in the article mode line when the washing function is active, and OFF | |
5049 is the string to use when it is inactive.") | |
5050 | |
5051 (defun gnus-article-wash-status-entry (key value) | |
5052 (let ((entry (assoc key gnus-article-wash-status-strings))) | |
5053 (if value (nth 1 entry) (nth 2 entry)))) | |
5054 | |
17493 | 5055 (defun gnus-article-wash-status () |
5056 "Return a string which display status of article washing." | |
5057 (save-excursion | |
5058 (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
|
5059 (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
|
5060 (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
|
5061 (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
|
5062 (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
|
5063 (pem (memq 'pem gnus-article-wash-types)) |
88155 | 5064 (signed (memq 'signed gnus-article-wash-types)) |
5065 (encrypted (memq 'encrypted gnus-article-wash-types)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5066 (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
|
5067 (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
|
5068 (emphasis (memq 'emphasis gnus-article-wash-types))) |
88155 | 5069 (concat |
5070 (gnus-article-wash-status-entry 'cite cite) | |
5071 (gnus-article-wash-status-entry 'headers (or headers boring)) | |
5072 (gnus-article-wash-status-entry 'pgp (or pgp pem signed encrypted)) | |
5073 (gnus-article-wash-status-entry 'signature signature) | |
5074 (gnus-article-wash-status-entry 'overstrike overstrike) | |
5075 (gnus-article-wash-status-entry 'emphasis emphasis))))) | |
5076 | |
5077 (defun gnus-add-wash-type (type) | |
5078 "Add a washing of TYPE to the current status." | |
5079 (add-to-list 'gnus-article-wash-types type)) | |
5080 | |
5081 (defun gnus-delete-wash-type (type) | |
5082 "Add a washing of TYPE to the current status." | |
5083 (setq gnus-article-wash-types (delq type gnus-article-wash-types))) | |
5084 | |
5085 (defun gnus-add-image (category image) | |
5086 "Add IMAGE of CATEGORY to the list of displayed images." | |
5087 (let ((entry (assq category gnus-article-image-alist))) | |
5088 (unless entry | |
5089 (setq entry (list category)) | |
5090 (push entry gnus-article-image-alist)) | |
5091 (nconc entry (list image)))) | |
5092 | |
5093 (defun gnus-delete-images (category) | |
5094 "Delete all images in CATEGORY." | |
5095 (let ((entry (assq category gnus-article-image-alist))) | |
5096 (dolist (image (cdr entry)) | |
5097 (gnus-remove-image image category)) | |
5098 (setq gnus-article-image-alist (delq entry gnus-article-image-alist)) | |
5099 (gnus-delete-wash-type category))) | |
17493 | 5100 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5101 (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
|
5102 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5103 (defun gnus-article-maybe-hide-headers () |
17493 | 5104 "Hide unwanted headers if `gnus-have-all-headers' is nil. |
5105 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
|
5106 (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
|
5107 (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
|
5108 gnus-have-all-headers))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5109 (not gnus-inhibit-hiding)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5110 (gnus-article-hide-headers))) |
17493 | 5111 |
5112 ;;; Article savers. | |
5113 | |
5114 (defun gnus-output-to-file (file-name) | |
5115 "Append the current article to a file named FILE-NAME." | |
5116 (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
|
5117 (with-temp-buffer |
17493 | 5118 (insert-buffer-substring artbuf) |
5119 ;; Append newline at end of the buffer as separator, and then | |
5120 ;; save it to file. | |
5121 (goto-char (point-max)) | |
5122 (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
|
5123 (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
|
5124 (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
|
5125 t))) |
17493 | 5126 |
5127 (defun gnus-narrow-to-page (&optional arg) | |
5128 "Narrow the article buffer to a page. | |
5129 If given a numerical ARG, move forward ARG pages." | |
5130 (interactive "P") | |
5131 (setq arg (if arg (prefix-numeric-value arg) 0)) | |
5132 (save-excursion | |
5133 (set-buffer gnus-article-buffer) | |
5134 (goto-char (point-min)) | |
5135 (widen) | |
5136 ;; Remove any old next/prev buttons. | |
5137 (when (gnus-visual-p 'page-marker) | |
88155 | 5138 (let ((inhibit-read-only t)) |
17493 | 5139 (gnus-remove-text-with-property 'gnus-prev) |
5140 (gnus-remove-text-with-property 'gnus-next))) | |
88155 | 5141 (if |
17493 | 5142 (cond ((< arg 0) |
5143 (re-search-backward page-delimiter nil 'move (1+ (abs arg)))) | |
5144 ((> arg 0) | |
5145 (re-search-forward page-delimiter nil 'move arg))) | |
88155 | 5146 (goto-char (match-end 0)) |
17493 | 5147 (save-excursion |
5148 (goto-char (point-min)) | |
88155 | 5149 (setq gnus-page-broken |
5150 (and (re-search-forward page-delimiter nil t) t)))) | |
5151 (when gnus-page-broken | |
5152 (narrow-to-region | |
5153 (point) | |
5154 (if (re-search-forward page-delimiter nil 'move) | |
5155 (match-beginning 0) | |
5156 (point))) | |
5157 (when (and (gnus-visual-p 'page-marker) | |
5158 (> (point-min) (save-restriction (widen) (point-min)))) | |
5159 (save-excursion | |
5160 (goto-char (point-min)) | |
5161 (gnus-insert-prev-page-button))) | |
5162 (when (and (gnus-visual-p 'page-marker) | |
5163 (< (point-max) (save-restriction (widen) (point-max)))) | |
5164 (save-excursion | |
5165 (goto-char (point-max)) | |
5166 (gnus-insert-next-page-button)))))) | |
17493 | 5167 |
5168 ;; Article mode commands | |
5169 | |
5170 (defun gnus-article-goto-next-page () | |
5171 "Show the next page of the article." | |
5172 (interactive) | |
5173 (when (gnus-article-next-page) | |
5174 (goto-char (point-min)) | |
5175 (gnus-article-read-summary-keys nil (gnus-character-to-event ?n)))) | |
5176 | |
88155 | 5177 |
17493 | 5178 (defun gnus-article-goto-prev-page () |
88155 | 5179 "Show the previous page of the article." |
17493 | 5180 (interactive) |
88155 | 5181 (if (bobp) |
5182 (gnus-article-read-summary-keys nil (gnus-character-to-event ?p)) | |
17493 | 5183 (gnus-article-prev-page nil))) |
5184 | |
88155 | 5185 ;; This is cleaner but currently breaks `gnus-pick-mode': |
5186 ;; | |
5187 ;; (defun gnus-article-goto-next-page () | |
5188 ;; "Show the next page of the article." | |
5189 ;; (interactive) | |
5190 ;; (gnus-eval-in-buffer-window gnus-summary-buffer | |
5191 ;; (gnus-summary-next-page))) | |
5192 ;; | |
5193 ;; (defun gnus-article-goto-prev-page () | |
5194 ;; "Show the next page of the article." | |
5195 ;; (interactive) | |
5196 ;; (gnus-eval-in-buffer-window gnus-summary-buffer | |
5197 ;; (gnus-summary-prev-page))) | |
5198 | |
17493 | 5199 (defun gnus-article-next-page (&optional lines) |
5200 "Show the next page of the current article. | |
5201 If end of article, return non-nil. Otherwise return nil. | |
5202 Argument LINES specifies lines to be scrolled up." | |
5203 (interactive "p") | |
5204 (move-to-window-line -1) | |
5205 (if (save-excursion | |
5206 (end-of-line) | |
5207 (and (pos-visible-in-window-p) ;Not continuation line. | |
88155 | 5208 (>= (1+ (point)) (point-max)))) ;Allow for trailing newline. |
17493 | 5209 ;; Nothing in this page. |
5210 (if (or (not gnus-page-broken) | |
5211 (save-excursion | |
5212 (save-restriction | |
88155 | 5213 (widen) |
5214 (forward-line) | |
5215 (eobp)))) ;Real end-of-buffer? | |
5216 (progn | |
5217 (when gnus-article-over-scroll | |
5218 (gnus-article-next-page-1 lines)) | |
5219 t) ;Nothing more. | |
17493 | 5220 (gnus-narrow-to-page 1) ;Go to next page. |
5221 nil) | |
5222 ;; More in this page. | |
88155 | 5223 (gnus-article-next-page-1 lines) |
17493 | 5224 nil)) |
5225 | |
88155 | 5226 (defmacro gnus-article-beginning-of-window () |
5227 "Move point to the beginning of the window. | |
5228 In Emacs, the point is placed at the line number which `scroll-margin' | |
5229 specifies." | |
5230 (if (featurep 'xemacs) | |
5231 '(move-to-window-line 0) | |
5232 '(move-to-window-line | |
5233 (min (max 0 scroll-margin) | |
5234 (max 1 (- (window-height) | |
5235 (if mode-line-format 1 0) | |
5236 (if (and (boundp 'header-line-format) | |
5237 (symbol-value 'header-line-format)) | |
5238 1 0))))))) | |
5239 | |
5240 (defun gnus-article-next-page-1 (lines) | |
5241 (when (and (not (featurep 'xemacs)) | |
5242 (numberp lines) | |
5243 (> lines 0) | |
5244 (numberp (symbol-value 'scroll-margin)) | |
5245 (> (symbol-value 'scroll-margin) 0)) | |
5246 ;; Protect against the bug that Emacs 21.x hangs up when scrolling up for | |
5247 ;; too many number of lines if `scroll-margin' is set as two or greater. | |
5248 (setq lines (min lines | |
5249 (max 0 (- (count-lines (window-start) (point-max)) | |
5250 (symbol-value 'scroll-margin)))))) | |
5251 (condition-case () | |
5252 (let ((scroll-in-place nil)) | |
5253 (scroll-up lines)) | |
5254 (end-of-buffer | |
5255 ;; Long lines may cause an end-of-buffer error. | |
5256 (goto-char (point-max)))) | |
5257 (gnus-article-beginning-of-window)) | |
5258 | |
17493 | 5259 (defun gnus-article-prev-page (&optional lines) |
5260 "Show previous page of current article. | |
5261 Argument LINES specifies lines to be scrolled down." | |
5262 (interactive "p") | |
5263 (move-to-window-line 0) | |
5264 (if (and gnus-page-broken | |
5265 (bobp) | |
5266 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer? | |
5267 (progn | |
5268 (gnus-narrow-to-page -1) ;Go to previous page. | |
5269 (goto-char (point-max)) | |
5270 (recenter -1)) | |
88155 | 5271 (prog1 |
5272 (condition-case () | |
5273 (let ((scroll-in-place nil)) | |
5274 (scroll-down lines)) | |
5275 (beginning-of-buffer | |
5276 (goto-char (point-min)))) | |
5277 (gnus-article-beginning-of-window)))) | |
5278 | |
5279 (defun gnus-article-only-boring-p () | |
5280 "Decide whether there is only boring text remaining in the article. | |
5281 Something \"interesting\" is a word of at least two letters that does | |
5282 not have a face in `gnus-article-boring-faces'." | |
5283 (when (and gnus-article-skip-boring | |
5284 (boundp 'gnus-article-boring-faces) | |
5285 (symbol-value 'gnus-article-boring-faces)) | |
5286 (save-excursion | |
5287 (catch 'only-boring | |
5288 (while (re-search-forward "\\b\\w\\w" nil t) | |
5289 (forward-char -1) | |
5290 (when (not (gnus-intersection | |
5291 (gnus-faces-at (point)) | |
5292 (symbol-value 'gnus-article-boring-faces))) | |
5293 (throw 'only-boring nil))) | |
5294 (throw 'only-boring t))))) | |
17493 | 5295 |
5296 (defun gnus-article-refer-article () | |
5297 "Read article specified by message-id around point." | |
5298 (interactive) | |
88155 | 5299 (save-excursion |
5300 (re-search-backward "[ \t]\\|^" (gnus-point-at-bol) t) | |
5301 (re-search-forward "<?news:<?\\|<" (gnus-point-at-eol) t) | |
5302 (if (re-search-forward "[^@ ]+@[^ \t>]+" (gnus-point-at-eol) t) | |
5303 (let ((msg-id (concat "<" (match-string 0) ">"))) | |
17493 | 5304 (set-buffer gnus-summary-buffer) |
88155 | 5305 (gnus-summary-refer-article msg-id)) |
17493 | 5306 (error "No references around point")))) |
5307 | |
5308 (defun gnus-article-show-summary () | |
5309 "Reconfigure windows to show summary buffer." | |
5310 (interactive) | |
5311 (if (not (gnus-buffer-live-p gnus-summary-buffer)) | |
5312 (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
|
5313 (gnus-article-set-globals) |
17493 | 5314 (gnus-configure-windows 'article) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5315 (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
|
5316 (gnus-summary-position-point))) |
17493 | 5317 |
5318 (defun gnus-article-describe-briefly () | |
5319 "Describe article mode commands briefly." | |
5320 (interactive) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5321 (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 | 5322 |
5323 (defun gnus-article-summary-command () | |
5324 "Execute the last keystroke in the summary buffer." | |
5325 (interactive) | |
5326 (let ((obuf (current-buffer)) | |
5327 (owin (current-window-configuration)) | |
5328 func) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5329 (switch-to-buffer gnus-article-current-summary 'norecord) |
17493 | 5330 (setq func (lookup-key (current-local-map) (this-command-keys))) |
5331 (call-interactively func) | |
5332 (set-buffer obuf) | |
5333 (set-window-configuration owin) | |
5334 (set-window-point (get-buffer-window (current-buffer)) (point)))) | |
5335 | |
5336 (defun gnus-article-summary-command-nosave () | |
5337 "Execute the last keystroke in the summary buffer." | |
5338 (interactive) | |
5339 (let (func) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5340 (pop-to-buffer gnus-article-current-summary 'norecord) |
17493 | 5341 (setq func (lookup-key (current-local-map) (this-command-keys))) |
5342 (call-interactively func))) | |
5343 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5344 (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
|
5345 "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
|
5346 (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
|
5347 (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
|
5348 |
17493 | 5349 (defun gnus-article-read-summary-keys (&optional arg key not-restore-window) |
5350 "Read a summary buffer key sequence and execute it from the article buffer." | |
5351 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5352 (gnus-article-check-buffer) |
17493 | 5353 (let ((nosaves |
88155 | 5354 '("q" "Q" "c" "r" "\C-c\C-f" "m" "a" "f" |
5355 "Zc" "ZC" "ZE" "ZQ" "ZZ" "Zn" "ZR" "ZG" "ZN" "ZP" | |
5356 "=" "^" "\M-^" "|")) | |
5357 (nosave-but-article | |
5358 '("A\r")) | |
5359 (nosave-in-article | |
5360 '("\C-d")) | |
5361 (up-to-top | |
5362 '("n" "Gn" "p" "Gp")) | |
5363 keys new-sum-point) | |
17493 | 5364 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5365 (set-buffer gnus-article-current-summary) |
17493 | 5366 (let (gnus-pick-mode) |
88155 | 5367 (push (or key last-command-event) unread-command-events) |
5368 (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
|
5369 (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
|
5370 (read-key-sequence nil))))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
5371 |
17493 | 5372 (message "") |
5373 | |
5374 (if (or (member keys nosaves) | |
88155 | 5375 (member keys nosave-but-article) |
5376 (member keys nosave-in-article)) | |
5377 (let (func) | |
5378 (save-window-excursion | |
5379 (pop-to-buffer gnus-article-current-summary 'norecord) | |
5380 ;; We disable the pick minor mode commands. | |
5381 (let (gnus-pick-mode) | |
5382 (setq func (lookup-key (current-local-map) keys)))) | |
5383 (if (or (not func) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5384 (numberp func)) |
88155 | 5385 (ding) |
5386 (unless (member keys nosave-in-article) | |
5387 (set-buffer gnus-article-current-summary)) | |
5388 (call-interactively func) | |
5389 (setq new-sum-point (point))) | |
5390 (when (member keys nosave-but-article) | |
5391 (pop-to-buffer gnus-article-buffer 'norecord))) | |
17493 | 5392 ;; These commands should restore window configuration. |
5393 (let ((obuf (current-buffer)) | |
88155 | 5394 (owin (current-window-configuration)) |
5395 (opoint (point)) | |
5396 win func in-buffer selected new-sum-start new-sum-hscroll) | |
5397 (cond (not-restore-window | |
5398 (pop-to-buffer gnus-article-current-summary 'norecord)) | |
5399 ((setq win (get-buffer-window gnus-article-current-summary)) | |
5400 (select-window win)) | |
5401 (t | |
5402 (switch-to-buffer gnus-article-current-summary 'norecord))) | |
5403 (setq in-buffer (current-buffer)) | |
5404 ;; We disable the pick minor mode commands. | |
5405 (if (and (setq func (let (gnus-pick-mode) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5406 (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
|
5407 (functionp func)) |
88155 | 5408 (progn |
5409 (call-interactively func) | |
5410 (when (eq win (selected-window)) | |
5411 (setq new-sum-point (point) | |
5412 new-sum-start (window-start win) | |
5413 new-sum-hscroll (window-hscroll win))) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5414 (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
|
5415 (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
|
5416 (set-buffer obuf) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5417 (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
|
5418 (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
|
5419 (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
|
5420 (article-goto-body) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5421 (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
|
5422 1) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5423 (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
|
5424 (point))) |
88155 | 5425 (when (and (not not-restore-window) |
5426 new-sum-point) | |
5427 (set-window-point win new-sum-point) | |
5428 (set-window-start win new-sum-start) | |
5429 (set-window-hscroll win new-sum-hscroll)))) | |
5430 (set-window-configuration owin) | |
5431 (ding)))))) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5432 |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5433 (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
|
5434 "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
|
5435 (interactive "kDescribe key: ") |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5436 (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
|
5437 (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
|
5438 (save-excursion |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5439 (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
|
5440 (let (gnus-pick-mode) |
88155 | 5441 (if (featurep 'xemacs) |
5442 (progn | |
5443 (push (elt key 0) unread-command-events) | |
5444 (setq key (events-to-keys | |
5445 (read-key-sequence "Describe key: ")))) | |
5446 (setq unread-command-events | |
5447 (mapcar | |
5448 (lambda (x) (if (>= x 128) (list 'meta (- x 128)) x)) | |
5449 (string-to-list key))) | |
5450 (setq key (read-key-sequence "Describe key: ")))) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5451 (describe-key key)) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5452 (describe-key key))) |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5453 |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5454 (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
|
5455 "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
|
5456 (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
|
5457 (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
|
5458 (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
|
5459 (save-excursion |
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5460 (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
|
5461 (let (gnus-pick-mode) |
88155 | 5462 (if (featurep 'xemacs) |
5463 (progn | |
5464 (push (elt key 0) unread-command-events) | |
5465 (setq key (events-to-keys | |
5466 (read-key-sequence "Describe key: ")))) | |
5467 (setq unread-command-events | |
5468 (mapcar | |
5469 (lambda (x) (if (>= x 128) (list 'meta (- x 128)) x)) | |
5470 (string-to-list key))) | |
5471 (setq key (read-key-sequence "Describe key: ")))) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
5472 (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
|
5473 (describe-key-briefly key insert))) |
17493 | 5474 |
88155 | 5475 (defun gnus-article-reply-with-original (&optional wide) |
5476 "Start composing a reply mail to the current message. | |
5477 The text in the region will be yanked. If the region isn't active, | |
5478 the entire article will be yanked." | |
5479 (interactive "P") | |
5480 (let ((article (cdr gnus-article-current)) | |
5481 contents) | |
5482 (if (not (gnus-mark-active-p)) | |
5483 (with-current-buffer gnus-summary-buffer | |
5484 (gnus-summary-reply (list (list article)) wide)) | |
5485 (setq contents (buffer-substring (point) (mark t))) | |
5486 ;; Deactivate active regions. | |
5487 (when (and (boundp 'transient-mark-mode) | |
5488 transient-mark-mode) | |
5489 (setq mark-active nil)) | |
5490 (with-current-buffer gnus-summary-buffer | |
5491 (gnus-summary-reply | |
5492 (list (list article contents)) wide))))) | |
5493 | |
5494 (defun gnus-article-followup-with-original () | |
5495 "Compose a followup to the current article. | |
5496 The text in the region will be yanked. If the region isn't active, | |
5497 the entire article will be yanked." | |
5498 (interactive) | |
5499 (let ((article (cdr gnus-article-current)) | |
5500 contents) | |
5501 (if (not (gnus-mark-active-p)) | |
5502 (with-current-buffer gnus-summary-buffer | |
5503 (gnus-summary-followup (list (list article)))) | |
5504 (setq contents (buffer-substring (point) (mark t))) | |
5505 ;; Deactivate active regions. | |
5506 (when (and (boundp 'transient-mark-mode) | |
5507 transient-mark-mode) | |
5508 (setq mark-active nil)) | |
5509 (with-current-buffer gnus-summary-buffer | |
5510 (gnus-summary-followup | |
5511 (list (list article contents))))))) | |
5512 | |
17493 | 5513 (defun gnus-article-hide (&optional arg force) |
5514 "Hide all the gruft in the current article. | |
88155 | 5515 This means that signatures, cited text and (some) headers will be |
5516 hidden. | |
17493 | 5517 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
|
5518 (interactive (append (gnus-article-hidden-arg) (list 'force))) |
17493 | 5519 (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
|
5520 (gnus-article-hide-list-identifiers arg) |
17493 | 5521 (gnus-article-hide-citation-maybe arg force) |
5522 (gnus-article-hide-signature arg)) | |
5523 | |
5524 (defun gnus-article-maybe-highlight () | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5525 "Do some article highlighting if article highlighting is requested." |
17493 | 5526 (when (gnus-visual-p 'article-highlight 'highlight) |
5527 (gnus-article-highlight-some))) | |
5528 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5529 (defun gnus-check-group-server () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5530 ;; 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
|
5531 (unless (gnus-server-opened |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5532 (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
|
5533 (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
|
5534 (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
|
5535 |
88155 | 5536 (eval-when-compile |
5537 (autoload 'nneething-get-file-name "nneething")) | |
5538 | |
17493 | 5539 (defun gnus-request-article-this-buffer (article group) |
5540 "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
|
5541 (let (do-update-line sparse-header) |
17493 | 5542 (prog1 |
5543 (save-excursion | |
5544 (erase-buffer) | |
5545 (gnus-kill-all-overlays) | |
5546 (setq group (or group gnus-newsgroup-name)) | |
5547 | |
5548 ;; Using `gnus-request-article' directly will insert the article into | |
5549 ;; `nntp-server-buffer' - so we'll save some time by not having to | |
5550 ;; copy it from the server buffer into the article buffer. | |
5551 | |
5552 ;; We only request an article by message-id when we do not have the | |
5553 ;; headers for it, so we'll have to get those. | |
5554 (when (stringp article) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5555 (gnus-read-header article)) |
17493 | 5556 |
5557 ;; If the article number is negative, that means that this article | |
5558 ;; doesn't belong in this newsgroup (possibly), so we find its | |
5559 ;; message-id and request it by id instead of number. | |
5560 (when (and (numberp article) | |
5561 gnus-summary-buffer | |
5562 (get-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5563 (gnus-buffer-exists-p gnus-summary-buffer)) |
17493 | 5564 (save-excursion |
5565 (set-buffer gnus-summary-buffer) | |
5566 (let ((header (gnus-summary-article-header article))) | |
5567 (when (< article 0) | |
5568 (cond | |
5569 ((memq article gnus-newsgroup-sparse) | |
5570 ;; This is a sparse gap article. | |
5571 (setq do-update-line article) | |
5572 (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
|
5573 (setq sparse-header (gnus-read-header article)) |
17493 | 5574 (setq gnus-newsgroup-sparse |
5575 (delq article gnus-newsgroup-sparse))) | |
5576 ((vectorp header) | |
5577 ;; It's a real article. | |
5578 (setq article (mail-header-id header))) | |
5579 (t | |
5580 ;; It is an extracted pseudo-article. | |
5581 (setq article 'pseudo) | |
5582 (gnus-request-pseudo-article header)))) | |
5583 | |
5584 (let ((method (gnus-find-method-for-group | |
5585 gnus-newsgroup-name))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5586 (when (and (eq (car method) 'nneething) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5587 (vectorp header)) |
88155 | 5588 (let ((dir (nneething-get-file-name |
5589 (mail-header-id header)))) | |
5590 (when (and (stringp dir) | |
5591 (file-directory-p dir)) | |
17493 | 5592 (setq article 'nneething) |
5593 (gnus-group-enter-directory dir)))))))) | |
5594 | |
5595 (cond | |
5596 ;; Refuse to select canceled articles. | |
5597 ((and (numberp article) | |
5598 gnus-summary-buffer | |
5599 (get-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5600 (gnus-buffer-exists-p gnus-summary-buffer) |
17493 | 5601 (eq (cdr (save-excursion |
5602 (set-buffer gnus-summary-buffer) | |
5603 (assq article gnus-newsgroup-reads))) | |
5604 gnus-canceled-mark)) | |
5605 nil) | |
5606 ;; We first check `gnus-original-article-buffer'. | |
5607 ((and (get-buffer gnus-original-article-buffer) | |
5608 (numberp article) | |
5609 (save-excursion | |
5610 (set-buffer gnus-original-article-buffer) | |
5611 (and (equal (car gnus-original-article) group) | |
5612 (eq (cdr gnus-original-article) article)))) | |
5613 (insert-buffer-substring gnus-original-article-buffer) | |
5614 'article) | |
5615 ;; Check the backlog. | |
5616 ((and gnus-keep-backlog | |
5617 (gnus-backlog-request-article group article (current-buffer))) | |
5618 'article) | |
5619 ;; Check asynchronous pre-fetch. | |
5620 ((gnus-async-request-fetched-article group article (current-buffer)) | |
5621 (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
|
5622 (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
|
5623 (gnus-backlog-enter-article group article (current-buffer))) |
17493 | 5624 'article) |
5625 ;; Check the cache. | |
5626 ((and gnus-use-cache | |
5627 (numberp article) | |
5628 (gnus-cache-request-article article group)) | |
5629 'article) | |
88155 | 5630 ;; Check the agent cache. |
5631 ((gnus-agent-request-article article group) | |
5632 'article) | |
17493 | 5633 ;; 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
|
5634 ((or (stringp article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5635 (numberp article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5636 (let ((gnus-override-method gnus-override-method) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
5637 (methods (and (stringp article) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5638 gnus-refer-article-method)) |
88155 | 5639 (backend (car (gnus-find-method-for-group |
5640 gnus-newsgroup-name))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5641 result |
88155 | 5642 (inhibit-read-only t)) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
5643 (if (or (not (listp methods)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
5644 (and (symbolp (car methods)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
5645 (assq (car methods) nnoo-definition-alist))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
5646 (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
|
5647 (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
|
5648 methods) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5649 (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
|
5650 (while (not result) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5651 (when (eq gnus-override-method 'current) |
39335
65ef5b3fc045
(gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents:
38861
diff
changeset
|
5652 (setq gnus-override-method |
65ef5b3fc045
(gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents:
38861
diff
changeset
|
5653 (with-current-buffer gnus-summary-buffer |
65ef5b3fc045
(gnus-request-article-this-buffer): Refer to
Gerd Moellmann <gerd@gnu.org>
parents:
38861
diff
changeset
|
5654 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
|
5655 (erase-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5656 (gnus-kill-all-overlays) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5657 (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
|
5658 (gnus-check-group-server)) |
88155 | 5659 (cond |
5660 ((gnus-request-article article group (current-buffer)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5661 (when (numberp article) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
5662 (gnus-async-prefetch-next group article |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5663 gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5664 (when gnus-keep-backlog |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5665 (gnus-backlog-enter-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5666 group article (current-buffer)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5667 (setq result 'article)) |
88155 | 5668 (methods |
5669 (setq gnus-override-method (pop methods))) | |
5670 ((not (string-match "^400 " | |
5671 (nnheader-get-report backend))) | |
5672 ;; If we get 400 server disconnect, reconnect and | |
5673 ;; retry; otherwise, assume the article has expired. | |
5674 (setq result 'done)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5675 (and (eq result 'article) 'article))) |
17493 | 5676 ;; It was a pseudo. |
5677 (t article))) | |
5678 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5679 ;; 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
|
5680 (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
|
5681 |
17493 | 5682 ;; Take the article from the original article buffer |
5683 ;; and place it in the buffer it's supposed to be in. | |
5684 (when (and (get-buffer gnus-article-buffer) | |
5685 (equal (buffer-name (current-buffer)) | |
5686 (buffer-name (get-buffer gnus-article-buffer)))) | |
5687 (save-excursion | |
5688 (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
|
5689 (set-buffer gnus-original-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5690 (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
|
5691 (buffer-disable-undo) |
17493 | 5692 (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
|
5693 (setq buffer-read-only t)) |
88155 | 5694 (let ((inhibit-read-only t)) |
17493 | 5695 (erase-buffer) |
5696 (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
|
5697 (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
|
5698 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5699 ;; Decode charsets. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5700 (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
|
5701 ;; 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
|
5702 (setq gnus-article-decoded-p gnus-article-decode-hook)) |
17493 | 5703 |
5704 ;; Update sparse articles. | |
5705 (when (and do-update-line | |
5706 (or (numberp article) | |
5707 (stringp article))) | |
5708 (let ((buf (current-buffer))) | |
5709 (set-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5710 (gnus-summary-update-article do-update-line sparse-header) |
17493 | 5711 (gnus-summary-goto-subject do-update-line nil t) |
88155 | 5712 (set-window-point (gnus-get-buffer-window (current-buffer) t) |
17493 | 5713 (point)) |
5714 (set-buffer buf)))))) | |
5715 | |
5716 ;;; | |
5717 ;;; Article editing | |
5718 ;;; | |
5719 | |
5720 (defcustom gnus-article-edit-mode-hook nil | |
5721 "Hook run in article edit mode buffers." | |
5722 :group 'gnus-article-various | |
5723 :type 'hook) | |
5724 | |
5725 (defvar gnus-article-edit-done-function nil) | |
5726 | |
5727 (defvar gnus-article-edit-mode-map nil) | |
88155 | 5728 (defvar gnus-article-edit-mode nil) |
17493 | 5729 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5730 ;; Should we be using derived.el for this? |
17493 | 5731 (unless gnus-article-edit-mode-map |
88155 | 5732 (setq gnus-article-edit-mode-map (make-keymap)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5733 (set-keymap-parent gnus-article-edit-mode-map text-mode-map) |
17493 | 5734 |
5735 (gnus-define-keys gnus-article-edit-mode-map | |
88155 | 5736 "\C-c?" describe-mode |
17493 | 5737 "\C-c\C-c" gnus-article-edit-done |
88155 | 5738 "\C-c\C-k" gnus-article-edit-exit |
5739 "\C-c\C-f\C-t" message-goto-to | |
5740 "\C-c\C-f\C-o" message-goto-from | |
5741 "\C-c\C-f\C-b" message-goto-bcc | |
5742 ;;"\C-c\C-f\C-w" message-goto-fcc | |
5743 "\C-c\C-f\C-c" message-goto-cc | |
5744 "\C-c\C-f\C-s" message-goto-subject | |
5745 "\C-c\C-f\C-r" message-goto-reply-to | |
5746 "\C-c\C-f\C-n" message-goto-newsgroups | |
5747 "\C-c\C-f\C-d" message-goto-distribution | |
5748 "\C-c\C-f\C-f" message-goto-followup-to | |
5749 "\C-c\C-f\C-m" message-goto-mail-followup-to | |
5750 "\C-c\C-f\C-k" message-goto-keywords | |
5751 "\C-c\C-f\C-u" message-goto-summary | |
5752 "\C-c\C-f\C-i" message-insert-or-toggle-importance | |
5753 "\C-c\C-f\C-a" message-generate-unsubscribed-mail-followup-to | |
5754 "\C-c\C-b" message-goto-body | |
5755 "\C-c\C-i" message-goto-signature | |
5756 | |
5757 "\C-c\C-t" message-insert-to | |
5758 "\C-c\C-n" message-insert-newsgroups | |
5759 "\C-c\C-o" message-sort-headers | |
5760 "\C-c\C-e" message-elide-region | |
5761 "\C-c\C-v" message-delete-not-region | |
5762 "\C-c\C-z" message-kill-to-signature | |
5763 "\M-\r" message-newline-and-reformat | |
5764 "\C-c\C-a" mml-attach-file | |
5765 "\C-a" message-beginning-of-line | |
5766 "\t" message-tab | |
5767 "\M-;" comment-region) | |
17493 | 5768 |
5769 (gnus-define-keys (gnus-article-edit-wash-map | |
5770 "\C-c\C-w" gnus-article-edit-mode-map) | |
5771 "f" gnus-article-edit-full-stops)) | |
5772 | |
88155 | 5773 (easy-menu-define |
5774 gnus-article-edit-mode-field-menu gnus-article-edit-mode-map "" | |
5775 '("Field" | |
5776 ["Fetch To" message-insert-to t] | |
5777 ["Fetch Newsgroups" message-insert-newsgroups t] | |
5778 "----" | |
5779 ["To" message-goto-to t] | |
5780 ["From" message-goto-from t] | |
5781 ["Subject" message-goto-subject t] | |
5782 ["Cc" message-goto-cc t] | |
5783 ["Reply-To" message-goto-reply-to t] | |
5784 ["Summary" message-goto-summary t] | |
5785 ["Keywords" message-goto-keywords t] | |
5786 ["Newsgroups" message-goto-newsgroups t] | |
5787 ["Followup-To" message-goto-followup-to t] | |
5788 ["Mail-Followup-To" message-goto-mail-followup-to t] | |
5789 ["Distribution" message-goto-distribution t] | |
5790 ["Body" message-goto-body t] | |
5791 ["Signature" message-goto-signature t])) | |
5792 | |
5793 (define-derived-mode gnus-article-edit-mode message-mode "Article Edit" | |
17493 | 5794 "Major mode for editing articles. |
5795 This is an extended text-mode. | |
5796 | |
5797 \\{gnus-article-edit-mode-map}" | |
5798 (make-local-variable 'gnus-article-edit-done-function) | |
5799 (make-local-variable 'gnus-prev-winconf) | |
43273
b8391c00e2c9
* gnus-art.el (gnus-article-edit-mode): Use define-derived-mode.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
43166
diff
changeset
|
5800 (set (make-local-variable 'font-lock-defaults) |
b8391c00e2c9
* gnus-art.el (gnus-article-edit-mode): Use define-derived-mode.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
43166
diff
changeset
|
5801 '(message-font-lock-keywords t)) |
88155 | 5802 (set (make-local-variable 'mail-header-separator) "") |
5803 (set (make-local-variable 'gnus-article-edit-mode) t) | |
5804 (easy-menu-add message-mode-field-menu message-mode-map) | |
5805 (mml-mode) | |
17493 | 5806 (setq buffer-read-only nil) |
5807 (buffer-enable-undo) | |
43273
b8391c00e2c9
* gnus-art.el (gnus-article-edit-mode): Use define-derived-mode.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
43166
diff
changeset
|
5808 (widen)) |
17493 | 5809 |
5810 (defun gnus-article-edit (&optional force) | |
5811 "Edit the current article. | |
5812 This will have permanent effect only in mail groups. | |
5813 If FORCE is non-nil, allow editing of articles even in read-only | |
5814 groups." | |
5815 (interactive "P") | |
5816 (when (and (not force) | |
5817 (gnus-group-read-only-p)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
5818 (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
|
5819 (gnus-article-date-original) |
17493 | 5820 (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
|
5821 'ignore |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5822 `(lambda (no-highlight) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5823 'ignore |
17493 | 5824 (gnus-summary-edit-article-done |
5825 ,(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
|
5826 ,(gnus-group-read-only-p) ,gnus-summary-buffer no-highlight)))) |
17493 | 5827 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
5828 (defun gnus-article-edit-article (start-func exit-func) |
17493 | 5829 "Start editing the contents of the current article buffer." |
5830 (let ((winconf (current-window-configuration))) | |
5831 (set-buffer gnus-article-buffer) | |
88155 | 5832 (let ((message-auto-save-directory |
5833 ;; Don't associate the article buffer with a draft file. | |
5834 nil)) | |
5835 (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
|
5836 (funcall start-func) |
88155 | 5837 (set-buffer-modified-p nil) |
17493 | 5838 (gnus-configure-windows 'edit-article) |
5839 (setq gnus-article-edit-done-function exit-func) | |
5840 (setq gnus-prev-winconf winconf) | |
5841 (gnus-message 6 "C-c C-c to end edits"))) | |
5842 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
5843 (defun gnus-article-edit-done (&optional arg) |
17493 | 5844 "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
|
5845 (interactive "P") |
17493 | 5846 (let ((func gnus-article-edit-done-function) |
5847 (buf (current-buffer)) | |
88155 | 5848 (start (window-start)) |
5849 (p (point)) | |
5850 (winconf gnus-prev-winconf)) | |
5851 (widen) ;; Widen it in case that users narrowed the buffer. | |
5852 (funcall func arg) | |
5853 (set-buffer buf) | |
5854 ;; The cache and backlog have to be flushed somewhat. | |
5855 (when gnus-keep-backlog | |
5856 (gnus-backlog-remove-article | |
5857 (car gnus-article-current) (cdr gnus-article-current))) | |
5858 ;; Flush original article as well. | |
17493 | 5859 (save-excursion |
88155 | 5860 (when (get-buffer gnus-original-article-buffer) |
5861 (set-buffer gnus-original-article-buffer) | |
5862 (setq gnus-original-article nil))) | |
5863 (when gnus-use-cache | |
5864 (gnus-cache-update-article | |
5865 (car gnus-article-current) (cdr gnus-article-current))) | |
5866 ;; We remove all text props from the article buffer. | |
5867 (kill-all-local-variables) | |
5868 (gnus-set-text-properties (point-min) (point-max) nil) | |
5869 (gnus-article-mode) | |
5870 (set-window-configuration winconf) | |
17493 | 5871 (set-buffer buf) |
5872 (set-window-start (get-buffer-window buf) start) | |
88155 | 5873 (set-window-point (get-buffer-window buf) (point))) |
5874 (gnus-summary-show-article)) | |
17493 | 5875 |
5876 (defun gnus-article-edit-exit () | |
5877 "Exit the article editing without updating." | |
5878 (interactive) | |
88155 | 5879 (when (or (not (buffer-modified-p)) |
5880 (yes-or-no-p "Article modified; kill anyway? ")) | |
5881 (let ((curbuf (current-buffer)) | |
5882 (p (point)) | |
5883 (window-start (window-start))) | |
5884 (erase-buffer) | |
5885 (if (gnus-buffer-live-p gnus-original-article-buffer) | |
5886 (insert-buffer-substring gnus-original-article-buffer)) | |
5887 (let ((winconf gnus-prev-winconf)) | |
5888 (kill-all-local-variables) | |
5889 (gnus-article-mode) | |
5890 (set-window-configuration winconf) | |
5891 ;; Tippy-toe some to make sure that point remains where it was. | |
5892 (save-current-buffer | |
5893 (set-buffer curbuf) | |
5894 (set-window-start (get-buffer-window (current-buffer)) window-start) | |
5895 (goto-char p)))) | |
5896 (gnus-summary-show-article))) | |
17493 | 5897 |
5898 (defun gnus-article-edit-full-stops () | |
5899 "Interactively repair spacing at end of sentences." | |
5900 (interactive) | |
5901 (save-excursion | |
5902 (goto-char (point-min)) | |
5903 (search-forward-regexp "^$" nil t) | |
5904 (let ((case-fold-search nil)) | |
5905 (query-replace-regexp "\\([.!?][])}]* \\)\\([[({A-Z]\\)" "\\1 \\2")))) | |
5906 | |
5907 ;;; | |
5908 ;;; Article highlights | |
5909 ;;; | |
5910 | |
5911 ;; Written by Per Abrahamsen <abraham@iesd.auc.dk>. | |
5912 | |
5913 ;;; Internal Variables: | |
5914 | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48588
diff
changeset
|
5915 (defcustom gnus-button-url-regexp |
46967
3b7e1c7a2739
* gnus-art.el (gnus-button-url-regexp): Use POSIX regexp if possible.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
45317
diff
changeset
|
5916 (if (string-match "[[:digit:]]" "1") ;; support POSIX? |
88155 | 5917 "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)\\(//[-a-z0-9_.]+:[0-9]*\\)?[-a-z0-9_=!?#$@~%&*+\\/:;.,[:word:]]+[-a-z0-9_=#$@~%&*+\\/[:word:]]\\)" |
5918 "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)\\(//[-a-z0-9_.]+:[0-9]*\\)?\\([-a-z0-9_=!?#$@~%&*+\\/:;.,]\\|\\w\\)+\\([-a-z0-9_=#$@~%&*+\\/]\\|\\w\\)\\)") | |
17493 | 5919 "Regular expression that matches URLs." |
5920 :group 'gnus-article-buttons | |
5921 :type 'regexp) | |
5922 | |
88155 | 5923 (defcustom gnus-button-valid-fqdn-regexp |
5924 message-valid-fqdn-regexp | |
5925 "Regular expression that matches a valid FQDN." | |
5926 :version "22.1" | |
5927 :group 'gnus-article-buttons | |
5928 :type 'regexp) | |
5929 | |
5930 ;; Regexp suggested by Felix Wiemann in <87oeuomcz9.fsf@news2.ososo.de> | |
5931 (defcustom gnus-button-valid-localpart-regexp | |
5932 "[a-z0-9$%(*-=?[_][^<>\")!;:,{}\n\t ]*" | |
5933 "Regular expression that matches a localpart of mail addresses or MIDs." | |
5934 :version "22.1" | |
5935 :group 'gnus-article-buttons | |
5936 :type 'regexp) | |
5937 | |
5938 (defcustom gnus-button-man-handler 'manual-entry | |
5939 "Function to use for displaying man pages. | |
5940 The function must take at least one argument with a string naming the | |
5941 man page." | |
5942 :version "22.1" | |
5943 :type '(choice (function-item :tag "Man" manual-entry) | |
5944 (function-item :tag "Woman" woman) | |
5945 (function :tag "Other")) | |
5946 :group 'gnus-article-buttons) | |
5947 | |
5948 (defcustom gnus-ctan-url "http://tug.ctan.org/tex-archive/" | |
5949 "Top directory of a CTAN \(Comprehensive TeX Archive Network\) archive. | |
5950 If the default site is too slow, try to find a CTAN mirror, see | |
5951 <URL:http://tug.ctan.org/tex-archive/CTAN.sites?action=/index.html>. See also | |
5952 the variable `gnus-button-handle-ctan'." | |
5953 :version "22.1" | |
5954 :group 'gnus-article-buttons | |
5955 :link '(custom-manual "(gnus)Group Parameters") | |
5956 :type '(choice (const "http://www.tex.ac.uk/tex-archive/") | |
5957 (const "http://tug.ctan.org/tex-archive/") | |
5958 (const "http://www.dante.de/CTAN/") | |
5959 (string :tag "Other"))) | |
5960 | |
5961 (defcustom gnus-button-ctan-handler 'browse-url | |
5962 "Function to use for displaying CTAN links. | |
5963 The function must take one argument, the string naming the URL." | |
5964 :version "22.1" | |
5965 :type '(choice (function-item :tag "Browse Url" browse-url) | |
5966 (function :tag "Other")) | |
5967 :group 'gnus-article-buttons) | |
5968 | |
5969 (defcustom gnus-button-handle-ctan-bogus-regexp "^/?tex-archive/\\|^/" | |
5970 "Bogus strings removed from CTAN URLs." | |
5971 :version "22.1" | |
5972 :group 'gnus-article-buttons | |
5973 :type '(choice (const "^/?tex-archive/\\|/") | |
5974 (regexp :tag "Other"))) | |
5975 | |
5976 (defcustom gnus-button-ctan-directory-regexp | |
5977 (regexp-opt | |
5978 (list "archive-tools" "biblio" "bibliography" "digests" "documentation" | |
5979 "dviware" "fonts" "graphics" "help" "indexing" "info" "language" | |
5980 "languages" "macros" "nonfree" "obsolete" "support" "systems" | |
5981 "tds" "tools" "usergrps" "web") t) | |
5982 "Regular expression for ctan directories. | |
5983 It should match all directories in the top level of `gnus-ctan-url'." | |
5984 :version "22.1" | |
5985 :group 'gnus-article-buttons | |
5986 :type 'regexp) | |
5987 | |
5988 (defcustom gnus-button-mid-or-mail-regexp | |
5989 (concat "\\b\\(<?" gnus-button-valid-localpart-regexp "@" | |
5990 gnus-button-valid-fqdn-regexp | |
5991 ">?\\)\\b") | |
5992 "Regular expression that matches a message ID or a mail address." | |
5993 :version "22.1" | |
5994 :group 'gnus-article-buttons | |
5995 :type 'regexp) | |
5996 | |
5997 (defcustom gnus-button-prefer-mid-or-mail 'gnus-button-mid-or-mail-heuristic | |
5998 "What to do when the button on a string as \"foo123@bar.invalid\" is pushed. | |
5999 Strings like this can be either a message ID or a mail address. If it is one | |
6000 of the symbols `mid' or `mail', Gnus will always assume that the string is a | |
6001 message ID or a mail address, respectively. If this variable is set to the | |
6002 symbol `ask', always query the user what do do. If it is a function, this | |
6003 function will be called with the string as it's only argument. The function | |
6004 must return `mid', `mail', `invalid' or `ask'." | |
6005 :version "22.1" | |
6006 :group 'gnus-article-buttons | |
6007 :type '(choice (function-item :tag "Heuristic function" | |
6008 gnus-button-mid-or-mail-heuristic) | |
6009 (const ask) | |
6010 (const mid) | |
6011 (const mail))) | |
6012 | |
6013 (defcustom gnus-button-mid-or-mail-heuristic-alist | |
6014 '((-10.0 . ".+\\$.+@") | |
6015 (-10.0 . "#") | |
6016 (-10.0 . "\\*") | |
6017 (-5.0 . "\\+[^+]*\\+.*@") ;; # two plus signs | |
6018 (-5.0 . "@[Nn][Ee][Ww][Ss]") ;; /\@news/i | |
6019 (-5.0 . "@.*[Dd][Ii][Aa][Ll][Uu][Pp]") ;; /\@.*dialup/i; | |
6020 (-1.0 . "^[^a-z]+@") | |
6021 ;; | |
6022 (-5.0 . "\\.[0-9][0-9]+.*@") ;; "\.[0-9]{2,}.*\@" | |
6023 (-5.0 . "[a-z].*[A-Z].*[a-z].*[A-Z].*@") ;; "([a-z].*[A-Z].*){2,}\@" | |
6024 (-3.0 . "[A-Z][A-Z][a-z][a-z].*@") | |
6025 (-5.0 . "\\...?.?@") ;; (-5.0 . "\..{1,3}\@") | |
6026 ;; | |
6027 (-2.0 . "^[0-9]") | |
6028 (-1.0 . "^[0-9][0-9]") | |
6029 ;; | |
6030 ;; -3.0 /^[0-9][0-9a-fA-F]{2,2}/; | |
6031 (-3.0 . "^[0-9][0-9a-fA-F][0-9a-fA-F][^0-9a-fA-F]") | |
6032 ;; -5.0 /^[0-9][0-9a-fA-F]{3,3}/; | |
6033 (-5.0 . "^[0-9][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][^0-9a-fA-F]") | |
6034 ;; | |
6035 (-3.0 . "[0-9][0-9][0-9][0-9][0-9][^0-9].*@") ;; "[0-9]{5,}.*\@" | |
6036 (-3.0 . "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][^0-9].*@") | |
6037 ;; "[0-9]{8,}.*\@" | |
6038 (-3.0 | |
6039 . "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].*@") | |
6040 ;; "[0-9]{12,}.*\@" | |
6041 ;; compensation for TDMA dated mail addresses: | |
6042 (25.0 . "-dated-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]+.*@") | |
6043 ;; | |
6044 (-20.0 . "\\.fsf@") ;; Gnus | |
6045 (-20.0 . "^slrn") | |
6046 (-20.0 . "^Pine") | |
6047 (-20.0 . "_-_") ;; Subject change in thread | |
6048 ;; | |
6049 (-20.0 . "\\.ln@") ;; leafnode | |
6050 (-30.0 . "@ID-[0-9]+\\.[a-zA-Z]+\\.dfncis\\.de") | |
6051 (-30.0 . "@4[Aa][Xx]\\.com") ;; Forte Agent | |
6052 ;; | |
6053 ;; (5.0 . "") ;; $local_part_len <= 7 | |
6054 (10.0 . "^[^0-9]+@") | |
6055 (3.0 . "^[^0-9]+[0-9][0-9]?[0-9]?@") | |
6056 ;; ^[^0-9]+[0-9]{1,3}\@ digits only at end of local part | |
6057 (3.0 . "\@stud") | |
6058 ;; | |
6059 (2.0 . "[a-z][a-z][._-][A-Z][a-z].*@") | |
6060 ;; | |
6061 (0.5 . "^[A-Z][a-z]") | |
6062 (0.5 . "^[A-Z][a-z][a-z]") | |
6063 (1.5 . "^[A-Z][a-z][A-Z][a-z][^a-z]") ;; ^[A-Z][a-z]{3,3} | |
6064 (2.0 . "^[A-Z][a-z][A-Z][a-z][a-z][^a-z]")) ;; ^[A-Z][a-z]{4,4} | |
6065 "An alist of \(RATE . REGEXP\) pairs for `gnus-button-mid-or-mail-heuristic'. | |
6066 | |
6067 A negative RATE indicates a message IDs, whereas a positive indicates a mail | |
6068 address. The REGEXP is processed with `case-fold-search' set to nil." | |
6069 :version "22.1" | |
6070 :group 'gnus-article-buttons | |
6071 :type '(repeat (cons (number :tag "Rate") | |
6072 (regexp :tag "Regexp")))) | |
6073 | |
6074 (defun gnus-button-mid-or-mail-heuristic (mid-or-mail) | |
6075 "Guess whether MID-OR-MAIL is a message ID or a mail address. | |
6076 Returns `mid' if MID-OR-MAIL is a message IDs, `mail' if it's a mail | |
6077 address, `ask' if unsure and `invalid' if the string is invalid." | |
6078 (let ((case-fold-search nil) | |
6079 (list gnus-button-mid-or-mail-heuristic-alist) | |
6080 (result 0) rate regexp lpartlen elem) | |
6081 (setq lpartlen | |
6082 (length (gnus-replace-in-string mid-or-mail "^\\(.*\\)@.*$" "\\1"))) | |
6083 (gnus-message 8 "`%s', length of local part=`%s'." mid-or-mail lpartlen) | |
6084 ;; Certain special cases... | |
6085 (when (string-match | |
6086 (concat | |
6087 "^0[0-9]+-[0-9][0-9][0-9][0-9]@t-online\\.de$\\|" | |
6088 "^[0-9]+\\.[0-9]+@compuserve\\|" | |
6089 "@public\\.gmane\\.org") | |
6090 mid-or-mail) | |
6091 (gnus-message 8 "`%s' is a known mail address." mid-or-mail) | |
6092 (setq result 'mail)) | |
6093 (when (string-match "@.*@\\| " mid-or-mail) | |
6094 (gnus-message 8 "`%s' is invalid." mid-or-mail) | |
6095 (setq result 'invalid)) | |
6096 ;; Nothing more to do, if result is not a number here... | |
6097 (when (numberp result) | |
6098 (while list | |
6099 (setq elem (car list) | |
6100 rate (car elem) | |
6101 regexp (cdr elem) | |
6102 list (cdr list)) | |
6103 (when (string-match regexp mid-or-mail) | |
6104 (setq result (+ result rate)) | |
6105 (gnus-message | |
6106 9 "`%s' matched `%s', rate `%s', result `%s'." | |
6107 mid-or-mail regexp rate result))) | |
6108 (when (<= lpartlen 7) | |
6109 (setq result (+ result 5.0)) | |
6110 (gnus-message 9 "`%s' matched (<= lpartlen 7), result `%s'." | |
6111 mid-or-mail result)) | |
6112 (when (>= lpartlen 12) | |
6113 (gnus-message 9 "`%s' matched (>= lpartlen 12)" mid-or-mail) | |
6114 (cond | |
6115 ((string-match "[0-9][^0-9]+[0-9].*@" mid-or-mail) | |
6116 ;; Long local part should contain realname if e-mail address, | |
6117 ;; too many digits: message-id. | |
6118 ;; $score -= 5.0 + 0.1 * $local_part_len; | |
6119 (setq rate (* -1.0 (+ 5.0 (* 0.1 lpartlen)))) | |
6120 (setq result (+ result rate)) | |
6121 (gnus-message | |
6122 9 "Many digits in `%s', rate `%s', result `%s'." | |
6123 mid-or-mail rate result)) | |
6124 ((string-match "[^aeiouy][^aeiouy][^aeiouy][^aeiouy]+.*\@" | |
6125 mid-or-mail) | |
6126 ;; Too few vowels [^aeiouy]{4,}.*\@ | |
6127 (setq result (+ result -5.0)) | |
6128 (gnus-message | |
6129 9 "Few vowels in `%s', rate `%s', result `%s'." | |
6130 mid-or-mail -5.0 result)) | |
6131 (t | |
6132 (setq result (+ result 5.0)) | |
6133 (gnus-message | |
6134 9 "`%s', rate `%s', result `%s'." mid-or-mail 5.0 result))))) | |
6135 (gnus-message 8 "`%s': Final rate is `%s'." mid-or-mail result) | |
6136 ;; Maybe we should make this a customizable alist: (condition . 'result) | |
6137 (cond | |
6138 ((symbolp result) result) | |
6139 ;; Now convert number into proper results: | |
6140 ((< result -10.0) 'mid) | |
6141 ((> result 10.0) 'mail) | |
6142 (t 'ask)))) | |
6143 | |
6144 (defun gnus-button-handle-mid-or-mail (mid-or-mail) | |
6145 (let* ((pref gnus-button-prefer-mid-or-mail) guessed | |
6146 (url-mid (concat "news" ":" mid-or-mail)) | |
6147 (url-mailto (concat "mailto" ":" mid-or-mail))) | |
6148 (gnus-message 9 "mid-or-mail=%s" mid-or-mail) | |
6149 (when (fboundp pref) | |
6150 (setq guessed | |
6151 ;; get rid of surrounding angles... | |
6152 (funcall pref | |
6153 (gnus-replace-in-string mid-or-mail "^<\\|>$" ""))) | |
6154 (if (or (eq 'mid guessed) (eq 'mail guessed)) | |
6155 (setq pref guessed) | |
6156 (setq pref 'ask))) | |
6157 (if (eq pref 'ask) | |
6158 (save-window-excursion | |
6159 (if (y-or-n-p (concat "Is <" mid-or-mail "> a mail address? ")) | |
6160 (setq pref 'mail) | |
6161 (setq pref 'mid)))) | |
6162 (cond ((eq pref 'mid) | |
6163 (gnus-message 8 "calling `gnus-button-handle-news' %s" url-mid) | |
6164 (gnus-button-handle-news url-mid)) | |
6165 ((eq pref 'mail) | |
6166 (gnus-message 8 "calling `gnus-url-mailto' %s" url-mailto) | |
6167 (gnus-url-mailto url-mailto)) | |
6168 (t (gnus-message 3 "Invalid string."))))) | |
6169 | |
6170 (defun gnus-button-handle-custom (url) | |
6171 "Follow a Custom URL." | |
6172 (customize-apropos (gnus-url-unhex-string url))) | |
6173 | |
6174 (defvar gnus-button-handle-describe-prefix "^\\(C-h\\|<?[Ff]1>?\\)") | |
6175 | |
6176 ;; FIXME: Maybe we should merge some of the functions that do quite similar | |
6177 ;; stuff? | |
6178 | |
6179 (defun gnus-button-handle-describe-function (url) | |
6180 "Call `describe-function' when pushing the corresponding URL button." | |
6181 (describe-function | |
6182 (intern | |
6183 (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))) | |
6184 | |
6185 (defun gnus-button-handle-describe-variable (url) | |
6186 "Call `describe-variable' when pushing the corresponding URL button." | |
6187 (describe-variable | |
6188 (intern | |
6189 (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))) | |
6190 | |
6191 (defun gnus-button-handle-symbol (url) | |
6192 "Display help on variable or function. | |
6193 Calls `describe-variable' or `describe-function'." | |
6194 (let ((sym (intern url))) | |
6195 (cond | |
6196 ((fboundp sym) (describe-function sym)) | |
6197 ((boundp sym) (describe-variable sym)) | |
6198 (t (gnus-message 3 "`%s' is not a known function of variable." url))))) | |
6199 | |
6200 (defun gnus-button-handle-describe-key (url) | |
6201 "Call `describe-key' when pushing the corresponding URL button." | |
6202 (let* ((key-string | |
6203 (gnus-replace-in-string url gnus-button-handle-describe-prefix "")) | |
6204 (keys (ignore-errors (eval `(kbd ,key-string))))) | |
6205 (if keys | |
6206 (describe-key keys) | |
6207 (gnus-message 3 "Invalid key sequence in button: %s" key-string)))) | |
6208 | |
6209 (defun gnus-button-handle-apropos (url) | |
6210 "Call `apropos' when pushing the corresponding URL button." | |
6211 (apropos (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) | |
6212 | |
6213 (defun gnus-button-handle-apropos-command (url) | |
6214 "Call `apropos' when pushing the corresponding URL button." | |
6215 (apropos-command | |
6216 (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) | |
6217 | |
6218 (defun gnus-button-handle-apropos-variable (url) | |
6219 "Call `apropos' when pushing the corresponding URL button." | |
6220 (funcall | |
6221 (if (fboundp 'apropos-variable) 'apropos-variable 'apropos) | |
6222 (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) | |
6223 | |
6224 (defun gnus-button-handle-apropos-documentation (url) | |
6225 "Call `apropos' when pushing the corresponding URL button." | |
6226 (funcall | |
6227 (if (fboundp 'apropos-documentation) 'apropos-documentation 'apropos) | |
6228 (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) | |
6229 | |
6230 (defun gnus-button-handle-library (url) | |
6231 "Call `locate-library' when pushing the corresponding URL button." | |
6232 (gnus-message 9 "url=`%s'" url) | |
6233 (let* ((lib (locate-library url)) | |
6234 (file (gnus-replace-in-string (or lib "") "\.elc" ".el"))) | |
6235 (if (not lib) | |
6236 (gnus-message 1 "Cannot locale library `%s'." url) | |
6237 (find-file-read-only file)))) | |
6238 | |
6239 (defun gnus-button-handle-ctan (url) | |
6240 "Call `browse-url' when pushing a CTAN URL button." | |
6241 (funcall | |
6242 gnus-button-ctan-handler | |
6243 (concat | |
6244 gnus-ctan-url | |
6245 (gnus-replace-in-string url gnus-button-handle-ctan-bogus-regexp "")))) | |
6246 | |
6247 (defcustom gnus-button-tex-level 5 | |
6248 "*Integer that says how many TeX-related buttons Gnus will show. | |
6249 The higher the number, the more buttons will appear and the more false | |
6250 positives are possible. Note that you can set this variable local to | |
6251 specific groups. Setting it higher in TeX groups is probably a good idea. | |
6252 See Info node `(gnus)Group Parameters' and the variable `gnus-parameters' on | |
6253 how to set variables in specific groups." | |
6254 :version "22.1" | |
6255 :group 'gnus-article-buttons | |
6256 :link '(custom-manual "(gnus)Group Parameters") | |
6257 :type 'integer) | |
6258 | |
6259 (defcustom gnus-button-man-level 5 | |
6260 "*Integer that says how many man-related buttons Gnus will show. | |
6261 The higher the number, the more buttons will appear and the more false | |
6262 positives are possible. Note that you can set this variable local to | |
6263 specific groups. Setting it higher in Unix groups is probably a good idea. | |
6264 See Info node `(gnus)Group Parameters' and the variable `gnus-parameters' on | |
6265 how to set variables in specific groups." | |
6266 :version "22.1" | |
6267 :group 'gnus-article-buttons | |
6268 :link '(custom-manual "(gnus)Group Parameters") | |
6269 :type 'integer) | |
6270 | |
6271 (defcustom gnus-button-emacs-level 5 | |
6272 "*Integer that says how many emacs-related buttons Gnus will show. | |
6273 The higher the number, the more buttons will appear and the more false | |
6274 positives are possible. Note that you can set this variable local to | |
6275 specific groups. Setting it higher in Emacs or Gnus related groups is | |
6276 probably a good idea. See Info node `(gnus)Group Parameters' and the variable | |
6277 `gnus-parameters' on how to set variables in specific groups." | |
6278 :version "22.1" | |
6279 :group 'gnus-article-buttons | |
6280 :link '(custom-manual "(gnus)Group Parameters") | |
6281 :type 'integer) | |
6282 | |
6283 (defcustom gnus-button-message-level 5 | |
6284 "*Integer that says how many buttons for news or mail messages will appear. | |
6285 The higher the number, the more buttons will appear and the more false | |
6286 positives are possible." | |
6287 ;; mail addresses, MIDs, URLs for news, ... | |
6288 :version "22.1" | |
6289 :group 'gnus-article-buttons | |
6290 :type 'integer) | |
6291 | |
6292 (defcustom gnus-button-browse-level 5 | |
6293 "*Integer that says how many buttons for browsing will appear. | |
6294 The higher the number, the more buttons will appear and the more false | |
6295 positives are possible." | |
6296 ;; stuff handled by `browse-url' or `gnus-button-embedded-url' | |
6297 :version "22.1" | |
6298 :group 'gnus-article-buttons | |
6299 :type 'integer) | |
6300 | |
17493 | 6301 (defcustom gnus-button-alist |
88155 | 6302 '(("<\\(url:[>\n\t ]*?\\)?\\(nntp\\|news\\):[>\n\t ]*\\([^>\n\t ]*@[^>\n\t ]*\\)>" |
6303 0 (>= gnus-button-message-level 0) gnus-button-handle-news 3) | |
6304 ((concat "\\b\\(nntp\\|news\\):\\(" | |
6305 gnus-button-valid-localpart-regexp "@[a-z0-9.-]+[a-z]\\)") | |
6306 0 t gnus-button-handle-news 2) | |
6307 ("\\(\\b<\\(url:[>\n\t ]*\\)?\\(nntp\\|news\\):[>\n\t ]*\\(//\\)?\\([^>\n\t ]*\\)>\\)" | |
6308 1 (>= gnus-button-message-level 0) gnus-button-fetch-group 5) | |
6309 ("\\b\\(nntp\\|news\\):\\(//\\)?\\([^'\">\n\t ]+\\)" | |
6310 0 (>= gnus-button-message-level 0) gnus-button-fetch-group 3) | |
6311 ;; RFC 2392 (Don't allow `/' in domain part --> CID) | |
6312 ("\\bmid:\\(//\\)?\\([^'\">\n\t ]+@[^'\">\n\t /]+\\)" | |
6313 0 (>= gnus-button-message-level 0) gnus-button-message-id 2) | |
6314 ("\\bin\\( +article\\| +message\\)? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)" | |
6315 2 (>= gnus-button-message-level 0) gnus-button-message-id 3) | |
6316 ("\\(<URL: *\\)mailto: *\\([^> \n\t]+\\)>" | |
6317 0 (>= gnus-button-message-level 0) gnus-url-mailto 2) | |
6318 ;; RFC 2368 (The mailto URL scheme) | |
6319 ("\\bmailto:\\([-a-z.@_+0-9%=?&/]+\\)" | |
6320 0 (>= gnus-button-message-level 0) gnus-url-mailto 1) | |
6321 ("\\bmailto:\\([^ \n\t]+\\)" | |
6322 0 (>= gnus-button-message-level 0) gnus-url-mailto 1) | |
6323 ;; CTAN | |
6324 ((concat "\\bCTAN:[ \t\n]?[^>)!;:,'\n\t ]*\\(" | |
6325 gnus-button-ctan-directory-regexp | |
6326 "[^][>)!;:,'\n\t ]+\\)") | |
6327 0 (>= gnus-button-tex-level 1) gnus-button-handle-ctan 1) | |
6328 ((concat "\\btex-archive/\\(" | |
6329 gnus-button-ctan-directory-regexp | |
6330 "/[-_.a-z0-9/]+[-_./a-z0-9]+[/a-z0-9]\\)") | |
6331 1 (>= gnus-button-tex-level 6) gnus-button-handle-ctan 1) | |
6332 ((concat | |
6333 "\\b\\(" | |
6334 gnus-button-ctan-directory-regexp | |
6335 "/[-_.a-z0-9]+/[-_./a-z0-9]+[/a-z0-9]\\)") | |
6336 1 (>= gnus-button-tex-level 8) gnus-button-handle-ctan 1) | |
6337 ;; This is info (home-grown style) <info://foo/bar+baz> | |
6338 ("\\binfo://\\([^'\">\n\t ]+\\)" | |
6339 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 1) | |
6340 ;; Info GNOME style <info:foo#bar_baz> | |
6341 ("\\binfo:\\([^('\n\t\r \"><][^'\n\t\r \"><]*\\)" | |
6342 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url-gnome 1) | |
6343 ;; Info KDE style <info:(foo)bar baz> | |
6344 ("<\\(info:\\(([^)]+)[^>\n\r]*\\)\\)>" | |
6345 1 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url-kde 2) | |
6346 ("\\((Info-goto-node\\|(info\\)[ \t\n]*\\(\"[^\"]*\"\\))" 0 | |
6347 (>= gnus-button-emacs-level 1) gnus-button-handle-info-url 2) | |
6348 ("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+i[ \t\n]+d?[ \t\n]?m[ \t\n]+\\([^ ]+ ?[^ ]+\\)[ \t\n]+RET" | |
6349 ;; Info links like `C-h i d m CC Mode RET' | |
6350 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-keystrokes 2) | |
6351 ;; This is custom | |
6352 ("\\bcustom:\\(//\\)?\\([^'\">\n\t ]+\\)" | |
6353 0 (>= gnus-button-emacs-level 5) gnus-button-handle-custom 2) | |
6354 ("M-x[ \t\n]customize-[^ ]+[ \t\n]RET[ \t\n]\\([^ ]+\\)[ \t\n]RET" 0 | |
6355 (>= gnus-button-emacs-level 1) gnus-button-handle-custom 1) | |
6356 ;; Emacs help commands | |
6357 ("M-x[ \t\n]+apropos[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET" | |
6358 ;; regexp doesn't match arguments containing ` '. | |
6359 0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos 1) | |
6360 ("M-x[ \t\n]+apropos-command[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET" | |
6361 0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos-command 1) | |
6362 ("M-x[ \t\n]+apropos-variable[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET" | |
6363 0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos-variable 1) | |
6364 ("M-x[ \t\n]+apropos-documentation[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET" | |
6365 0 (>= gnus-button-emacs-level 1) gnus-button-handle-apropos-documentation 1) | |
6366 ;; The following entries may lead to many false positives so don't enable | |
6367 ;; them by default (use a high button level). | |
6368 ("/\\([a-z][-a-z0-9]+\\.el\\)\\>[^.?]" | |
6369 ;; Exclude [.?] for URLs in gmane.emacs.cvs | |
6370 1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1) | |
6371 ("`\\([a-z][-a-z0-9]+\\.el\\)'" | |
6372 1 (>= gnus-button-emacs-level 8) gnus-button-handle-library 1) | |
6373 ("`\\([a-z][a-z0-9]+-[a-z]+-[-a-z]+\\|\\(gnus\\|message\\)-[-a-z]+\\)'" | |
6374 0 (>= gnus-button-emacs-level 8) gnus-button-handle-symbol 1) | |
6375 ("`\\([a-z][a-z0-9]+-[a-z]+\\)'" | |
6376 0 (>= gnus-button-emacs-level 9) gnus-button-handle-symbol 1) | |
6377 ("(setq[ \t\n]+\\([a-z][a-z0-9]+-[-a-z0-9]+\\)[ \t\n]+.+)" | |
6378 1 (>= gnus-button-emacs-level 7) gnus-button-handle-describe-variable 1) | |
6379 ("\\bM-x[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET" | |
6380 1 (>= gnus-button-emacs-level 7) gnus-button-handle-describe-function 1) | |
6381 ("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+f[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET" | |
6382 0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-function 2) | |
6383 ("\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+v[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET" | |
6384 0 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-variable 2) | |
6385 ("`\\(\\b\\(C-h\\|<?[Ff]1>?\\)[ \t\n]+k[ \t\n]+\\([^']+\\)\\)'" | |
6386 ;; Unlike the other regexps we really have to require quoting | |
6387 ;; here to determine where it ends. | |
6388 1 (>= gnus-button-emacs-level 1) gnus-button-handle-describe-key 3) | |
6389 ;; This is how URLs _should_ be embedded in text (RFC 1738, RFC 2396)... | |
6390 ("<URL: *\\([^<>]*\\)>" | |
6391 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1) | |
6392 ;; RFC 2396 (2.4.3., delims) ... | |
6393 ("\"URL: *\\([^\"]*\\)\"" | |
6394 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1) | |
6395 ;; RFC 2396 (2.4.3., delims) ... | |
6396 ("\"URL: *\\([^\"]*\\)\"" | |
6397 1 (>= gnus-button-browse-level 0) gnus-button-embedded-url 1) | |
17493 | 6398 ;; Raw URLs. |
88155 | 6399 (gnus-button-url-regexp |
6400 0 (>= gnus-button-browse-level 0) browse-url 0) | |
6401 ;; man pages | |
6402 ("\\b\\([a-z][a-z]+([1-9])\\)\\W" | |
6403 0 (and (>= gnus-button-man-level 1) (< gnus-button-man-level 3)) | |
6404 gnus-button-handle-man 1) | |
6405 ;; more man pages: resolv.conf(5), iso_8859-1(7), xterm(1x) | |
6406 ("\\b\\([a-z][-_.a-z0-9]+([1-9])\\)\\W" | |
6407 0 (and (>= gnus-button-man-level 3) (< gnus-button-man-level 5)) | |
6408 gnus-button-handle-man 1) | |
6409 ;; even more: Apache::PerlRun(3pm), PDL::IO::FastRaw(3pm), | |
6410 ;; SoWWWAnchor(3iv), XSelectInput(3X11), X(1), X(7) | |
6411 ("\\b\\(\\(?:[a-z][-+_.:a-z0-9]+([1-9][X1a-z]*)\\)\\|\\b\\(?:X([1-9])\\)\\)\\W" | |
6412 0 (>= gnus-button-man-level 5) gnus-button-handle-man 1) | |
6413 ;; MID or mail: To avoid too many false positives we don't try to catch | |
6414 ;; all kind of allowed MIDs or mail addresses. Domain part must contain | |
6415 ;; at least one dot. TLD must contain two or three chars or be a know TLD | |
6416 ;; (info|name|...). Put this entry near the _end_ of `gnus-button-alist' | |
6417 ;; so that non-ambiguous entries (see above) match first. | |
6418 (gnus-button-mid-or-mail-regexp | |
6419 0 (>= gnus-button-message-level 5) gnus-button-handle-mid-or-mail 1)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
6420 "*Alist of regexps matching buttons in article bodies. |
17493 | 6421 |
6422 Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where | |
88155 | 6423 REGEXP: is the string (case insensitive) matching text around the button (can |
6424 also be Lisp expression evaluating to a string), | |
17493 | 6425 BUTTON: is the number of the regexp grouping actually matching the button, |
88155 | 6426 FORM: is a Lisp expression which must eval to true for the button to |
17493 | 6427 be added, |
6428 CALLBACK: is the function to call when the user push this button, and each | |
6429 PAR: is a number of a regexp grouping whose text will be passed to CALLBACK. | |
6430 | |
6431 CALLBACK can also be a variable, in that case the value of that | |
6432 variable it the real callback function." | |
6433 :group 'gnus-article-buttons | |
88155 | 6434 :type '(repeat (list (choice regexp variable sexp) |
17493 | 6435 (integer :tag "Button") |
6436 (sexp :tag "Form") | |
6437 (function :tag "Callback") | |
6438 (repeat :tag "Par" | |
6439 :inline t | |
6440 (integer :tag "Regexp group"))))) | |
6441 | |
6442 (defcustom gnus-header-button-alist | |
88155 | 6443 '(("^\\(References\\|Message-I[Dd]\\|^In-Reply-To\\):" "<[^<>]+>" |
6444 0 (>= gnus-button-message-level 0) gnus-button-message-id 0) | |
6445 ("^\\(From\\|Reply-To\\):" ": *\\(.+\\)$" | |
6446 1 (>= gnus-button-message-level 0) gnus-button-reply 1) | |
17493 | 6447 ("^\\(Cc\\|To\\):" "[^ \t\n<>,()\"]+@[^ \t\n<>,()\"]+" |
88155 | 6448 0 (>= gnus-button-message-level 0) gnus-msg-mail 0) |
6449 ("^X-[Uu][Rr][Ll]:" gnus-button-url-regexp | |
6450 0 (>= gnus-button-browse-level 0) browse-url 0) | |
6451 ("^Subject:" gnus-button-url-regexp | |
6452 0 (>= gnus-button-browse-level 0) browse-url 0) | |
6453 ("^[^:]+:" gnus-button-url-regexp | |
6454 0 (>= gnus-button-browse-level 0) browse-url 0) | |
6455 ("^[^:]+:" "\\bmailto:\\([-a-z.@_+0-9%=?&/]+\\)" | |
6456 0 (>= gnus-button-message-level 0) gnus-url-mailto 1) | |
6457 ("^[^:]+:" "\\(<\\(url: \\)?\\(nntp\\|news\\):\\([^>\n ]*\\)>\\)" | |
6458 1 (>= gnus-button-message-level 0) gnus-button-message-id 4)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
6459 "*Alist of headers and regexps to match buttons in article heads. |
17493 | 6460 |
6461 This alist is very similar to `gnus-button-alist', except that each | |
6462 alist has an additional HEADER element first in each entry: | |
6463 | |
6464 \(HEADER REGEXP BUTTON FORM CALLBACK PAR) | |
6465 | |
6466 HEADER is a regexp to match a header. For a fuller explanation, see | |
6467 `gnus-button-alist'." | |
6468 :group 'gnus-article-buttons | |
6469 :group 'gnus-article-headers | |
6470 :type '(repeat (list (regexp :tag "Header") | |
88155 | 6471 (choice regexp variable) |
17493 | 6472 (integer :tag "Button") |
6473 (sexp :tag "Form") | |
6474 (function :tag "Callback") | |
6475 (repeat :tag "Par" | |
6476 :inline t | |
6477 (integer :tag "Regexp group"))))) | |
6478 | |
6479 (defvar gnus-button-regexp nil) | |
6480 (defvar gnus-button-marker-list nil) | |
6481 ;; Regexp matching any of the regexps from `gnus-button-alist'. | |
6482 | |
6483 (defvar gnus-button-last nil) | |
6484 ;; The value of `gnus-button-alist' when `gnus-button-regexp' was build. | |
6485 | |
6486 ;;; Commands: | |
6487 | |
6488 (defun gnus-article-push-button (event) | |
6489 "Check text under the mouse pointer for a callback function. | |
6490 If the text under the mouse pointer has a `gnus-callback' property, | |
6491 call it with the value of the `gnus-data' text property." | |
6492 (interactive "e") | |
6493 (set-buffer (window-buffer (posn-window (event-start event)))) | |
6494 (let* ((pos (posn-point (event-start event))) | |
88155 | 6495 (data (get-text-property pos 'gnus-data)) |
17493 | 6496 (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
|
6497 (goto-char pos) |
17493 | 6498 (when fun |
6499 (funcall fun data)))) | |
6500 | |
6501 (defun gnus-article-press-button () | |
6502 "Check text at point for a callback function. | |
6503 If the text at point has a `gnus-callback' property, | |
6504 call it with the value of the `gnus-data' text property." | |
6505 (interactive) | |
88155 | 6506 (let ((data (get-text-property (point) 'gnus-data)) |
6507 (fun (get-text-property (point) 'gnus-callback))) | |
17493 | 6508 (when fun |
6509 (funcall fun data)))) | |
6510 | |
6511 (defun gnus-article-highlight (&optional force) | |
6512 "Highlight current article. | |
6513 This function calls `gnus-article-highlight-headers', | |
6514 `gnus-article-highlight-citation', | |
6515 `gnus-article-highlight-signature', and `gnus-article-add-buttons' to | |
6516 do the highlighting. See the documentation for those functions." | |
6517 (interactive (list 'force)) | |
6518 (gnus-article-highlight-headers) | |
6519 (gnus-article-highlight-citation force) | |
6520 (gnus-article-highlight-signature) | |
6521 (gnus-article-add-buttons force) | |
6522 (gnus-article-add-buttons-to-head)) | |
6523 | |
6524 (defun gnus-article-highlight-some (&optional force) | |
6525 "Highlight current article. | |
6526 This function calls `gnus-article-highlight-headers', | |
6527 `gnus-article-highlight-signature', and `gnus-article-add-buttons' to | |
6528 do the highlighting. See the documentation for those functions." | |
6529 (interactive (list 'force)) | |
6530 (gnus-article-highlight-headers) | |
6531 (gnus-article-highlight-signature) | |
6532 (gnus-article-add-buttons)) | |
6533 | |
6534 (defun gnus-article-highlight-headers () | |
6535 "Highlight article headers as specified by `gnus-header-face-alist'." | |
6536 (interactive) | |
6537 (save-excursion | |
6538 (set-buffer gnus-article-buffer) | |
6539 (save-restriction | |
6540 (let ((alist gnus-header-face-alist) | |
88155 | 6541 (inhibit-read-only t) |
17493 | 6542 (case-fold-search t) |
6543 (inhibit-point-motion-hooks t) | |
6544 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
|
6545 (article-narrow-to-head) |
17493 | 6546 (while (setq entry (pop alist)) |
6547 (goto-char (point-min)) | |
6548 (setq regexp (concat "^\\(" | |
6549 (if (string-equal "" (nth 0 entry)) | |
6550 "[^\t ]" | |
6551 (nth 0 entry)) | |
6552 "\\)") | |
6553 header-face (nth 1 entry) | |
6554 field-face (nth 2 entry)) | |
6555 (while (and (re-search-forward regexp nil t) | |
6556 (not (eobp))) | |
6557 (beginning-of-line) | |
6558 (setq from (point)) | |
6559 (unless (search-forward ":" nil t) | |
6560 (forward-char 1)) | |
6561 (when (and header-face | |
6562 (not (memq (point) hpoints))) | |
6563 (push (point) hpoints) | |
6564 (gnus-put-text-property from (point) 'face header-face)) | |
6565 (when (and field-face | |
6566 (not (memq (setq from (point)) fpoints))) | |
6567 (push from fpoints) | |
6568 (if (re-search-forward "^[^ \t]" nil t) | |
6569 (forward-char -2) | |
6570 (goto-char (point-max))) | |
6571 (gnus-put-text-property from (point) 'face field-face)))))))) | |
6572 | |
6573 (defun gnus-article-highlight-signature () | |
6574 "Highlight the signature in an article. | |
6575 It does this by highlighting everything after | |
88155 | 6576 `gnus-signature-separator' using the face `gnus-signature'." |
17493 | 6577 (interactive) |
6578 (save-excursion | |
6579 (set-buffer gnus-article-buffer) | |
88155 | 6580 (let ((inhibit-read-only t) |
17493 | 6581 (inhibit-point-motion-hooks t)) |
6582 (save-restriction | |
6583 (when (and gnus-signature-face | |
6584 (gnus-article-narrow-to-signature)) | |
6585 (gnus-overlay-put (gnus-make-overlay (point-min) (point-max)) | |
6586 'face gnus-signature-face) | |
6587 (widen) | |
6588 (gnus-article-search-signature) | |
6589 (let ((start (match-beginning 0)) | |
6590 (end (set-marker (make-marker) (1+ (match-end 0))))) | |
6591 (gnus-article-add-button start (1- end) 'gnus-signature-toggle | |
6592 end))))))) | |
6593 | |
6594 (defun gnus-button-in-region-p (b e prop) | |
6595 "Say whether PROP exists in the region." | |
6596 (text-property-not-all b e prop nil)) | |
6597 | |
6598 (defun gnus-article-add-buttons (&optional force) | |
6599 "Find external references in the article and make buttons of them. | |
6600 \"External references\" are things like Message-IDs and URLs, as | |
6601 specified by `gnus-button-alist'." | |
6602 (interactive (list 'force)) | |
6603 (save-excursion | |
6604 (set-buffer gnus-article-buffer) | |
88155 | 6605 (let ((inhibit-read-only t) |
17493 | 6606 (inhibit-point-motion-hooks t) |
6607 (case-fold-search t) | |
6608 (alist gnus-button-alist) | |
6609 beg entry regexp) | |
6610 ;; 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
|
6611 (let (marker entry new-list) |
17493 | 6612 (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
|
6613 (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
|
6614 (push marker new-list) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6615 (goto-char marker) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6616 (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
|
6617 (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
|
6618 (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
|
6619 'gnus-callback nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6620 (set-marker marker nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6621 (setq gnus-button-marker-list new-list)) |
17493 | 6622 ;; 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
|
6623 (article-goto-body) |
17493 | 6624 (setq beg (point)) |
6625 (while (setq entry (pop alist)) | |
88155 | 6626 (setq regexp (eval (car entry))) |
17493 | 6627 (goto-char beg) |
6628 (while (re-search-forward regexp nil t) | |
6629 (let* ((start (and entry (match-beginning (nth 1 entry)))) | |
6630 (end (and entry (match-end (nth 1 entry)))) | |
6631 (from (match-beginning 0))) | |
6632 (when (and (or (eq t (nth 2 entry)) | |
6633 (eval (nth 2 entry))) | |
6634 (not (gnus-button-in-region-p | |
6635 start end 'gnus-callback))) | |
6636 ;; That optional form returned non-nil, so we add the | |
6637 ;; button. | |
6638 (gnus-article-add-button | |
6639 start end 'gnus-button-push | |
6640 (car (push (set-marker (make-marker) from) | |
6641 gnus-button-marker-list)))))))))) | |
6642 | |
6643 ;; Add buttons to the head of an article. | |
6644 (defun gnus-article-add-buttons-to-head () | |
6645 "Add buttons to the head of the article." | |
6646 (interactive) | |
6647 (save-excursion | |
6648 (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
|
6649 (save-restriction |
88155 | 6650 (let ((inhibit-read-only t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6651 (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
|
6652 (case-fold-search t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6653 (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
|
6654 entry beg end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6655 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6656 (while alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6657 ;; Each alist entry. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6658 (setq entry (car alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6659 alist (cdr alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6660 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6661 (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
|
6662 ;; 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
|
6663 (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
|
6664 (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
|
6665 (match-beginning 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6666 (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6667 (goto-char beg) |
88155 | 6668 (while (re-search-forward (eval (nth 1 entry)) end t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6669 ;; 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
|
6670 (let* ((entry (cdr entry)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6671 (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
|
6672 (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
|
6673 (form (nth 2 entry))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6674 (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
|
6675 (when (eval form) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6676 (gnus-article-add-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
6677 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
|
6678 (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
|
6679 (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
|
6680 (goto-char end))))))) |
17493 | 6681 |
6682 ;;; External functions: | |
6683 | |
6684 (defun gnus-article-add-button (from to fun &optional data) | |
6685 "Create a button between FROM and TO with callback FUN and data DATA." | |
6686 (when gnus-article-button-face | |
6687 (gnus-overlay-put (gnus-make-overlay from to) | |
6688 'face gnus-article-button-face)) | |
6689 (gnus-add-text-properties | |
6690 from to | |
6691 (nconc (and gnus-article-mouse-face | |
6692 (list gnus-mouse-face-prop gnus-article-mouse-face)) | |
6693 (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
|
6694 (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
|
6695 (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
|
6696 :button-keymap gnus-widget-button-keymap)) |
17493 | 6697 |
6698 ;;; Internal functions: | |
6699 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
6700 (defun gnus-article-set-globals () |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
6701 (save-excursion |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
6702 (set-buffer gnus-summary-buffer) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
6703 (gnus-set-global-variables))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
6704 |
17493 | 6705 (defun gnus-signature-toggle (end) |
6706 (save-excursion | |
6707 (set-buffer gnus-article-buffer) | |
88155 | 6708 (let ((inhibit-read-only t) |
17493 | 6709 (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
|
6710 (if (text-property-any end (point-max) 'article-type 'signature) |
88155 | 6711 (progn |
6712 (gnus-delete-wash-type 'signature) | |
6713 (gnus-remove-text-properties-when | |
6714 'article-type 'signature end (point-max) | |
6715 (cons 'article-type (cons 'signature | |
6716 gnus-hidden-properties)))) | |
6717 (gnus-add-wash-type 'signature) | |
34727
4b9a7a10deaa
* gnus-util.el (gnus-add-text-properties-when): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33691
diff
changeset
|
6718 (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
|
6719 '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
|
6720 (cons 'article-type (cons 'signature |
88155 | 6721 gnus-hidden-properties))))) |
6722 (let ((gnus-article-mime-handle-alist-1 gnus-article-mime-handle-alist)) | |
6723 (gnus-set-mode-line 'article)))) | |
17493 | 6724 |
6725 (defun gnus-button-entry () | |
6726 ;; Return the first entry in `gnus-button-alist' matching this place. | |
6727 (let ((alist gnus-button-alist) | |
6728 (entry nil)) | |
6729 (while alist | |
6730 (setq entry (pop alist)) | |
88155 | 6731 (if (looking-at (eval (car entry))) |
17493 | 6732 (setq alist nil) |
6733 (setq entry nil))) | |
6734 entry)) | |
6735 | |
6736 (defun gnus-button-push (marker) | |
6737 ;; Push button starting at MARKER. | |
6738 (save-excursion | |
6739 (goto-char marker) | |
6740 (let* ((entry (gnus-button-entry)) | |
6741 (inhibit-point-motion-hooks t) | |
6742 (fun (nth 3 entry)) | |
6743 (args (mapcar (lambda (group) | |
6744 (let ((string (match-string group))) | |
6745 (gnus-set-text-properties | |
6746 0 (length string) nil string) | |
6747 string)) | |
6748 (nthcdr 4 entry)))) | |
6749 (cond | |
6750 ((fboundp fun) | |
6751 (apply fun args)) | |
6752 ((and (boundp fun) | |
6753 (fboundp (symbol-value fun))) | |
6754 (apply (symbol-value fun) args)) | |
6755 (t | |
6756 (gnus-message 1 "You must define `%S' to use this button" | |
6757 (cons fun args))))))) | |
6758 | |
88155 | 6759 (defun gnus-parse-news-url (url) |
6760 (let (scheme server port group message-id articles) | |
6761 (with-temp-buffer | |
6762 (insert url) | |
6763 (goto-char (point-min)) | |
6764 (when (looking-at "\\([A-Za-z]+\\):") | |
6765 (setq scheme (match-string 1)) | |
6766 (goto-char (match-end 0))) | |
6767 (when (looking-at "//\\([^:/]+\\)\\(:?\\)\\([0-9]+\\)?/") | |
6768 (setq server (match-string 1)) | |
6769 (setq port (if (stringp (match-string 3)) | |
6770 (string-to-number (match-string 3)) | |
6771 (match-string 3))) | |
6772 (goto-char (match-end 0))) | |
6773 | |
6774 (cond | |
6775 ((looking-at "\\(.*@.*\\)") | |
6776 (setq message-id (match-string 1))) | |
6777 ((looking-at "\\([^/]+\\)/\\([-0-9]+\\)") | |
6778 (setq group (match-string 1) | |
6779 articles (split-string (match-string 2) "-"))) | |
6780 ((looking-at "\\([^/]+\\)/?") | |
6781 (setq group (match-string 1))) | |
6782 (t | |
6783 (error "Unknown news URL syntax")))) | |
6784 (list scheme server port group message-id articles))) | |
6785 | |
6786 (defun gnus-button-handle-news (url) | |
6787 "Fetch a news URL." | |
6788 (destructuring-bind (scheme server port group message-id articles) | |
6789 (gnus-parse-news-url url) | |
6790 (cond | |
6791 (message-id | |
6792 (save-excursion | |
6793 (set-buffer gnus-summary-buffer) | |
6794 (if server | |
6795 (let ((gnus-refer-article-method | |
6796 (nconc (list (list 'nntp server)) | |
6797 gnus-refer-article-method)) | |
6798 (nntp-port-number (or port "nntp"))) | |
6799 (gnus-message 7 "Fetching %s with %s" | |
6800 message-id gnus-refer-article-method) | |
6801 (gnus-summary-refer-article message-id)) | |
6802 (gnus-summary-refer-article message-id)))) | |
6803 (group | |
6804 (gnus-button-fetch-group url))))) | |
6805 | |
6806 (defun gnus-button-handle-man (url) | |
6807 "Fetch a man page." | |
6808 (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url) | |
6809 (when (eq gnus-button-man-handler 'woman) | |
6810 (setq url (gnus-replace-in-string url "([1-9][X1a-z]*).*\\'" ""))) | |
6811 (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url) | |
6812 (funcall gnus-button-man-handler url)) | |
6813 | |
6814 (defun gnus-button-handle-info-url (url) | |
6815 "Fetch an info URL." | |
6816 (setq url (mm-subst-char-in-string ?+ ?\ url)) | |
6817 (cond | |
6818 ((string-match "^\\([^:/]+\\)?/\\(.*\\)" url) | |
6819 (gnus-info-find-node | |
6820 (concat "(" (or (gnus-url-unhex-string (match-string 1 url)) | |
6821 "Gnus") | |
6822 ")" (gnus-url-unhex-string (match-string 2 url))))) | |
6823 ((string-match "([^)\"]+)[^\"]+" url) | |
6824 (setq url | |
6825 (gnus-replace-in-string | |
6826 (gnus-replace-in-string url "[\n\t ]+" " ") "\"" "")) | |
6827 (gnus-info-find-node url)) | |
6828 (t (error "Can't parse %s" url)))) | |
6829 | |
6830 (defun gnus-button-handle-info-url-gnome (url) | |
6831 "Fetch GNOME style info URL." | |
6832 (setq url (mm-subst-char-in-string ?_ ?\ url)) | |
6833 (if (string-match "\\([^#]+\\)#?\\(.*\\)" url) | |
6834 (gnus-info-find-node | |
6835 (concat "(" | |
6836 (gnus-url-unhex-string | |
6837 (match-string 1 url)) | |
6838 ")" | |
6839 (or (gnus-url-unhex-string | |
6840 (match-string 2 url)) | |
6841 "Top"))) | |
6842 (error "Can't parse %s" url))) | |
6843 | |
6844 (defun gnus-button-handle-info-url-kde (url) | |
6845 "Fetch KDE style info URL." | |
6846 (gnus-info-find-node (gnus-url-unhex-string url))) | |
6847 | |
6848 (defun gnus-button-handle-info-keystrokes (url) | |
6849 "Call `info' when pushing the corresponding URL button." | |
6850 ;; For links like `C-h i d m gnus RET', `C-h i d m CC Mode RET'. | |
6851 (info) | |
6852 (Info-directory) | |
6853 (Info-menu url)) | |
6854 | |
17493 | 6855 (defun gnus-button-message-id (message-id) |
6856 "Fetch MESSAGE-ID." | |
6857 (save-excursion | |
6858 (set-buffer gnus-summary-buffer) | |
6859 (gnus-summary-refer-article message-id))) | |
6860 | |
6861 (defun gnus-button-fetch-group (address) | |
6862 "Fetch GROUP specified by ADDRESS." | |
6863 (if (not (string-match "[:/]" address)) | |
6864 ;; This is just a simple group url. | |
6865 (gnus-group-read-ephemeral-group address gnus-select-method) | |
88155 | 6866 (if (not |
6867 (string-match | |
6868 "^\\([^:/]+\\)\\(:\\([^/]+\\)\\)?/\\([^/]+\\)\\(/\\([0-9]+\\)\\)?" | |
6869 address)) | |
17493 | 6870 (error "Can't parse %s" address) |
6871 (gnus-group-read-ephemeral-group | |
6872 (match-string 4 address) | |
6873 `(nntp ,(match-string 1 address) | |
6874 (nntp-address ,(match-string 1 address)) | |
6875 (nntp-port-number ,(if (match-end 3) | |
6876 (match-string 3 address) | |
88155 | 6877 "nntp"))) |
6878 nil nil nil | |
6879 (and (match-end 6) (list (string-to-number (match-string 6 address)))))))) | |
17493 | 6880 |
6881 (defun gnus-url-parse-query-string (query &optional downcase) | |
6882 (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
|
6883 (setq pairs (split-string query "&")) |
17493 | 6884 (while pairs |
6885 (setq cur (car pairs) | |
88155 | 6886 pairs (cdr pairs)) |
17493 | 6887 (if (not (string-match "=" cur)) |
88155 | 6888 nil ; Grace |
6889 (setq key (gnus-url-unhex-string (substring cur 0 (match-beginning 0))) | |
6890 val (gnus-url-unhex-string (substring cur (match-end 0) nil) t)) | |
6891 (if downcase | |
6892 (setq key (downcase key))) | |
6893 (setq cur (assoc key retval)) | |
6894 (if cur | |
6895 (setcdr cur (cons val (cdr cur))) | |
6896 (setq retval (cons (list key val) retval))))) | |
17493 | 6897 retval)) |
6898 | |
6899 (defun gnus-url-mailto (url) | |
6900 ;; Send mail to someone | |
6901 (when (string-match "mailto:/*\\(.*\\)" url) | |
6902 (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
|
6903 (let (to args subject func) |
88155 | 6904 (setq args (gnus-url-parse-query-string |
6905 (if (string-match "^\\?" url) | |
6906 (substring url 1) | |
6907 (if (string-match "^\\([^?]+\\)\\?\\(.*\\)" url) | |
6908 (concat "to=" (match-string 1 url) "&" | |
6909 (match-string 2 url)) | |
6910 (concat "to=" url))) | |
6911 t) | |
6912 subject (cdr-safe (assoc "subject" args))) | |
6913 (gnus-msg-mail) | |
17493 | 6914 (while args |
6915 (setq func (intern-soft (concat "message-goto-" (downcase (caar args))))) | |
6916 (if (fboundp func) | |
88155 | 6917 (funcall func) |
6918 (message-position-on-field (caar args))) | |
6919 (insert (gnus-replace-in-string | |
6920 (mapconcat 'identity (reverse (cdar args)) ", ") | |
6921 "\r\n" "\n" t)) | |
17493 | 6922 (setq args (cdr args))) |
6923 (if subject | |
88155 | 6924 (message-goto-body) |
17493 | 6925 (message-goto-subject)))) |
6926 | |
6927 (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
|
6928 "Activate ADDRESS with `browse-url'." |
23608
3805e63b8caf
(gnus-button-embedded-url, gnus-button-url):
Dave Love <fx@gnu.org>
parents:
23361
diff
changeset
|
6929 (browse-url (gnus-strip-whitespace address))) |
17493 | 6930 |
6931 ;;; Next/prev buttons in the article buffer. | |
6932 | |
6933 (defvar gnus-next-page-line-format "%{%(Next page...%)%}\n") | |
6934 (defvar gnus-prev-page-line-format "%{%(Previous page...%)%}\n") | |
6935 | |
88155 | 6936 (defvar gnus-prev-page-map |
6937 (let ((map (make-sparse-keymap))) | |
6938 (unless (>= emacs-major-version 21) | |
6939 ;; XEmacs doesn't care. | |
6940 (set-keymap-parent map gnus-article-mode-map)) | |
6941 (define-key map gnus-mouse-2 'gnus-button-prev-page) | |
6942 (define-key map "\r" 'gnus-button-prev-page) | |
6943 map)) | |
6944 | |
6945 (defvar gnus-next-page-map | |
6946 (let ((map (make-sparse-keymap))) | |
6947 (unless (>= emacs-major-version 21) | |
6948 ;; XEmacs doesn't care. | |
6949 (set-keymap-parent map gnus-article-mode-map)) | |
6950 (define-key map gnus-mouse-2 'gnus-button-next-page) | |
6951 (define-key map "\r" 'gnus-button-next-page) | |
6952 map)) | |
17493 | 6953 |
6954 (defun gnus-insert-prev-page-button () | |
88155 | 6955 (let ((b (point)) |
6956 (inhibit-read-only t)) | |
17493 | 6957 (gnus-eval-format |
6958 gnus-prev-page-line-format nil | |
88155 | 6959 `(,@(gnus-local-map-property gnus-prev-page-map) |
6960 gnus-prev t | |
6961 gnus-callback gnus-article-button-prev-page | |
6962 article-type annotation)) | |
6963 (widget-convert-button | |
6964 'link b (if (bolp) | |
6965 ;; Exclude a newline. | |
6966 (1- (point)) | |
6967 (point)) | |
6968 :action 'gnus-button-prev-page | |
6969 :button-keymap gnus-prev-page-map))) | |
6970 | |
6971 (defun gnus-button-next-page (&optional args more-args) | |
17493 | 6972 "Go to the next page." |
6973 (interactive) | |
6974 (let ((win (selected-window))) | |
88155 | 6975 (select-window (gnus-get-buffer-window gnus-article-buffer t)) |
17493 | 6976 (gnus-article-next-page) |
6977 (select-window win))) | |
6978 | |
88155 | 6979 (defun gnus-button-prev-page (&optional args more-args) |
17493 | 6980 "Go to the prev page." |
6981 (interactive) | |
6982 (let ((win (selected-window))) | |
88155 | 6983 (select-window (gnus-get-buffer-window gnus-article-buffer t)) |
17493 | 6984 (gnus-article-prev-page) |
6985 (select-window win))) | |
6986 | |
6987 (defun gnus-insert-next-page-button () | |
88155 | 6988 (let ((b (point)) |
6989 (inhibit-read-only t)) | |
17493 | 6990 (gnus-eval-format gnus-next-page-line-format nil |
88155 | 6991 `(,@(gnus-local-map-property gnus-next-page-map) |
6992 gnus-next t | |
6993 gnus-callback gnus-article-button-next-page | |
6994 article-type annotation)) | |
6995 (widget-convert-button | |
6996 'link b (if (bolp) | |
6997 ;; Exclude a newline. | |
6998 (1- (point)) | |
6999 (point)) | |
7000 :action 'gnus-button-next-page | |
7001 :button-keymap gnus-next-page-map))) | |
17493 | 7002 |
7003 (defun gnus-article-button-next-page (arg) | |
7004 "Go to the next page." | |
7005 (interactive "P") | |
7006 (let ((win (selected-window))) | |
88155 | 7007 (select-window (gnus-get-buffer-window gnus-article-buffer t)) |
17493 | 7008 (gnus-article-next-page) |
7009 (select-window win))) | |
7010 | |
7011 (defun gnus-article-button-prev-page (arg) | |
7012 "Go to the prev page." | |
7013 (interactive "P") | |
7014 (let ((win (selected-window))) | |
88155 | 7015 (select-window (gnus-get-buffer-window gnus-article-buffer t)) |
17493 | 7016 (gnus-article-prev-page) |
7017 (select-window win))) | |
7018 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7019 (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
|
7020 '(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
|
7021 "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
|
7022 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7023 This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item |
88155 | 7024 is FUNCTION, FUNCTION will be applied to all newsgroups. If item is a |
7025 \(REGEXP . FUNCTION), FUNCTION will be only apply to the newsgroups | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7026 whose names match REGEXP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7027 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7028 For example: |
48588 | 7029 \((\"chinese\" . gnus-decode-encoded-word-region-by-guess) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7030 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
|
7031 (\"chinese\" . rfc1843-decode-region)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7032 ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7033 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7034 (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
|
7035 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7036 (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
|
7037 "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
|
7038 (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
|
7039 (eq gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7040 (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
|
7041 (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
|
7042 (mapcar (lambda (x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7043 (if (symbolp x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7044 (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
|
7045 (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
|
7046 (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
|
7047 (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
|
7048 (list (cdr x)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7049 gnus-decode-header-methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7050 (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
|
7051 (pop xlist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7052 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7053 (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
|
7054 (while xlist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7055 (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
|
7056 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7057 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7058 ;;; Treatment top-level handling. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7059 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7060 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7061 (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
|
7062 (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
|
7063 (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
|
7064 (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
|
7065 (treated-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7066 (or (not type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7067 (catch 'found |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7068 (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
|
7069 (while list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7070 (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
|
7071 (throw 'found t))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7072 (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
|
7073 val elem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7074 (gnus-run-hooks 'gnus-part-display-hook) |
88155 | 7075 (dolist (elem alist) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7076 (setq val |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7077 (save-excursion |
88155 | 7078 (when (gnus-buffer-live-p gnus-summary-buffer) |
7079 (set-buffer gnus-summary-buffer)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7080 (symbol-value (car elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7081 (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
|
7082 treated-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7083 (gnus-treat-predicate val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7084 (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
|
7085 highlightp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7086 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7087 (funcall (cadr elem))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7088 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7089 ;; Dynamic variables. |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
7090 (eval-when-compile |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
7091 (defvar part-number) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
7092 (defvar total-parts) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
7093 (defvar type) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
7094 (defvar condition) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
7095 (defvar length)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
7096 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7097 (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
|
7098 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7099 ((null val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7100 nil) |
88155 | 7101 (condition |
7102 (eq condition val)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7103 ((and (listp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7104 (stringp (car val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7105 (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
|
7106 (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
|
7107 val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7108 ((listp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7109 (let ((pred (pop val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7110 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7111 ((eq pred 'or) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7112 (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
|
7113 ((eq pred 'and) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7114 (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
|
7115 ((eq pred 'not) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7116 (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
|
7117 ((eq pred 'typep) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7118 (equal (car val) type)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7119 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7120 (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
|
7121 ((eq val t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7122 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7123 ((eq val 'head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7124 nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7125 ((eq val 'last) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7126 (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
|
7127 ((numberp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7128 (< length val)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7129 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
7130 (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
|
7131 |
88155 | 7132 (defun gnus-article-encrypt-body (protocol &optional n) |
7133 "Encrypt the article body." | |
7134 (interactive | |
7135 (list | |
7136 (or gnus-article-encrypt-protocol | |
7137 (completing-read "Encrypt protocol: " | |
7138 gnus-article-encrypt-protocol-alist | |
7139 nil t)) | |
7140 current-prefix-arg)) | |
7141 (let ((func (cdr (assoc protocol gnus-article-encrypt-protocol-alist)))) | |
7142 (unless func | |
7143 (error "Can't find the encrypt protocol %s" protocol)) | |
7144 (if (member gnus-newsgroup-name '("nndraft:delayed" | |
7145 "nndraft:drafts" | |
7146 "nndraft:queue")) | |
7147 (error "Can't encrypt the article in group %s" | |
7148 gnus-newsgroup-name)) | |
7149 (gnus-summary-iterate n | |
7150 (save-excursion | |
7151 (set-buffer gnus-summary-buffer) | |
7152 (let ((mail-parse-charset gnus-newsgroup-charset) | |
7153 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) | |
7154 (summary-buffer gnus-summary-buffer) | |
7155 references point) | |
7156 (gnus-set-global-variables) | |
7157 (when (gnus-group-read-only-p) | |
7158 (error "The current newsgroup does not support article encrypt")) | |
7159 (gnus-summary-show-article t) | |
7160 (setq references | |
7161 (or (mail-header-references gnus-current-headers) "")) | |
7162 (set-buffer gnus-article-buffer) | |
7163 (let* ((inhibit-read-only t) | |
7164 (headers | |
7165 (mapcar (lambda (field) | |
7166 (and (save-restriction | |
7167 (message-narrow-to-head) | |
7168 (goto-char (point-min)) | |
7169 (search-forward field nil t)) | |
7170 (prog2 | |
7171 (message-narrow-to-field) | |
7172 (buffer-string) | |
7173 (delete-region (point-min) (point-max)) | |
7174 (widen)))) | |
7175 '("Content-Type:" "Content-Transfer-Encoding:" | |
7176 "Content-Disposition:")))) | |
7177 (message-narrow-to-head) | |
7178 (message-remove-header "MIME-Version") | |
7179 (goto-char (point-max)) | |
7180 (setq point (point)) | |
7181 (insert (apply 'concat headers)) | |
7182 (widen) | |
7183 (narrow-to-region point (point-max)) | |
7184 (let ((message-options message-options)) | |
7185 (message-options-set 'message-sender user-mail-address) | |
7186 (message-options-set 'message-recipients user-mail-address) | |
7187 (message-options-set 'message-sign-encrypt 'not) | |
7188 (funcall func)) | |
7189 (goto-char (point-min)) | |
7190 (insert "MIME-Version: 1.0\n") | |
7191 (widen) | |
7192 (gnus-summary-edit-article-done | |
7193 references nil summary-buffer t)) | |
7194 (when gnus-keep-backlog | |
7195 (gnus-backlog-remove-article | |
7196 (car gnus-article-current) (cdr gnus-article-current))) | |
7197 (save-excursion | |
7198 (when (get-buffer gnus-original-article-buffer) | |
7199 (set-buffer gnus-original-article-buffer) | |
7200 (setq gnus-original-article nil))) | |
7201 (when gnus-use-cache | |
7202 (gnus-cache-update-article | |
7203 (car gnus-article-current) (cdr gnus-article-current)))))))) | |
7204 | |
7205 (defvar gnus-mime-security-button-line-format "%{%([[%t:%i]%D]%)%}\n" | |
7206 "The following specs can be used: | |
7207 %t The security MIME type | |
7208 %i Additional info | |
7209 %d Details | |
7210 %D Details if button is pressed") | |
7211 | |
7212 (defvar gnus-mime-security-button-end-line-format "%{%([[End of %t]%D]%)%}\n" | |
7213 "The following specs can be used: | |
7214 %t The security MIME type | |
7215 %i Additional info | |
7216 %d Details | |
7217 %D Details if button is pressed") | |
7218 | |
7219 (defvar gnus-mime-security-button-line-format-alist | |
7220 '((?t gnus-tmp-type ?s) | |
7221 (?i gnus-tmp-info ?s) | |
7222 (?d gnus-tmp-details ?s) | |
7223 (?D gnus-tmp-pressed-details ?s))) | |
7224 | |
7225 (defvar gnus-mime-security-button-map | |
7226 (let ((map (make-sparse-keymap))) | |
7227 (unless (>= (string-to-number emacs-version) 21) | |
7228 (set-keymap-parent map gnus-article-mode-map)) | |
7229 (define-key map gnus-mouse-2 'gnus-article-push-button) | |
7230 (define-key map "\r" 'gnus-article-press-button) | |
7231 map)) | |
7232 | |
7233 (defvar gnus-mime-security-details-buffer nil) | |
7234 | |
7235 (defvar gnus-mime-security-button-pressed nil) | |
7236 | |
7237 (defvar gnus-mime-security-show-details-inline t | |
7238 "If non-nil, show details in the article buffer.") | |
7239 | |
7240 (defun gnus-mime-security-verify-or-decrypt (handle) | |
7241 (mm-remove-parts (cdr handle)) | |
7242 (let ((region (mm-handle-multipart-ctl-parameter handle 'gnus-region)) | |
7243 point (inhibit-read-only t)) | |
7244 (if region | |
7245 (goto-char (car region))) | |
7246 (save-restriction | |
7247 (narrow-to-region (point) (point)) | |
7248 (with-current-buffer (mm-handle-multipart-original-buffer handle) | |
7249 (let* ((mm-verify-option 'known) | |
7250 (mm-decrypt-option 'known) | |
7251 (nparts (mm-possibly-verify-or-decrypt (cdr handle) handle))) | |
7252 (unless (eq nparts (cdr handle)) | |
7253 (mm-destroy-parts (cdr handle)) | |
7254 (setcdr handle nparts)))) | |
7255 (setq point (point)) | |
7256 (gnus-mime-display-security handle) | |
7257 (goto-char (point-max))) | |
7258 (when region | |
7259 (delete-region (point) (cdr region)) | |
7260 (set-marker (car region) nil) | |
7261 (set-marker (cdr region) nil)) | |
7262 (goto-char point))) | |
7263 | |
7264 (defun gnus-mime-security-show-details (handle) | |
7265 (let ((details (mm-handle-multipart-ctl-parameter handle 'gnus-details))) | |
7266 (if (not details) | |
7267 (gnus-message 5 "No details.") | |
7268 (if gnus-mime-security-show-details-inline | |
7269 (let ((gnus-mime-security-button-pressed | |
7270 (not (get-text-property (point) 'gnus-mime-details))) | |
7271 (gnus-mime-security-button-line-format | |
7272 (get-text-property (point) 'gnus-line-format)) | |
7273 (inhibit-read-only t)) | |
7274 (forward-char -1) | |
7275 (while (eq (get-text-property (point) 'gnus-line-format) | |
7276 gnus-mime-security-button-line-format) | |
7277 (forward-char -1)) | |
7278 (forward-char) | |
7279 (save-restriction | |
7280 (narrow-to-region (point) (point)) | |
7281 (gnus-insert-mime-security-button handle)) | |
7282 (delete-region (point) | |
7283 (or (text-property-not-all | |
7284 (point) (point-max) | |
7285 'gnus-line-format | |
7286 gnus-mime-security-button-line-format) | |
7287 (point-max)))) | |
7288 ;; Not inlined. | |
7289 (if (gnus-buffer-live-p gnus-mime-security-details-buffer) | |
7290 (with-current-buffer gnus-mime-security-details-buffer | |
7291 (erase-buffer) | |
7292 t) | |
7293 (setq gnus-mime-security-details-buffer | |
7294 (gnus-get-buffer-create "*MIME Security Details*"))) | |
7295 (with-current-buffer gnus-mime-security-details-buffer | |
7296 (insert details) | |
7297 (goto-char (point-min))) | |
7298 (pop-to-buffer gnus-mime-security-details-buffer))))) | |
7299 | |
7300 (defun gnus-mime-security-press-button (handle) | |
7301 (save-excursion | |
7302 (if (mm-handle-multipart-ctl-parameter handle 'gnus-info) | |
7303 (gnus-mime-security-show-details handle) | |
7304 (gnus-mime-security-verify-or-decrypt handle)))) | |
7305 | |
7306 (defun gnus-insert-mime-security-button (handle &optional displayed) | |
7307 (let* ((protocol (mm-handle-multipart-ctl-parameter handle 'protocol)) | |
7308 (gnus-tmp-type | |
7309 (concat | |
7310 (or (nth 2 (assoc protocol mm-verify-function-alist)) | |
7311 (nth 2 (assoc protocol mm-decrypt-function-alist)) | |
7312 "Unknown") | |
7313 (if (equal (car handle) "multipart/signed") | |
7314 " Signed" " Encrypted") | |
7315 " Part")) | |
7316 (gnus-tmp-info | |
7317 (or (mm-handle-multipart-ctl-parameter handle 'gnus-info) | |
7318 "Undecided")) | |
7319 (gnus-tmp-details | |
7320 (mm-handle-multipart-ctl-parameter handle 'gnus-details)) | |
7321 gnus-tmp-pressed-details | |
7322 b e) | |
7323 (setq gnus-tmp-details | |
7324 (if gnus-tmp-details | |
7325 (concat "\n" gnus-tmp-details) | |
7326 "")) | |
7327 (setq gnus-tmp-pressed-details | |
7328 (if gnus-mime-security-button-pressed gnus-tmp-details "")) | |
7329 (unless (bolp) | |
7330 (insert "\n")) | |
7331 (setq b (point)) | |
7332 (gnus-eval-format | |
7333 gnus-mime-security-button-line-format | |
7334 gnus-mime-security-button-line-format-alist | |
7335 `(,@(gnus-local-map-property gnus-mime-security-button-map) | |
7336 gnus-callback gnus-mime-security-press-button | |
7337 gnus-line-format ,gnus-mime-security-button-line-format | |
7338 gnus-mime-details ,gnus-mime-security-button-pressed | |
7339 article-type annotation | |
7340 gnus-data ,handle)) | |
7341 (setq e (if (bolp) | |
7342 ;; Exclude a newline. | |
7343 (1- (point)) | |
7344 (point))) | |
7345 (widget-convert-button | |
7346 'link b e | |
7347 :mime-handle handle | |
7348 :action 'gnus-widget-press-button | |
7349 :button-keymap gnus-mime-security-button-map | |
7350 :help-echo | |
7351 (lambda (widget/window &optional overlay pos) | |
7352 ;; Needed to properly clear the message due to a bug in | |
7353 ;; wid-edit (XEmacs only). | |
7354 (when (boundp 'help-echo-owns-message) | |
7355 (setq help-echo-owns-message t)) | |
7356 (format | |
7357 "%S: show detail" | |
7358 (aref gnus-mouse-2 0)))))) | |
7359 | |
7360 (defun gnus-mime-display-security (handle) | |
7361 (save-restriction | |
7362 (narrow-to-region (point) (point)) | |
7363 (unless (gnus-unbuttonized-mime-type-p (car handle)) | |
7364 (gnus-insert-mime-security-button handle)) | |
7365 (gnus-mime-display-mixed (cdr handle)) | |
7366 (unless (bolp) | |
7367 (insert "\n")) | |
7368 (unless (gnus-unbuttonized-mime-type-p (car handle)) | |
7369 (let ((gnus-mime-security-button-line-format | |
7370 gnus-mime-security-button-end-line-format)) | |
7371 (gnus-insert-mime-security-button handle))) | |
7372 (mm-set-handle-multipart-parameter | |
7373 handle 'gnus-region | |
7374 (cons (set-marker (make-marker) (point-min)) | |
7375 (set-marker (make-marker) (point-max)))))) | |
7376 | |
17493 | 7377 (gnus-ems-redefine) |
7378 | |
7379 (provide 'gnus-art) | |
7380 | |
7381 (run-hooks 'gnus-art-load-hook) | |
7382 | |
88155 | 7383 ;;; arch-tag: 2654516f-6279-48f9-a83b-05c1fa450c33 |
17493 | 7384 ;;; gnus-art.el ends here |