Mercurial > emacs
annotate lisp/gnus/gnus-art.el @ 33934:dd855bc086f3
(widget-choose): Make sure pop-up window is large enough to display all
the choices, as there's no way to scroll it.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 28 Nov 2000 05:10:20 +0000 |
parents | 936c632692fd |
children | 4b9a7a10deaa |
rev | line source |
---|---|
17493 | 1 ;;; gnus-art.el --- article mode commands for Gnus |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. |
17493 | 3 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 5 ;; Keywords: news |
6 | |
7 ;; This file is part of GNU Emacs. | |
8 | |
9 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
10 ;; it under the terms of the GNU General Public License as published by | |
11 ;; the Free Software Foundation; either version 2, or (at your option) | |
12 ;; any later version. | |
13 | |
14 ;; GNU Emacs is distributed in the hope that it will be useful, | |
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 ;; GNU General Public License for more details. | |
18 | |
19 ;; You should have received a copy of the GNU General Public License | |
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
22 ;; Boston, MA 02111-1307, USA. | |
23 | |
24 ;;; Commentary: | |
25 | |
26 ;;; Code: | |
27 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
28 (eval-when-compile (require 'cl)) |
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
29 |
17493 | 30 (require 'gnus) |
31 (require 'gnus-sum) | |
32 (require 'gnus-spec) | |
33 (require 'gnus-int) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
34 (require 'mm-bodies) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
35 (require 'mail-parse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
36 (require 'mm-decode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
37 (require 'mm-view) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
38 (require 'wid-edit) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
39 (require 'mm-uu) |
17493 | 40 |
41 (defgroup gnus-article nil | |
42 "Article display." | |
43 :link '(custom-manual "(gnus)The Article Buffer") | |
44 :group 'gnus) | |
45 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
46 (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
|
47 "Treating article parts." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
48 :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
|
49 :group 'gnus-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
50 |
17493 | 51 (defgroup gnus-article-hiding nil |
52 "Hiding article parts." | |
53 :link '(custom-manual "(gnus)Article Hiding") | |
54 :group 'gnus-article) | |
55 | |
56 (defgroup gnus-article-highlight nil | |
57 "Article highlighting." | |
58 :link '(custom-manual "(gnus)Article Highlighting") | |
59 :group 'gnus-article | |
60 :group 'gnus-visual) | |
61 | |
62 (defgroup gnus-article-signature nil | |
63 "Article signatures." | |
64 :link '(custom-manual "(gnus)Article Signature") | |
65 :group 'gnus-article) | |
66 | |
67 (defgroup gnus-article-headers nil | |
68 "Article headers." | |
69 :link '(custom-manual "(gnus)Hiding Headers") | |
70 :group 'gnus-article) | |
71 | |
72 (defgroup gnus-article-washing nil | |
73 "Special commands on articles." | |
74 :link '(custom-manual "(gnus)Article Washing") | |
75 :group 'gnus-article) | |
76 | |
77 (defgroup gnus-article-emphasis nil | |
78 "Fontisizing articles." | |
79 :link '(custom-manual "(gnus)Article Fontisizing") | |
80 :group 'gnus-article) | |
81 | |
82 (defgroup gnus-article-saving nil | |
83 "Saving articles." | |
84 :link '(custom-manual "(gnus)Saving Articles") | |
85 :group 'gnus-article) | |
86 | |
87 (defgroup gnus-article-mime nil | |
88 "Worshiping the MIME wonder." | |
89 :link '(custom-manual "(gnus)Using MIME") | |
90 :group 'gnus-article) | |
91 | |
92 (defgroup gnus-article-buttons nil | |
93 "Pushable buttons in the article buffer." | |
94 :link '(custom-manual "(gnus)Article Buttons") | |
95 :group 'gnus-article) | |
96 | |
97 (defgroup gnus-article-various nil | |
98 "Other article options." | |
99 :link '(custom-manual "(gnus)Misc Article") | |
100 :group 'gnus-article) | |
101 | |
102 (defcustom gnus-ignored-headers | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
103 '("^Path:" "^Expires:" "^Date-Received:" "^References:" "^Xref:" "^Lines:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
104 "^Relay-Version:" "^Message-ID:" "^Approved:" "^Sender:" "^Received:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
105 "^X-UIDL:" "^MIME-Version:" "^Return-Path:" "^In-Reply-To:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
106 "^Content-Type:" "^Content-Transfer-Encoding:" "^X-WebTV-Signature:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
107 "^X-MimeOLE:" "^X-MSMail-Priority:" "^X-Priority:" "^X-Loop:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
108 "^X-Authentication-Warning:" "^X-MIME-Autoconverted:" "^X-Face:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
109 "^X-Attribution:" "^X-Originating-IP:" "^Delivered-To:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
110 "^NNTP-[-A-Za-z]+:" "^Distribution:" "^X-no-archive:" "^X-Trace:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
111 "^X-Complaints-To:" "^X-NNTP-Posting-Host:" "^X-Orig.*:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
112 "^Abuse-Reports-To:" "^Cache-Post-Path:" "^X-Article-Creation-Date:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
113 "^X-Poster:" "^X-Mail2News-Path:" "^X-Server-Date:" "^X-Cache:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
114 "^Originator:" "^X-Problems-To:" "^X-Auth-User:" "^X-Post-Time:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
115 "^X-Admin:" "^X-UID:" "^Resent-[-A-Za-z]+:" "^X-Mailing-List:" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
116 "^Precedence:" "^Original-[-A-Za-z]+:" "^X-filename:" "^X-Orcpt:" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
117 "^Old-Received:" "^X-Pgp" "^X-Auth:" "^X-From-Line:" |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
118 "^X-Gnus-Article-Number:" "^X-Majordomo:" "^X-Url:" "^X-Sender:" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
119 "^MBOX-Line" "^Priority:" "^X-Pgp" "^X400-[-A-Za-z]+:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
120 "^Status:" "^X-Gnus-Mail-Source:" "^Cancel-Lock:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
121 "^X-FTN" "^X-EXP32-SerialNo:" "^Encoding:" "^Importance:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
122 "^Autoforwarded:" "^Original-Encoded-Information-Types:" "^X-Ya-Pop3:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
123 "^X-Face-Version:" "^X-Vms-To:" "^X-ML-NAME:" "^X-ML-COUNT:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
124 "^Mailing-List:" "^X-finfo:" "^X-md5sum:" "^X-md5sum-Origin:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
125 "^X-Sun-Charset:" "^X-Accept-Language:" "^X-Envelope-Sender:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
126 "^List-[A-Za-z]+:" "^X-Listprocessor-Version:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
127 "^X-Received:" "^X-Distribute:" "^X-Sequence:" "^X-Juno-Line-Breaks:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
128 "^X-Notes-Item:" "^X-MS-TNEF-Correlator:" "^x-uunet-gateway:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
129 "^X-Received:" "^Content-length:" "X-precedence:") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
130 "*All headers that start with this regexp will be hidden. |
17493 | 131 This variable can also be a list of regexps of headers to be ignored. |
132 If `gnus-visible-headers' is non-nil, this variable will be ignored." | |
133 :type '(choice :custom-show nil | |
134 regexp | |
135 (repeat regexp)) | |
136 :group 'gnus-article-hiding) | |
137 | |
138 (defcustom gnus-visible-headers | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
139 "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^[BGF]?Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-From:\\|^X-Sent:" |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
140 "*All headers that do not match this regexp will be hidden. |
17493 | 141 This variable can also be a list of regexp of headers to remain visible. |
142 If this variable is non-nil, `gnus-ignored-headers' will be ignored." | |
143 :type '(repeat :value-to-internal (lambda (widget value) | |
144 (custom-split-regexp-maybe value)) | |
145 :match (lambda (widget value) | |
146 (or (stringp value) | |
147 (widget-editable-list-match widget value))) | |
148 regexp) | |
149 :group 'gnus-article-hiding) | |
150 | |
151 (defcustom gnus-sorted-header-list | |
152 '("^From:" "^Subject:" "^Summary:" "^Keywords:" "^Newsgroups:" | |
153 "^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
|
154 "*This variable is a list of regular expressions. |
17493 | 155 If it is non-nil, headers that match the regular expressions will |
156 be placed first in the article buffer in the sequence specified by | |
157 this list." | |
158 :type '(repeat regexp) | |
159 :group 'gnus-article-hiding) | |
160 | |
161 (defcustom gnus-boring-article-headers '(empty followup-to reply-to) | |
162 "Headers that are only to be displayed if they have interesting data. | |
163 Possible values in this list are `empty', `newsgroups', `followup-to', | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
164 `reply-to', `date', `long-to', and `many-to'." |
17493 | 165 :type '(set (const :tag "Headers with no content." empty) |
166 (const :tag "Newsgroups with only one group." newsgroups) | |
167 (const :tag "Followup-to identical to newsgroups." followup-to) | |
168 (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
|
169 (const :tag "Date less than four days old." date) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
170 (const :tag "Very long To and/or Cc header." long-to) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
171 (const :tag "Multiple To and/or Cc headers." many-to)) |
17493 | 172 :group 'gnus-article-hiding) |
173 | |
174 (defcustom gnus-signature-separator '("^-- $" "^-- *$") | |
175 "Regexp matching signature separator. | |
176 This can also be a list of regexps. In that case, it will be checked | |
177 from head to tail looking for a separator. Searches will be done from | |
178 the end of the buffer." | |
179 :type '(repeat string) | |
180 :group 'gnus-article-signature) | |
181 | |
182 (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
|
183 "Provide a limit to what is considered a signature. |
17493 | 184 If it is a number, no signature may not be longer (in characters) than |
185 that number. If it is a floating point number, no signature may be | |
186 longer (in lines) than that number. If it is a function, the function | |
187 will be called without any parameters, and if it returns nil, there is | |
188 no signature in the buffer. If it is a string, it will be used as a | |
189 regexp. If it matches, the text in question is not a signature." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
190 :type '(choice (integer :value 200) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
191 (number :value 4.0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
192 (function :value fun) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
193 (regexp :value ".*")) |
17493 | 194 :group 'gnus-article-signature) |
195 | |
196 (defcustom gnus-hidden-properties '(invisible t intangible t) | |
197 "Property list to use for hiding text." | |
198 :type 'sexp | |
199 :group 'gnus-article-hiding) | |
200 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
201 ;; Fixme: This isn't the right thing for mixed graphical and and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
202 ;; non-graphical frames in a session. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
203 ;; gnus-xmas.el overrides this for XEmacs. |
17493 | 204 (defcustom gnus-article-x-face-command |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
205 (if (and (fboundp 'image-type-available-p) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
206 (image-type-available-p 'xbm)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
207 'gnus-article-display-xface |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
208 (if gnus-article-compface-xbm |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
209 "{ echo '/* Width=48, Height=48 */'; uncompface; } | display -" |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
210 "{ 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
|
211 display -")) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
212 "*String or function to be executed to display an X-Face header. |
17493 | 213 If it is a string, the command will be executed in a sub-shell |
214 asynchronously. The compressed face will be piped to this command." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
215 :type '(choice string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
216 (function-item gnus-article-display-xface) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
217 function) |
17493 | 218 :group 'gnus-article-washing) |
219 | |
220 (defcustom gnus-article-x-face-too-ugly nil | |
221 "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
|
222 :type '(choice regexp (const nil)) |
17493 | 223 :group 'gnus-article-washing) |
224 | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
225 (defcustom gnus-article-banner-alist nil |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
226 "Banner alist for stripping. |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
227 For example, |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
228 ((egroups . \"^[ \\t\\n]*-------------------+\\\\( eGroups Sponsor -+\\\\)?....\\n\\\\(.+\\n\\\\)+\"))" |
33397 | 229 :version "21.1" |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
230 :type '(repeat (cons symbol regexp)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
231 :group 'gnus-article-washing) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
232 |
17493 | 233 (defcustom gnus-emphasis-alist |
234 (let ((format | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
235 "\\(\\s-\\|^\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\s-\\|[-,;:\"]\\s-\\|[?!.]+\\s-\\|\\s)\\)") |
17493 | 236 (types |
237 '(("_" "_" underline) | |
238 ("/" "/" italic) | |
239 ("\\*" "\\*" bold) | |
240 ("_/" "/_" underline-italic) | |
241 ("_\\*" "\\*_" underline-bold) | |
242 ("\\*/" "/\\*" bold-italic) | |
243 ("_\\*/" "/\\*_" underline-bold-italic)))) | |
244 `(("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)" | |
245 2 3 gnus-emphasis-underline) | |
246 ,@(mapcar | |
247 (lambda (spec) | |
248 (list | |
249 (format format (car spec) (cadr spec)) | |
21486
900aecbf7d38
(gnus-emphasis-alist): Use nth, not caddr.
Karl Heuer <kwzh@gnu.org>
parents:
20119
diff
changeset
|
250 2 3 (intern (format "gnus-emphasis-%s" (nth 2 spec))))) |
17493 | 251 types))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
252 "*Alist that says how to fontify certain phrases. |
17493 | 253 Each item looks like this: |
254 | |
255 (\"_\\\\(\\\\w+\\\\)_\" 0 1 'underline) | |
256 | |
257 The first element is a regular expression to be matched. The second | |
258 is a number that says what regular expression grouping used to find | |
259 the entire emphasized word. The third is a number that says what | |
260 regexp grouping should be displayed and highlighted. The fourth | |
261 is the face used for highlighting." | |
262 :type '(repeat (list :value ("" 0 0 default) | |
263 regexp | |
264 (integer :tag "Match group") | |
265 (integer :tag "Emphasize group") | |
266 face)) | |
267 :group 'gnus-article-emphasis) | |
268 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
269 (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
|
270 "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
|
271 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
|
272 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
|
273 and the latter avoids underlining any whitespace at all." |
33397 | 274 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
275 :group 'gnus-article-emphasis |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
276 :type 'regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
277 |
17493 | 278 (defface gnus-emphasis-bold '((t (:bold t))) |
279 "Face used for displaying strong emphasized text (*word*)." | |
280 :group 'gnus-article-emphasis) | |
281 | |
282 (defface gnus-emphasis-italic '((t (:italic t))) | |
283 "Face used for displaying italic emphasized text (/word/)." | |
284 :group 'gnus-article-emphasis) | |
285 | |
286 (defface gnus-emphasis-underline '((t (:underline t))) | |
287 "Face used for displaying underlined emphasized text (_word_)." | |
288 :group 'gnus-article-emphasis) | |
289 | |
290 (defface gnus-emphasis-underline-bold '((t (:bold t :underline t))) | |
291 "Face used for displaying underlined bold emphasized text (_*word*_)." | |
292 :group 'gnus-article-emphasis) | |
293 | |
294 (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
|
295 "Face used for displaying underlined italic emphasized text (_/word/_)." |
17493 | 296 :group 'gnus-article-emphasis) |
297 | |
298 (defface gnus-emphasis-bold-italic '((t (:bold t :italic t))) | |
299 "Face used for displaying bold italic emphasized text (/*word*/)." | |
300 :group 'gnus-article-emphasis) | |
301 | |
302 (defface gnus-emphasis-underline-bold-italic | |
303 '((t (:bold t :italic t :underline t))) | |
304 "Face used for displaying underlined bold italic emphasized text. | |
305 Esample: (_/*word*/_)." | |
306 :group 'gnus-article-emphasis) | |
307 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
308 (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
|
309 '((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
|
310 "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
|
311 :group 'gnus-article-emphasis) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
312 |
17493 | 313 (defcustom gnus-article-time-format "%a, %b %d %Y %T %Z" |
314 "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
|
315 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
|
316 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
317 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
|
318 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
|
319 be fed to `format-time-string'." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
320 :type '(choice string symbol) |
17493 | 321 :link '(custom-manual "(gnus)Article Date") |
322 :group 'gnus-article-washing) | |
323 | |
324 (eval-and-compile | |
325 (autoload 'mail-extract-address-components "mail-extr")) | |
326 | |
327 (defcustom gnus-save-all-headers t | |
328 "*If non-nil, don't remove any headers before saving." | |
329 :group 'gnus-article-saving | |
330 :type 'boolean) | |
331 | |
332 (defcustom gnus-prompt-before-saving 'always | |
333 "*This variable says how much prompting is to be done when saving articles. | |
334 If it is nil, no prompting will be done, and the articles will be | |
335 saved to the default files. If this variable is `always', each and | |
336 every article that is saved will be preceded by a prompt, even when | |
337 saving large batches of articles. If this variable is neither nil not | |
338 `always', there the user will be prompted once for a file name for | |
339 each invocation of the saving commands." | |
340 :group 'gnus-article-saving | |
341 :type '(choice (item always) | |
342 (item :tag "never" nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
343 (sexp :tag "once" :format "%t\n" :value t))) |
17493 | 344 |
345 (defcustom gnus-saved-headers gnus-visible-headers | |
346 "Headers to keep if `gnus-save-all-headers' is nil. | |
347 If `gnus-save-all-headers' is non-nil, this variable will be ignored. | |
348 If that variable is nil, however, all headers that match this regexp | |
349 will be kept while the rest will be deleted before saving." | |
350 :group 'gnus-article-saving | |
23361
86b5dc6c12f5
(gnus-article-x-face-too-ugly): Fix type.
Karl Heuer <kwzh@gnu.org>
parents:
22584
diff
changeset
|
351 :type 'regexp) |
17493 | 352 |
353 (defcustom gnus-default-article-saver 'gnus-summary-save-in-rmail | |
354 "A function to save articles in your favourite format. | |
355 The function must be interactively callable (in other words, it must | |
356 be an Emacs command). | |
357 | |
358 Gnus provides the following functions: | |
359 | |
360 * gnus-summary-save-in-rmail (Rmail format) | |
361 * gnus-summary-save-in-mail (Unix mail format) | |
362 * gnus-summary-save-in-folder (MH folder) | |
363 * gnus-summary-save-in-file (article format) | |
364 * gnus-summary-save-in-vm (use VM's folder format) | |
365 * gnus-summary-write-to-file (article format -- overwrite)." | |
366 :group 'gnus-article-saving | |
367 :type '(radio (function-item gnus-summary-save-in-rmail) | |
368 (function-item gnus-summary-save-in-mail) | |
369 (function-item gnus-summary-save-in-folder) | |
370 (function-item gnus-summary-save-in-file) | |
371 (function-item gnus-summary-save-in-vm) | |
372 (function-item gnus-summary-write-to-file))) | |
373 | |
374 (defcustom gnus-rmail-save-name 'gnus-plain-save-name | |
375 "A function generating a file name to save articles in Rmail format. | |
376 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE." | |
377 :group 'gnus-article-saving | |
378 :type 'function) | |
379 | |
380 (defcustom gnus-mail-save-name 'gnus-plain-save-name | |
381 "A function generating a file name to save articles in Unix mail format. | |
382 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE." | |
383 :group 'gnus-article-saving | |
384 :type 'function) | |
385 | |
386 (defcustom gnus-folder-save-name 'gnus-folder-save-name | |
387 "A function generating a file name to save articles in MH folder. | |
388 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER." | |
389 :group 'gnus-article-saving | |
390 :type 'function) | |
391 | |
392 (defcustom gnus-file-save-name 'gnus-numeric-save-name | |
393 "A function generating a file name to save articles in article format. | |
394 The function is called with NEWSGROUP, HEADERS, and optional | |
395 LAST-FILE." | |
396 :group 'gnus-article-saving | |
397 :type 'function) | |
398 | |
399 (defcustom gnus-split-methods | |
400 '((gnus-article-archive-name) | |
401 (gnus-article-nndoc-name)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
402 "*Variable used to suggest where articles are to be saved. |
17493 | 403 For instance, if you would like to save articles related to Gnus in |
404 the file \"gnus-stuff\", and articles related to VM in \"vm-stuff\", | |
405 you could set this variable to something like: | |
406 | |
407 '((\"^Subject:.*gnus\\|^Newsgroups:.*gnus\" \"gnus-stuff\") | |
408 (\"^Subject:.*vm\\|^Xref:.*vm\" \"vm-stuff\")) | |
409 | |
410 This variable is an alist where the where the key is the match and the | |
411 value is a list of possible files to save in if the match is non-nil. | |
412 | |
413 If the match is a string, it is used as a regexp match on the | |
414 article. If the match is a symbol, that symbol will be funcalled | |
415 from the buffer of the article to be saved with the newsgroup as the | |
416 parameter. If it is a list, it will be evaled in the same buffer. | |
417 | |
418 If this form or function returns a string, this string will be used as | |
419 a possible file name; and if it returns a non-nil list, that list will | |
420 be used as possible file names." | |
421 :group 'gnus-article-saving | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
422 :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
|
423 (cons :value ("" "") regexp (repeat string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
424 (sexp :value nil)))) |
17493 | 425 |
426 (defcustom gnus-page-delimiter "^\^L" | |
427 "*Regexp describing what to use as article page delimiters. | |
428 The default value is \"^\^L\", which is a form linefeed at the | |
429 beginning of a line." | |
430 :type 'regexp | |
431 :group 'gnus-article-various) | |
432 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
433 (defcustom gnus-article-mode-line-format "Gnus: %g [%w] %S%m" |
17493 | 434 "*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
|
435 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
|
436 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
437 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
|
438 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
439 %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
|
440 %m The number of MIME parts in the article." |
17493 | 441 :type 'string |
442 :group 'gnus-article-various) | |
443 | |
444 (defcustom gnus-article-mode-hook nil | |
445 "*A hook for Gnus article mode." | |
446 :type 'hook | |
447 :group 'gnus-article-various) | |
448 | |
449 (defcustom gnus-article-menu-hook nil | |
450 "*Hook run after the creation of the article mode menu." | |
451 :type 'hook | |
452 :group 'gnus-article-various) | |
453 | |
454 (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
|
455 "*A hook called after an article has been prepared in the article buffer." |
17493 | 456 :type 'hook |
457 :group 'gnus-article-various) | |
458 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
459 (defcustom gnus-article-hide-pgp-hook nil |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
460 "*A hook called after successfully hiding a PGP signature." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
461 :type 'hook |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
462 :group 'gnus-article-various) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
463 |
17493 | 464 (defcustom gnus-article-button-face 'bold |
465 "Face used for highlighting buttons in the article buffer. | |
466 | |
467 An article button is a piece of text that you can activate by pressing | |
468 `RET' or `mouse-2' above it." | |
469 :type 'face | |
470 :group 'gnus-article-buttons) | |
471 | |
472 (defcustom gnus-article-mouse-face 'highlight | |
473 "Face used for mouse highlighting in the article buffer. | |
474 | |
475 Article buttons will be displayed in this face when the cursor is | |
476 above them." | |
477 :type 'face | |
478 :group 'gnus-article-buttons) | |
479 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
480 (defcustom gnus-signature-face 'gnus-signature-face |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
481 "Face used for highlighting a signature in the article buffer. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
482 Obsolete; use the face `gnus-signature-face' for customizations instead." |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
483 :type 'face |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
484 :group 'gnus-article-highlight |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
485 :group 'gnus-article-signature) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
486 |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
487 (defface gnus-signature-face |
32927
c0b62376988c
(gnus-signature-face): Use italics on all terminals that support it.
Jason Rumney <jasonr@gnu.org>
parents:
32210
diff
changeset
|
488 '((t |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
489 (:italic t))) |
17493 | 490 "Face used for highlighting a signature in the article buffer." |
491 :group 'gnus-article-highlight | |
492 :group 'gnus-article-signature) | |
493 | |
494 (defface gnus-header-from-face | |
495 '((((class color) | |
496 (background dark)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
497 (:foreground "spring green")) |
17493 | 498 (((class color) |
499 (background light)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
500 (:foreground "red3")) |
17493 | 501 (t |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
502 (:italic t))) |
17493 | 503 "Face used for displaying from headers." |
504 :group 'gnus-article-headers | |
505 :group 'gnus-article-highlight) | |
506 | |
507 (defface gnus-header-subject-face | |
508 '((((class color) | |
509 (background dark)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
510 (:foreground "SeaGreen3")) |
17493 | 511 (((class color) |
512 (background light)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
513 (:foreground "red4")) |
17493 | 514 (t |
515 (:bold t :italic t))) | |
516 "Face used for displaying subject headers." | |
517 :group 'gnus-article-headers | |
518 :group 'gnus-article-highlight) | |
519 | |
520 (defface gnus-header-newsgroups-face | |
521 '((((class color) | |
522 (background dark)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
523 (:foreground "yellow" :italic t)) |
17493 | 524 (((class color) |
525 (background light)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
526 (:foreground "MidnightBlue" :italic t)) |
17493 | 527 (t |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
528 (:italic t))) |
17493 | 529 "Face used for displaying newsgroups headers." |
530 :group 'gnus-article-headers | |
531 :group 'gnus-article-highlight) | |
532 | |
533 (defface gnus-header-name-face | |
534 '((((class color) | |
535 (background dark)) | |
536 (:foreground "SeaGreen")) | |
537 (((class color) | |
538 (background light)) | |
539 (:foreground "maroon")) | |
540 (t | |
541 (:bold t))) | |
542 "Face used for displaying header names." | |
543 :group 'gnus-article-headers | |
544 :group 'gnus-article-highlight) | |
545 | |
546 (defface gnus-header-content-face | |
547 '((((class color) | |
548 (background dark)) | |
549 (:foreground "forest green" :italic t)) | |
550 (((class color) | |
551 (background light)) | |
552 (:foreground "indianred4" :italic t)) | |
553 (t | |
554 (:italic t))) "Face used for displaying header content." | |
555 :group 'gnus-article-headers | |
556 :group 'gnus-article-highlight) | |
557 | |
558 (defcustom gnus-header-face-alist | |
559 '(("From" nil gnus-header-from-face) | |
560 ("Subject" nil gnus-header-subject-face) | |
561 ("Newsgroups:.*," nil gnus-header-newsgroups-face) | |
562 ("" gnus-header-name-face gnus-header-content-face)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
563 "*Controls highlighting of article header. |
17493 | 564 |
565 An alist of the form (HEADER NAME CONTENT). | |
566 | |
567 HEADER is a regular expression which should match the name of an | |
568 header header and NAME and CONTENT are either face names or nil. | |
569 | |
570 The name of each header field will be displayed using the face | |
571 specified by the first element in the list where HEADER match the | |
572 header name and NAME is non-nil. Similarly, the content will be | |
573 displayed by the first non-nil matching CONTENT face." | |
574 :group 'gnus-article-headers | |
575 :group 'gnus-article-highlight | |
576 :type '(repeat (list (regexp :tag "Header") | |
577 (choice :tag "Name" | |
578 (item :tag "skip" nil) | |
579 (face :value default)) | |
580 (choice :tag "Content" | |
581 (item :tag "skip" nil) | |
582 (face :value default))))) | |
583 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
584 (defcustom gnus-article-decode-hook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
585 '(article-decode-charset article-decode-encoded-words) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
586 "*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
|
587 :group 'gnus-article-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
588 :type 'hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
589 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
590 (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
|
591 "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
|
592 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
593 :type 'function) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
594 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
595 (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
|
596 "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
|
597 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
598 (defvar gnus-article-dumbquotes-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
599 '(("\202" ",") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
600 ("\203" "f") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
601 ("\204" ",,") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
602 ("\205" "...") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
603 ("\213" "<") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
604 ("\214" "OE") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
605 ("\221" "`") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
606 ("\222" "'") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
607 ("\223" "``") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
608 ("\224" "\"") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
609 ("\225" "*") |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
610 ("\226" "-") |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
611 ("\227" "--") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
612 ("\231" "(TM)") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
613 ("\233" ">") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
614 ("\234" "oe") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
615 ("\264" "'")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
616 "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
|
617 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
618 (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
|
619 "List of MIME types that should be ignored by Gnus." |
33397 | 620 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
621 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
622 :type '(repeat regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
623 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
624 (defcustom gnus-unbuttonized-mime-types '(".*/.*") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
625 "List of MIME types that should not be given buttons when rendered inline." |
33397 | 626 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
627 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
628 :type '(repeat regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
629 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
630 (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
|
631 "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
|
632 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
|
633 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
|
634 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
635 :type 'function) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
636 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
637 (defcustom gnus-mime-multipart-functions nil |
33397 | 638 "An alist of MIME types to functions to display them." |
639 :version "21.1" | |
640 :group 'gnus-article-mime | |
641 :type 'alist) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
642 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
643 (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
|
644 "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
|
645 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
|
646 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
|
647 be added below it (otherwise)." |
33397 | 648 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
649 :group 'gnus-article-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
650 :type 'boolean) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
651 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
652 (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
|
653 "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
|
654 This is meant for people who want to view first matched part. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
655 For `undisplayed-alternative' (default), the first undisplayed |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
656 part or alternative part is used. For `undisplayed', the first |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
657 undisplayed part is used. For a function, the first part which |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
658 the function return `t' is used. For `nil', the first part is |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
659 used." |
33397 | 660 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
661 :group 'gnus-article-mime |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
662 :type '(choice |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
663 (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
|
664 (item :tag "undisplayed" :value undisplayed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
665 (item :tag "undisplayed or alternative" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
666 :value undisplayed-alternative) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
667 (function))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
668 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
669 (defcustom gnus-mime-action-alist |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
670 '(("save to file" . gnus-mime-save-part) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
671 ("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
|
672 ("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
|
673 ("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
|
674 ("toggle display" . gnus-article-press-button) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
675 ("view as type" . gnus-mime-view-part-as-type) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
676 ("internalize type" . gnus-mime-internalize-part) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
677 ("externalize type" . gnus-mime-externalize-part)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
678 "An alist of actions that run on the MIME attachment." |
33397 | 679 :version "21.1" |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
680 :group 'gnus-article-mime |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
681 :type '(repeat (cons (string :tag "name") |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
682 (function)))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
683 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
684 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
685 ;;; The treatment variables |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
686 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
687 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
688 (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
|
689 "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
|
690 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
691 (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
|
692 '(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
|
693 (const :tag "On" t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
694 (const :tag "Header" head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
695 (const :tag "Last" last) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
696 (integer :tag "Less") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
697 (repeat :tag "Groups" regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
698 (sexp :tag "Predicate"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
699 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
700 (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
|
701 '(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
|
702 (const :tag "Header" head))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
703 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
704 (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
|
705 "Parts to treat.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
706 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
707 (defvar gnus-inhibit-treatment nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
708 "Whether to inhibit treatment.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
709 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
710 (defcustom gnus-treat-highlight-signature '(or last (typep "text/x-vcard")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
711 "Highlight the signature. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
712 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
713 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
714 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
715 :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
|
716 (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
|
717 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
718 (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
|
719 "Add buttons. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
720 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
721 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
722 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
723 :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
|
724 (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
|
725 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
726 (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
|
727 "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
|
728 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
729 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
730 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
731 :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
|
732 (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
|
733 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
734 (defcustom gnus-treat-emphasize 50000 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
735 "Emphasize text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
736 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
737 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
738 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
739 :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
|
740 (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
|
741 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
742 (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
|
743 "Remove carriage returns. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
744 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
745 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
746 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
747 :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
|
748 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
749 (defcustom gnus-treat-hide-headers 'head |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
750 "Hide headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
751 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
752 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
753 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
754 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
755 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
756 (defcustom gnus-treat-hide-boring-headers nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
757 "Hide boring headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
758 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
759 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
760 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
761 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
762 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
763 (defcustom gnus-treat-hide-signature nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
764 "Hide the signature. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
765 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
766 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
767 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
768 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
769 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
770 (defcustom gnus-treat-fill-article nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
771 "Fill the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
772 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
773 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
774 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
775 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
776 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
777 (defcustom gnus-treat-hide-citation nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
778 "Hide cited text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
779 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
780 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
781 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
782 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
783 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
784 (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
|
785 "Hide cited text. |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
786 Valid values are nil, t, `head', `last', an integer or a predicate. |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
787 See the manual for details." |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
788 :group 'gnus-article-treat |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
789 :type gnus-article-treat-custom) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
790 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
791 (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
|
792 "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
|
793 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
794 See the manual for details." |
33397 | 795 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
796 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
797 :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
|
798 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
799 (defcustom gnus-treat-strip-pgp t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
800 "Strip PGP signatures. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
801 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
802 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
803 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
804 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
805 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
806 (defcustom gnus-treat-strip-pem nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
807 "Strip PEM signatures. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
808 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
809 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
810 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
811 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
812 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
813 (defcustom gnus-treat-strip-banner t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
814 "Strip banners from articles. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
815 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
|
816 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
817 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
818 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
819 :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
|
820 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
821 (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
|
822 "Highlight the headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
823 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
824 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
825 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
826 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
827 (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
|
828 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
829 (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
|
830 "Highlight cited text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
831 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
832 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
833 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
834 :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
|
835 (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
|
836 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
837 (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
|
838 "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
|
839 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
840 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
841 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
842 :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
|
843 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
844 (defcustom gnus-treat-date-local nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
845 "Display the Date in the local timezone. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
846 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
847 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
848 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
849 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
850 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
851 (defcustom gnus-treat-date-lapsed nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
852 "Display the Date 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
|
853 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
854 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
855 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
856 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
857 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
858 (defcustom gnus-treat-date-original nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
859 "Display the date in the original timezone. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
860 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
861 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
862 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
863 :type gnus-article-treat-head-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
864 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
865 (defcustom gnus-treat-date-iso8601 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
866 "Display the date in the ISO8601 format. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
867 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
868 See the manual for details." |
33397 | 869 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
870 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
871 :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
|
872 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
873 (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
|
874 "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
|
875 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
|
876 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
877 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
878 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
879 :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
|
880 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
881 (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
|
882 "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
|
883 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
884 See the manual for details." |
33397 | 885 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
886 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
887 :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
|
888 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
889 (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
|
890 "Strip trailing blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
891 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
892 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
893 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
894 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
895 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
896 (defcustom gnus-treat-strip-leading-blank-lines nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
897 "Strip leading blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
898 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
899 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
900 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
901 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
902 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
903 (defcustom gnus-treat-strip-multiple-blank-lines nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
904 "Strip multiple blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
905 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
906 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
907 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
908 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
909 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
910 (defcustom gnus-treat-overstrike t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
911 "Treat overstrike highlighting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
912 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
913 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
914 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
915 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
916 (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
|
917 |
31785 | 918 (defcustom gnus-treat-display-xface |
919 (and (or (and (fboundp 'image-type-available-p) | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
920 (image-type-available-p 'xbm) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
921 (string-match "^0x" (shell-command-to-string "uncompface"))) |
32939
c8119677d63e
Use (featurep 'xemacs) instead of the `gnus-xemacs' variable, as the
Miles Bader <miles@gnu.org>
parents:
32927
diff
changeset
|
922 (and (featurep 'xemacs) (featurep 'xface))) |
31785 | 923 'head) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
924 "Display X-Face headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
925 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
926 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
927 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
928 :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
|
929 (put 'gnus-treat-display-xface 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
930 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
931 (defcustom gnus-treat-display-smileys |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
932 (if (or (and (featurep 'xemacs) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
933 (featurep 'xpm)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
934 (and (fboundp 'image-type-available-p) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
935 (image-type-available-p 'pbm))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
936 t nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
937 "Display smileys. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
938 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
939 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
940 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
941 :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
|
942 (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
|
943 |
32939
c8119677d63e
Use (featurep 'xemacs) instead of the `gnus-xemacs' variable, as the
Miles Bader <miles@gnu.org>
parents:
32927
diff
changeset
|
944 (defcustom gnus-treat-display-picons (if (featurep 'xemacs) 'head nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
945 "Display picons. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
946 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
947 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
948 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
949 :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
|
950 (put 'gnus-treat-display-picons 'highlight t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
951 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
952 (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
|
953 "Capitalize sentence-starting words. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
954 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
955 See the manual for details." |
33397 | 956 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
957 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
958 :type gnus-article-treat-custom) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
959 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
960 (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
|
961 "Fill long lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
962 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
963 See the manual for details." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
964 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
965 :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
|
966 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
967 (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
|
968 "Play sounds. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
969 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
970 See the manual for details." |
33397 | 971 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
972 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
973 :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
|
974 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
975 (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
|
976 "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
|
977 Valid values are nil, t, `head', `last', an integer or a predicate. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
978 See the manual for details." |
33397 | 979 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
980 :group 'gnus-article-treat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
981 :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
|
982 |
17493 | 983 ;;; Internal variables |
984 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
985 (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
|
986 (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
|
987 (defvar gnus-article-emphasis-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
988 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
989 (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
|
990 (defvar gnus-treatment-function-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
991 '((gnus-treat-strip-banner gnus-article-strip-banner) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
992 (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
|
993 (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
|
994 (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
|
995 (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
|
996 (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
|
997 (gnus-treat-strip-cr gnus-article-remove-cr) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
998 (gnus-treat-emphasize gnus-article-emphasize) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
999 (gnus-treat-display-xface gnus-article-display-x-face) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1000 (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
|
1001 (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
|
1002 (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
|
1003 (gnus-treat-hide-citation gnus-article-hide-citation) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1004 (gnus-treat-hide-citation-maybe gnus-article-hide-citation-maybe) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1005 (gnus-treat-strip-list-identifiers gnus-article-hide-list-identifiers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1006 (gnus-treat-strip-pgp gnus-article-hide-pgp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1007 (gnus-treat-strip-pem gnus-article-hide-pem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1008 (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
|
1009 (gnus-treat-highlight-citation gnus-article-highlight-citation) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1010 (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
|
1011 (gnus-treat-date-ut gnus-article-date-ut) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1012 (gnus-treat-date-local gnus-article-date-local) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1013 (gnus-treat-date-lapsed gnus-article-date-lapsed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1014 (gnus-treat-date-original gnus-article-date-original) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1015 (gnus-treat-date-user-defined gnus-article-date-user) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1016 (gnus-treat-date-iso8601 gnus-article-date-iso8601) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1017 (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
|
1018 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
|
1019 (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
|
1020 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
|
1021 (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
|
1022 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
|
1023 (gnus-treat-overstrike gnus-article-treat-overstrike) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1024 (gnus-treat-buttonize-head gnus-article-add-buttons-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1025 (gnus-treat-display-smileys gnus-smiley-display) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1026 (gnus-treat-capitalize-sentences gnus-article-capitalize-sentences) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1027 (gnus-treat-display-picons gnus-article-display-picons) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1028 (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
|
1029 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1030 (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
|
1031 (defvar article-lapsed-timer nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1032 (defvar gnus-article-current-summary nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1033 |
17493 | 1034 (defvar gnus-article-mode-syntax-table |
1035 (let ((table (copy-syntax-table text-mode-syntax-table))) | |
1036 (modify-syntax-entry ?- "w" table) | |
1037 (modify-syntax-entry ?> ")" table) | |
1038 (modify-syntax-entry ?< "(" table) | |
1039 table) | |
1040 "Syntax table used in article mode buffers. | |
1041 Initialized from `text-mode-syntax-table.") | |
1042 | |
1043 (defvar gnus-save-article-buffer nil) | |
1044 | |
1045 (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
|
1046 (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
|
1047 (?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
|
1048 gnus-summary-mode-line-format-alist)) |
17493 | 1049 |
1050 (defvar gnus-number-of-articles-to-be-saved nil) | |
1051 | |
1052 (defvar gnus-inhibit-hiding nil) | |
1053 | |
1054 (defsubst gnus-article-hide-text (b e props) | |
1055 "Set text PROPS on the B to E region, extending `intangible' 1 past B." | |
1056 (add-text-properties b e props) | |
1057 (when (memq 'intangible props) | |
1058 (put-text-property | |
1059 (max (1- b) (point-min)) | |
1060 b 'intangible (cddr (memq 'intangible props))))) | |
1061 (defsubst gnus-article-unhide-text (b e) | |
1062 "Remove hidden text properties from region between B and E." | |
1063 (remove-text-properties b e gnus-hidden-properties) | |
1064 (when (memq 'intangible gnus-hidden-properties) | |
1065 (put-text-property (max (1- b) (point-min)) | |
1066 b 'intangible nil))) | |
1067 | |
1068 (defun gnus-article-hide-text-type (b e type) | |
1069 "Hide text of TYPE between B and E." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1070 (push type gnus-article-wash-types) |
17493 | 1071 (gnus-article-hide-text |
1072 b e (cons 'article-type (cons type gnus-hidden-properties)))) | |
1073 | |
1074 (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
|
1075 "Unhide text of TYPE between B and E." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1076 (setq gnus-article-wash-types |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1077 (delq type gnus-article-wash-types)) |
17493 | 1078 (remove-text-properties |
1079 b e (cons 'article-type (cons type gnus-hidden-properties))) | |
1080 (when (memq 'intangible gnus-hidden-properties) | |
1081 (put-text-property (max (1- b) (point-min)) | |
1082 b 'intangible nil))) | |
1083 | |
1084 (defun gnus-article-hide-text-of-type (type) | |
1085 "Hide text of TYPE in the current buffer." | |
1086 (save-excursion | |
1087 (let ((b (point-min)) | |
1088 (e (point-max))) | |
1089 (while (setq b (text-property-any b e 'article-type type)) | |
1090 (add-text-properties b (incf b) gnus-hidden-properties))))) | |
1091 | |
1092 (defun gnus-article-delete-text-of-type (type) | |
1093 "Delete text of TYPE in the current buffer." | |
1094 (save-excursion | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1095 (let ((b (point-min))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1096 (while (setq b (text-property-any b (point-max) 'article-type type)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1097 (delete-region |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1098 b (or (text-property-not-all b (point-max) 'article-type type) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1099 (point-max))))))) |
17493 | 1100 |
1101 (defun gnus-article-delete-invisible-text () | |
1102 "Delete all invisible text in the current buffer." | |
1103 (save-excursion | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1104 (let ((b (point-min))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1105 (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
|
1106 (delete-region |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1107 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
|
1108 (point-max))))))) |
17493 | 1109 |
1110 (defun gnus-article-text-type-exists-p (type) | |
1111 "Say whether any text of type TYPE exists in the buffer." | |
1112 (text-property-any (point-min) (point-max) 'article-type type)) | |
1113 | |
1114 (defsubst gnus-article-header-rank () | |
1115 "Give the rank of the string HEADER as given by `gnus-sorted-header-list'." | |
1116 (let ((list gnus-sorted-header-list) | |
1117 (i 0)) | |
1118 (while list | |
1119 (when (looking-at (car list)) | |
1120 (setq list nil)) | |
1121 (setq list (cdr list)) | |
1122 (incf i)) | |
1123 i)) | |
1124 | |
1125 (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
|
1126 "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
|
1127 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1128 ;; 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
|
1129 (unless gnus-inhibit-hiding |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1130 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1131 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1132 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1133 (case-fold-search t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1134 (max (1+ (length gnus-sorted-header-list))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1135 (ignored (when (not gnus-visible-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1136 (cond ((stringp gnus-ignored-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1137 gnus-ignored-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1138 ((listp gnus-ignored-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1139 (mapconcat 'identity gnus-ignored-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1140 "\\|"))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1141 (visible |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1142 (cond ((stringp gnus-visible-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1143 gnus-visible-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1144 ((and gnus-visible-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1145 (listp gnus-visible-headers)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1146 (mapconcat 'identity gnus-visible-headers "\\|")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1147 (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
|
1148 beg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1149 ;; 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
|
1150 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1151 ;; 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
|
1152 (while (looking-at "From ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1153 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1154 (unless (bobp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1155 (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
|
1156 ;; 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
|
1157 ;; 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
|
1158 ;; `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
|
1159 ;; 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
|
1160 ;; article buffer. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1161 (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
|
1162 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1163 ;; 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
|
1164 (put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1165 (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
|
1166 (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
|
1167 (and ignored |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1168 (not (looking-at ignored)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1169 (gnus-article-header-rank) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1170 (+ 2 max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1171 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1172 (message-sort-headers-1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1173 (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
|
1174 (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
|
1175 ;; We delete the unwanted headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1176 (push 'headers gnus-article-wash-types) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1177 (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
|
1178 '(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
|
1179 (delete-region beg (point-max)))))))) |
17493 | 1180 |
1181 (defun article-hide-boring-headers (&optional arg) | |
1182 "Toggle hiding of headers that aren't very interesting. | |
1183 If given a negative prefix, always show; if given a positive prefix, | |
1184 always hide." | |
1185 (interactive (gnus-article-hidden-arg)) | |
1186 (when (and (not (gnus-article-check-hidden-text 'boring-headers arg)) | |
1187 (not gnus-show-all-headers)) | |
1188 (save-excursion | |
1189 (save-restriction | |
1190 (let ((buffer-read-only nil) | |
1191 (list gnus-boring-article-headers) | |
1192 (inhibit-point-motion-hooks t) | |
1193 elem) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1194 (article-narrow-to-head) |
17493 | 1195 (while list |
1196 (setq elem (pop list)) | |
1197 (goto-char (point-min)) | |
1198 (cond | |
1199 ;; Hide empty headers. | |
1200 ((eq elem 'empty) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1201 (while (re-search-forward "^[^: \t]+:[ \t]*\n[^ \t]" nil t) |
17493 | 1202 (forward-line -1) |
1203 (gnus-article-hide-text-type | |
1204 (progn (beginning-of-line) (point)) | |
1205 (progn | |
1206 (end-of-line) | |
1207 (if (re-search-forward "^[^ \t]" nil t) | |
1208 (match-beginning 0) | |
1209 (point-max))) | |
1210 'boring-headers))) | |
1211 ;; Hide boring Newsgroups header. | |
1212 ((eq elem 'newsgroups) | |
1213 (when (equal (gnus-fetch-field "newsgroups") | |
1214 (gnus-group-real-name | |
1215 (if (boundp 'gnus-newsgroup-name) | |
1216 gnus-newsgroup-name | |
1217 ""))) | |
1218 (gnus-article-hide-header "newsgroups"))) | |
1219 ((eq elem 'followup-to) | |
1220 (when (equal (message-fetch-field "followup-to") | |
1221 (message-fetch-field "newsgroups")) | |
1222 (gnus-article-hide-header "followup-to"))) | |
1223 ((eq elem 'reply-to) | |
1224 (let ((from (message-fetch-field "from")) | |
1225 (reply-to (message-fetch-field "reply-to"))) | |
1226 (when (and | |
1227 from reply-to | |
1228 (ignore-errors | |
1229 (equal | |
1230 (nth 1 (mail-extract-address-components from)) | |
1231 (nth 1 (mail-extract-address-components reply-to))))) | |
1232 (gnus-article-hide-header "reply-to")))) | |
1233 ((eq elem 'date) | |
1234 (let ((date (message-fetch-field "date"))) | |
1235 (when (and date | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1236 (< (days-between (current-time-string) date) |
17493 | 1237 4)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1238 (gnus-article-hide-header "date")))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1239 ((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
|
1240 (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
|
1241 (cc (message-fetch-field "cc"))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1242 (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
|
1243 (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
|
1244 (when (> (length cc) 1024) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1245 (gnus-article-hide-header "cc")))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1246 ((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
|
1247 (let ((to-count 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1248 (cc-count 0)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1249 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1250 (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
|
1251 (setq to-count (1+ to-count))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1252 (when (> to-count 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1253 (while (> to-count 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1254 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1255 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1256 (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
|
1257 (forward-line -1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1258 (narrow-to-region (point) (point-max)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1259 (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
|
1260 (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
|
1261 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1262 (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
|
1263 (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
|
1264 (when (> cc-count 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1265 (while (> cc-count 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1266 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1267 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1268 (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
|
1269 (forward-line -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1270 (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
|
1271 (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
|
1272 (setq cc-count (1- cc-count))))))))))))) |
17493 | 1273 |
1274 (defun gnus-article-hide-header (header) | |
1275 (save-excursion | |
1276 (goto-char (point-min)) | |
1277 (when (re-search-forward (concat "^" header ":") nil t) | |
1278 (gnus-article-hide-text-type | |
1279 (progn (beginning-of-line) (point)) | |
1280 (progn | |
1281 (end-of-line) | |
1282 (if (re-search-forward "^[^ \t]" nil t) | |
1283 (match-beginning 0) | |
1284 (point-max))) | |
1285 'boring-headers)))) | |
1286 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1287 (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
|
1288 "Length of normalized headers.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1289 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1290 (defun article-normalize-headers () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1291 "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
|
1292 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1293 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1294 column) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1295 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1296 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1297 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1298 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1299 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1300 ((< (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
|
1301 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
|
1302 (end-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1303 (insert (make-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1304 (- 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
|
1305 ? ))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1306 ((> 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
|
1307 (gnus-put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1308 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1309 (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
|
1310 (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1311 (gnus-point-at-eol) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1312 'invisible t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1313 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1314 ;; Do nothing. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1315 )) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1316 (forward-line 1)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1317 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1318 (defun article-treat-dumbquotes () |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1319 "Translate M******** sm*rtq**t*s into proper text. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1320 Note that this function guesses whether a character is a sm*rtq**t* or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1321 not, so it should only be used interactively." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1322 (interactive) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1323 (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
|
1324 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1325 (defun article-translate-characters (from to) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1326 "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
|
1327 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
|
1328 characters to translate to." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1329 (save-excursion |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1330 (when (article-goto-body) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1331 (let ((buffer-read-only nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1332 (x (make-string 225 ?x)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1333 (i -1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1334 (while (< (incf i) (length x)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1335 (aset x i i)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1336 (setq i 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1337 (while (< i (length from)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1338 (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
|
1339 (incf i)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1340 (translate-region (point) (point-max) x))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1341 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1342 (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
|
1343 "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
|
1344 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
|
1345 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1346 (when (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1347 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1348 elem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1349 (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
|
1350 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1351 (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
|
1352 (replace-match (cadr elem))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1353 |
17493 | 1354 (defun article-treat-overstrike () |
1355 "Translate overstrikes into bold text." | |
1356 (interactive) | |
1357 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1358 (when (article-goto-body) |
17493 | 1359 (let ((buffer-read-only nil)) |
1360 (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
|
1361 (let ((next (char-after)) |
17493 | 1362 (previous (char-after (- (point) 2)))) |
1363 ;; We do the boldification/underlining by hiding the | |
1364 ;; overstrikes and putting the proper text property | |
1365 ;; on the letters. | |
1366 (cond | |
1367 ((eq next previous) | |
1368 (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike) | |
1369 (put-text-property (point) (1+ (point)) 'face 'bold)) | |
1370 ((eq next ?_) | |
1371 (gnus-article-hide-text-type | |
1372 (1- (point)) (1+ (point)) 'overstrike) | |
1373 (put-text-property | |
1374 (- (point) 2) (1- (point)) 'face 'underline)) | |
1375 ((eq previous ?_) | |
1376 (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike) | |
1377 (put-text-property | |
1378 (point) (1+ (point)) 'face 'underline))))))))) | |
1379 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1380 (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
|
1381 "Fill lines that are wider than the window width." |
17493 | 1382 (interactive) |
1383 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1384 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1385 (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
|
1386 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1387 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1388 (let ((adaptive-fill-mode nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1389 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1390 (end-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1391 (when (>= (current-column) (min fill-column width)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1392 (narrow-to-region (point) (gnus-point-at-bol)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1393 (fill-paragraph nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1394 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1395 (widen)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1396 (forward-line 1))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1397 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1398 (defun article-capitalize-sentences () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1399 "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
|
1400 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1401 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1402 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1403 (paragraph-start "^[\n\^L]")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1404 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1405 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1406 (capitalize-word 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1407 (forward-sentence))))) |
17493 | 1408 |
1409 (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
|
1410 "Remove trailing CRs and then translate remaining CRs into LFs." |
17493 | 1411 (interactive) |
1412 (save-excursion | |
1413 (let ((buffer-read-only nil)) | |
1414 (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
|
1415 (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
|
1416 (replace-match "" t t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1417 (goto-char (point-min)) |
17493 | 1418 (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
|
1419 (replace-match "\n" t t))))) |
17493 | 1420 |
1421 (defun article-remove-trailing-blank-lines () | |
1422 "Remove all trailing blank lines from the article." | |
1423 (interactive) | |
1424 (save-excursion | |
1425 (let ((buffer-read-only nil)) | |
1426 (goto-char (point-max)) | |
1427 (delete-region | |
1428 (point) | |
1429 (progn | |
1430 (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
|
1431 (looking-at "^[ \t]*$") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1432 (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
|
1433 (point) (gnus-point-at-eol)))) |
17493 | 1434 (forward-line -1)) |
1435 (forward-line 1) | |
1436 (point)))))) | |
1437 | |
1438 (defun article-display-x-face (&optional force) | |
1439 "Look for an X-Face header and display it if present." | |
1440 (interactive (list 'force)) | |
1441 (save-excursion | |
1442 ;; Delete the old process, if any. | |
1443 (when (process-status "article-x-face") | |
1444 (delete-process "article-x-face")) | |
1445 (let ((inhibit-point-motion-hooks t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1446 (case-fold-search t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1447 from last) |
17493 | 1448 (save-restriction |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1449 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1450 (goto-char (point-min)) |
17493 | 1451 (setq from (message-fetch-field "from")) |
1452 (goto-char (point-min)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1453 (while (and gnus-article-x-face-command |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1454 (not last) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1455 (or force |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1456 ;; Check whether this face is censored. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1457 (not gnus-article-x-face-too-ugly) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1458 (and gnus-article-x-face-too-ugly from |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1459 (not (string-match gnus-article-x-face-too-ugly |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1460 from)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1461 ;; Has to be present. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1462 (re-search-forward "^X-Face: " nil t)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1463 ;; This used to try to do multiple faces (`while' instead of |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1464 ;; `when' above), but (a) sending multiple EOFs to xv doesn't |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1465 ;; work (b) it can crash some versions of Emacs (c) are |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1466 ;; multiple faces really something to encourage? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1467 (when (stringp gnus-article-x-face-command) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1468 (setq last t)) |
17493 | 1469 ;; We now have the area of the buffer where the X-Face is stored. |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1470 (save-excursion |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1471 (let ((beg (point)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1472 (end (1- (re-search-forward "^\\($\\|[^ \t]\\)" nil t)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1473 ;; We display the face. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1474 (if (symbolp gnus-article-x-face-command) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1475 ;; The command is a lisp function, so we call it. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1476 (if (gnus-functionp gnus-article-x-face-command) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1477 (funcall gnus-article-x-face-command beg end) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1478 (error "%s is not a function" gnus-article-x-face-command)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1479 ;; The command is a string, so we interpret the command |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1480 ;; as a, well, command, and fork it off. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1481 (let ((process-connection-type nil)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1482 (process-kill-without-query |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1483 (start-process |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1484 "article-x-face" nil shell-file-name shell-command-switch |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1485 gnus-article-x-face-command)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1486 (process-send-region "article-x-face" beg end) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1487 (process-send-eof "article-x-face")))))))))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1488 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1489 (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
|
1490 "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
|
1491 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1492 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1493 (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
|
1494 (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
|
1495 buffer-read-only |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1496 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1497 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1498 (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
|
1499 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1500 (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
|
1501 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1502 (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
|
1503 "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
|
1504 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
|
1505 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1506 (let ((inhibit-point-motion-hooks t) (case-fold-search t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1507 buffer-read-only |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1508 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1509 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1510 (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
|
1511 (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
|
1512 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1513 gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1514 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
|
1515 (save-excursion |
17493 | 1516 (save-restriction |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1517 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1518 (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
|
1519 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
|
1520 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
|
1521 (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
|
1522 charset (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1523 (prompt |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1524 (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
|
1525 (ctl |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1526 (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
|
1527 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
|
1528 (when cte |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1529 (setq cte (mail-header-strip cte))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1530 (if (and ctl (not (string-match "/" (car ctl)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1531 (setq ctl nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1532 (goto-char (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1533 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1534 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1535 (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
|
1536 (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
|
1537 (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
|
1538 ;; 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
|
1539 (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
|
1540 (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
|
1541 (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
|
1542 (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
|
1543 (mm-decode-body |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1544 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
|
1545 (gnus-strip-whitespace cte)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1546 (car ctl))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1547 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1548 (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
|
1549 "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
|
1550 (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
|
1551 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1552 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1553 (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
|
1554 (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
|
1555 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1556 gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1557 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1558 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1559 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1560 (funcall gnus-decode-header-function (point-min) (point-max))))) |
17493 | 1561 |
1562 (defun article-de-quoted-unreadable (&optional force) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1563 "Translate a quoted-printable-encoded article. |
17493 | 1564 If FORCE, decode the article whether it is marked as quoted-printable |
1565 or not." | |
1566 (interactive (list 'force)) | |
1567 (save-excursion | |
31785 | 1568 (let ((buffer-read-only nil) type charset) |
1569 (if (gnus-buffer-live-p gnus-original-article-buffer) | |
1570 (with-current-buffer gnus-original-article-buffer | |
1571 (setq type | |
1572 (gnus-fetch-field "content-transfer-encoding")) | |
1573 (let* ((ct (gnus-fetch-field "content-type")) | |
1574 (ctl (and ct | |
1575 (ignore-errors | |
1576 (mail-header-parse-content-type ct))))) | |
1577 (setq charset (and ctl | |
1578 (mail-content-type-get ctl 'charset))) | |
1579 (if (stringp charset) | |
1580 (setq charset (intern (downcase charset))))))) | |
1581 (unless charset | |
1582 (setq charset gnus-newsgroup-charset)) | |
17493 | 1583 (when (or force |
32210 | 1584 (and type (let ((case-fold-search t)) |
1585 (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
|
1586 (article-goto-body) |
32210 | 1587 (quoted-printable-decode-region |
1588 (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
|
1589 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1590 (defun article-de-base64-unreadable (&optional force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1591 "Translate a base64 article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1592 If FORCE, decode the article whether it is marked as base64 not." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1593 (interactive (list 'force)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1594 (save-excursion |
31785 | 1595 (let ((buffer-read-only nil) type charset) |
1596 (if (gnus-buffer-live-p gnus-original-article-buffer) | |
1597 (with-current-buffer gnus-original-article-buffer | |
1598 (setq type | |
1599 (gnus-fetch-field "content-transfer-encoding")) | |
1600 (let* ((ct (gnus-fetch-field "content-type")) | |
1601 (ctl (and ct | |
1602 (ignore-errors | |
1603 (mail-header-parse-content-type ct))))) | |
1604 (setq charset (and ctl | |
1605 (mail-content-type-get ctl 'charset))) | |
1606 (if (stringp charset) | |
1607 (setq charset (intern (downcase charset))))))) | |
1608 (unless charset | |
1609 (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
|
1610 (when (or force |
32210 | 1611 (and type (let ((case-fold-search t)) |
1612 (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
|
1613 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1614 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1615 (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
|
1616 (base64-decode-region (point-min) (point-max)) |
32210 | 1617 (mm-decode-coding-region |
1618 (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
|
1619 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1620 (eval-when-compile |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1621 (require 'rfc1843)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1622 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1623 (defun article-decode-HZ () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1624 "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
|
1625 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1626 (require 'rfc1843) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1627 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1628 (let ((buffer-read-only nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1629 (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
|
1630 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1631 (defun article-wash-html () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1632 "Format an html article." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1633 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1634 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1635 (let ((buffer-read-only nil) |
31785 | 1636 charset) |
1637 (if (gnus-buffer-live-p gnus-original-article-buffer) | |
1638 (with-current-buffer gnus-original-article-buffer | |
1639 (let* ((ct (gnus-fetch-field "content-type")) | |
1640 (ctl (and ct | |
1641 (ignore-errors | |
1642 (mail-header-parse-content-type ct))))) | |
1643 (setq charset (and ctl | |
1644 (mail-content-type-get ctl 'charset))) | |
1645 (if (stringp charset) | |
1646 (setq charset (intern (downcase charset))))))) | |
1647 (unless charset | |
1648 (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
|
1649 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1650 (save-window-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1651 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1652 (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
|
1653 (mm-setup-w3) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1654 (let ((w3-strict-width (window-width)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1655 (url-standalone-mode t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1656 (condition-case var |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1657 (w3-region (point-min) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1658 (error)))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1659 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1660 (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
|
1661 "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
|
1662 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
|
1663 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1664 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1665 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1666 (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
|
1667 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1668 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1669 (let ((regexp (if (stringp gnus-list-identifiers) gnus-list-identifiers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1670 (mapconcat 'identity gnus-list-identifiers " *\\|")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1671 (when regexp |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1672 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1673 (when (re-search-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1674 (concat "^Subject: +\\(\\(\\(Re: +\\)?\\(" regexp |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1675 " *\\)\\)+\\(Re: +\\)?\\)") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1676 nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1677 (let ((s (or (match-string 3) (match-string 5)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1678 (delete-region (match-beginning 1) (match-end 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1679 (when s |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1680 (goto-char (match-beginning 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1681 (insert s)))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1682 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1683 (defun article-hide-pgp () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1684 "Remove any PGP headers and signatures in the current article." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1685 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1686 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1687 (save-restriction |
17493 | 1688 (let ((inhibit-point-motion-hooks t) |
1689 buffer-read-only beg end) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1690 (article-goto-body) |
17493 | 1691 ;; Hide the "header". |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1692 (when (re-search-forward "^-----BEGIN PGP SIGNED MESSAGE-----\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1693 (push 'pgp gnus-article-wash-types) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1694 (delete-region (match-beginning 0) (match-end 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1695 ;; Remove armor headers (rfc2440 6.2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1696 (delete-region (point) (or (re-search-forward "^[ \t]*\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1697 (point))) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1698 (setq beg (point)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1699 ;; Hide the actual signature. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1700 (and (search-forward "\n-----BEGIN PGP SIGNATURE-----\n" nil t) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1701 (setq end (1+ (match-beginning 0))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1702 (delete-region |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1703 end |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1704 (if (search-forward "\n-----END PGP SIGNATURE-----\n" nil t) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1705 (match-end 0) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1706 ;; Perhaps we shouldn't hide to the end of the buffer |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1707 ;; if there is no end to the signature? |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1708 (point-max)))) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1709 ;; Hide "- " PGP quotation markers. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1710 (when (and beg end) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1711 (narrow-to-region beg end) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1712 (goto-char (point-min)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1713 (while (re-search-forward "^- " nil t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1714 (delete-region |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1715 (match-beginning 0) (match-end 0))) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
1716 (widen)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1717 (gnus-run-hooks 'gnus-article-hide-pgp-hook)))))) |
17493 | 1718 |
1719 (defun article-hide-pem (&optional arg) | |
1720 "Toggle hiding of any PEM headers and signatures in the current article. | |
1721 If given a negative prefix, always show; if given a positive prefix, | |
1722 always hide." | |
1723 (interactive (gnus-article-hidden-arg)) | |
1724 (unless (gnus-article-check-hidden-text 'pem arg) | |
1725 (save-excursion | |
1726 (let (buffer-read-only end) | |
1727 (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
|
1728 ;; 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
|
1729 (when (and (search-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1730 "\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
|
1731 nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1732 (setq end (1+ (match-beginning 0)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1733 (push 'pem gnus-article-wash-types) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1734 (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
|
1735 end |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1736 (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
|
1737 (match-end 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1738 (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1739 'pem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1740 ;; 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
|
1741 (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
|
1742 nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1743 (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
|
1744 (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
|
1745 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1746 (defun article-strip-banner () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1747 "Strip the banner specified by the `banner' group parameter." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1748 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1749 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1750 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1751 (let ((inhibit-point-motion-hooks t) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1752 (banner (gnus-group-find-parameter gnus-newsgroup-name 'banner)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1753 (gnus-signature-limit nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1754 buffer-read-only beg end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1755 (when banner |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1756 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1757 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1758 ((eq banner 'signature) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1759 (when (gnus-article-narrow-to-signature) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1760 (widen) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1761 (forward-line -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1762 (delete-region (point) (point-max)))) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1763 ((symbolp banner) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1764 (if (setq banner (cdr (assq banner gnus-article-banner-alist))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1765 (while (re-search-forward banner nil t) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
1766 (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
|
1767 ((stringp banner) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1768 (while (re-search-forward banner nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1769 (delete-region (match-beginning 0) (match-end 0)))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1770 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1771 (defun article-babel () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1772 "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
|
1773 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1774 (require 'babel) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1775 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1776 (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
|
1777 (when (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1778 (let* ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1779 (start (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1780 (end (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1781 (orig (buffer-substring start end)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1782 (trans (babel-as-string orig))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1783 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1784 (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
|
1785 (delete-region start end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1786 (insert trans)))))) |
17493 | 1787 |
1788 (defun article-hide-signature (&optional arg) | |
1789 "Hide the signature in the current article. | |
1790 If given a negative prefix, always show; if given a positive prefix, | |
1791 always hide." | |
1792 (interactive (gnus-article-hidden-arg)) | |
1793 (unless (gnus-article-check-hidden-text 'signature arg) | |
1794 (save-excursion | |
1795 (save-restriction | |
1796 (let ((buffer-read-only nil)) | |
1797 (when (gnus-article-narrow-to-signature) | |
1798 (gnus-article-hide-text-type | |
1799 (point-min) (point-max) 'signature))))))) | |
1800 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1801 (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
|
1802 "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
|
1803 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1804 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1805 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1806 (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
|
1807 (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
|
1808 (gnus-delete-line))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1809 |
17493 | 1810 (defun article-strip-leading-blank-lines () |
1811 "Remove all blank lines from the beginning of the article." | |
1812 (interactive) | |
1813 (save-excursion | |
1814 (let ((inhibit-point-motion-hooks t) | |
1815 buffer-read-only) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1816 (when (article-goto-body) |
17493 | 1817 (while (and (not (eobp)) |
1818 (looking-at "[ \t]*$")) | |
1819 (gnus-delete-line)))))) | |
1820 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1821 (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
|
1822 "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
|
1823 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
|
1824 (narrow-to-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1825 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1826 (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
|
1827 (1- (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1828 (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1829 (goto-char (point-min))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1830 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1831 (defun article-goto-body () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1832 "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
|
1833 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1834 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1835 ;; 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
|
1836 ;; MIME body parts. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1837 (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
|
1838 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1839 ((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
|
1840 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1841 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1842 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1843 nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1844 |
17493 | 1845 (defun article-strip-multiple-blank-lines () |
1846 "Replace consecutive blank lines with one empty line." | |
1847 (interactive) | |
1848 (save-excursion | |
1849 (let ((inhibit-point-motion-hooks t) | |
1850 buffer-read-only) | |
1851 ;; 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
|
1852 (article-goto-body) |
17493 | 1853 (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
|
1854 (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
|
1855 (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
|
1856 (replace-match "" nil t))) |
17493 | 1857 ;; 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
|
1858 (article-goto-body) |
17493 | 1859 (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
|
1860 (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
|
1861 (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
|
1862 (replace-match "\n\n" t t)))))) |
17493 | 1863 |
1864 (defun article-strip-leading-space () | |
1865 "Remove all white space from the beginning of the lines in the article." | |
1866 (interactive) | |
1867 (save-excursion | |
1868 (let ((inhibit-point-motion-hooks t) | |
1869 buffer-read-only) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1870 (article-goto-body) |
17493 | 1871 (while (re-search-forward "^[ \t]+" nil t) |
1872 (replace-match "" t t))))) | |
1873 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1874 (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
|
1875 "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
|
1876 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1877 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1878 (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
|
1879 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1880 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1881 (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
|
1882 (replace-match "" t t))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1883 |
17493 | 1884 (defun article-strip-blank-lines () |
1885 "Strip leading, trailing and multiple blank lines." | |
1886 (interactive) | |
1887 (article-strip-leading-blank-lines) | |
1888 (article-remove-trailing-blank-lines) | |
1889 (article-strip-multiple-blank-lines)) | |
1890 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1891 (defun article-strip-all-blank-lines () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1892 "Strip all blank lines." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1893 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1894 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1895 (let ((inhibit-point-motion-hooks t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1896 buffer-read-only) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1897 (article-goto-body) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1898 (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
|
1899 (replace-match "" t t))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1900 |
17493 | 1901 (defun gnus-article-narrow-to-signature () |
1902 "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
|
1903 (let ((inhibit-point-motion-hooks t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1904 (when (gnus-article-search-signature) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1905 (forward-line 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1906 ;; 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
|
1907 ;; to be a signature. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1908 (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
|
1909 (list gnus-signature-limit))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1910 limit limited) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1911 (while (setq limit (pop limits)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1912 (if (or (and (integerp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1913 (< (- (point-max) (point)) limit)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1914 (and (floatp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1915 (< (count-lines (point) (point-max)) limit)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1916 (and (gnus-functionp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1917 (funcall limit)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1918 (and (stringp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1919 (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
|
1920 () ; This limit did not succeed. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1921 (setq limited t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1922 limits nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1923 (unless limited |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1924 (narrow-to-region (point) (point-max)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
1925 t))))) |
17493 | 1926 |
1927 (defun gnus-article-search-signature () | |
1928 "Search the current buffer for the signature separator. | |
1929 Put point at the beginning of the signature separator." | |
1930 (let ((cur (point))) | |
1931 (goto-char (point-max)) | |
1932 (if (if (stringp gnus-signature-separator) | |
1933 (re-search-backward gnus-signature-separator nil t) | |
1934 (let ((seps gnus-signature-separator)) | |
1935 (while (and seps | |
1936 (not (re-search-backward (car seps) nil t))) | |
1937 (pop seps)) | |
1938 seps)) | |
1939 t | |
1940 (goto-char cur) | |
1941 nil))) | |
1942 | |
1943 (defun gnus-article-hidden-arg () | |
1944 "Return the current prefix arg as a number, or 0 if no prefix." | |
1945 (list (if current-prefix-arg | |
1946 (prefix-numeric-value current-prefix-arg) | |
1947 0))) | |
1948 | |
1949 (defun gnus-article-check-hidden-text (type arg) | |
1950 "Return nil if hiding is necessary. | |
1951 Arg can be nil or a number. Nil and positive means hide, negative | |
1952 means show, 0 means toggle." | |
1953 (save-excursion | |
1954 (save-restriction | |
1955 (let ((hide (gnus-article-hidden-text-p type))) | |
1956 (cond | |
1957 ((or (null arg) | |
1958 (> arg 0)) | |
1959 nil) | |
1960 ((< arg 0) | |
1961 (gnus-article-show-hidden-text type)) | |
1962 (t | |
1963 (if (eq hide 'hidden) | |
1964 (gnus-article-show-hidden-text type) | |
1965 nil))))))) | |
1966 | |
1967 (defun gnus-article-hidden-text-p (type) | |
1968 "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
|
1969 (let ((pos (text-property-any (point-min) (point-max) 'article-type type))) |
17493 | 1970 (while (and pos |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1971 (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
|
1972 (not (get-text-property pos 'dummy-invisible))) |
17493 | 1973 (setq pos |
1974 (text-property-any (1+ pos) (point-max) 'article-type type))) | |
1975 (if pos | |
1976 'hidden | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
1977 nil))) |
17493 | 1978 |
1979 (defun gnus-article-show-hidden-text (type &optional hide) | |
1980 "Show all hidden text of type TYPE. | |
1981 If HIDE, hide the text instead." | |
1982 (save-excursion | |
1983 (let ((buffer-read-only nil) | |
1984 (inhibit-point-motion-hooks t) | |
1985 (end (point-min)) | |
1986 beg) | |
1987 (while (setq beg (text-property-any end (point-max) 'article-type type)) | |
1988 (goto-char beg) | |
1989 (setq end (or | |
1990 (text-property-not-all beg (point-max) 'article-type type) | |
1991 (point-max))) | |
1992 (if hide | |
1993 (gnus-article-hide-text beg end gnus-hidden-properties) | |
1994 (gnus-article-unhide-text beg end)) | |
1995 (goto-char end)) | |
1996 t))) | |
1997 | |
1998 (defconst article-time-units | |
1999 `((year . ,(* 365.25 24 60 60)) | |
2000 (week . ,(* 7 24 60 60)) | |
2001 (day . ,(* 24 60 60)) | |
2002 (hour . ,(* 60 60)) | |
2003 (minute . 60) | |
2004 (second . 1)) | |
2005 "Mapping from time units to seconds.") | |
2006 | |
2007 (defun article-date-ut (&optional type highlight header) | |
2008 "Convert DATE date to universal time in the current article. | |
2009 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
|
2010 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
|
2011 `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
|
2012 should replace the \"Date:\" one, or should be added below it." |
17493 | 2013 (interactive (list 'ut t)) |
2014 (let* ((header (or header | |
2015 (message-fetch-field "date") | |
2016 "")) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2017 (tdate-regexp "^Date:[ \t]\\|^X-Sent:[ \t]") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2018 (date-regexp |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2019 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2020 ((not gnus-article-date-lapsed-new-header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2021 tdate-regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2022 ((eq type 'lapsed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2023 "^X-Sent:[ \t]") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2024 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2025 "^Date:[ \t]"))) |
17493 | 2026 (date (if (vectorp header) (mail-header-date header) |
2027 header)) | |
2028 (inhibit-point-motion-hooks t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2029 pos |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2030 bface eface) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2031 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2032 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2033 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2034 (when (re-search-forward tdate-regexp nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2035 (setq bface (get-text-property (gnus-point-at-bol) 'face) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2036 date (or (get-text-property (gnus-point-at-bol) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2037 'original-date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2038 date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2039 eface (get-text-property (1- (gnus-point-at-eol)) 'face)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2040 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2041 (when (and date (not (string= date ""))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2042 (goto-char (point-min)) |
17493 | 2043 (let ((buffer-read-only nil)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2044 ;; Delete any old Date headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2045 (while (re-search-forward date-regexp nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2046 (if pos |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2047 (delete-region (progn (beginning-of-line) (point)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2048 (progn (forward-line 1) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2049 (delete-region (progn (beginning-of-line) (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2050 (progn (end-of-line) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2051 (setq pos (point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2052 (when (and (not pos) (re-search-forward tdate-regexp nil t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2053 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2054 (if pos (goto-char pos)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2055 (insert (article-make-date-line date (or type 'ut))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2056 (when (not pos) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2057 (insert "\n") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2058 (forward-line -1)) |
17493 | 2059 ;; Do highlighting. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2060 (beginning-of-line) |
17493 | 2061 (when (looking-at "\\([^:]+\\): *\\(.*\\)$") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2062 (put-text-property (match-beginning 1) (1+ (match-end 1)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2063 'original-date date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2064 (put-text-property (match-beginning 1) (1+ (match-end 1)) |
17493 | 2065 'face bface) |
2066 (put-text-property (match-beginning 2) (match-end 2) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2067 'face eface)))))))) |
17493 | 2068 |
2069 (defun article-make-date-line (date type) | |
2070 "Return a DATE line of TYPE." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2071 (let ((time (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2072 (date-to-time date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2073 (error '(0 0))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2074 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2075 ;; Convert to the local timezone. We have to slap a |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2076 ;; `condition-case' round the calls to the timezone |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2077 ;; functions since they aren't particularly resistant to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2078 ;; buggy dates. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2079 ((eq type 'local) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2080 (let ((tz (car (current-time-zone time)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2081 (format "Date: %s %s%02d%02d" (current-time-string time) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2082 (if (> tz 0) "+" "-") (/ (abs tz) 3600) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2083 (/ (% (abs tz) 3600) 60)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2084 ;; Convert to Universal Time. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2085 ((eq type 'ut) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2086 (concat "Date: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2087 (current-time-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2088 (let* ((e (parse-time-string date)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2089 (tm (apply 'encode-time e)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2090 (ms (car tm)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2091 (ls (- (cadr tm) (car (current-time-zone time))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2092 (cond ((< ls 0) (list (1- ms) (+ ls 65536))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2093 ((> ls 65535) (list (1+ ms) (- ls 65536))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2094 (t (list ms ls))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2095 " UT")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2096 ;; Get the original date from the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2097 ((eq type 'original) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2098 (concat "Date: " (if (string-match "\n+$" date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2099 (substring date 0 (match-beginning 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2100 date))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2101 ;; Let the user define the format. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2102 ((eq type 'user) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2103 (if (gnus-functionp gnus-article-time-format) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2104 (funcall gnus-article-time-format time) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2105 (concat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2106 "Date: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2107 (format-time-string gnus-article-time-format time)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2108 ;; ISO 8601. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2109 ((eq type 'iso8601) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2110 (let ((tz (car (current-time-zone time)))) |
17493 | 2111 (concat |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2112 "Date: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2113 (format-time-string "%Y%m%dT%H%M%S" time) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2114 (format "%s%02d%02d" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2115 (if (> tz 0) "+" "-") (/ (abs tz) 3600) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2116 (/ (% (abs tz) 3600) 60))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2117 ;; Do an X-Sent lapsed format. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2118 ((eq type 'lapsed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2119 ;; If the date is seriously mangled, the timezone functions are |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2120 ;; liable to bug out, so we ignore all errors. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2121 (let* ((now (current-time)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2122 (real-time (subtract-time now time)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2123 (real-sec (and real-time |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2124 (+ (* (float (car real-time)) 65536) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2125 (cadr real-time)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2126 (sec (and real-time (abs real-sec))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2127 num prev) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2128 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2129 ((null real-time) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2130 "X-Sent: Unknown") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2131 ((zerop sec) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2132 "X-Sent: Now") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2133 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2134 (concat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2135 "X-Sent: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2136 ;; This is a bit convoluted, but basically we go |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2137 ;; through the time units for years, weeks, etc, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2138 ;; and divide things to see whether that results |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2139 ;; in positive answers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2140 (mapconcat |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2141 (lambda (unit) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2142 (if (zerop (setq num (ffloor (/ sec (cdr unit))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2143 ;; The (remaining) seconds are too few to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2144 ;; be divided into this time unit. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2145 "" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2146 ;; It's big enough, so we output it. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2147 (setq sec (- sec (* num (cdr unit)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2148 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2149 (concat (if prev ", " "") (int-to-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2150 (floor num)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2151 " " (symbol-name (car unit)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2152 (if (> num 1) "s" "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2153 (setq prev t)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2154 article-time-units "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2155 ;; If dates are odd, then it might appear like the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2156 ;; article was sent in the future. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2157 (if (> real-sec 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2158 " ago" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2159 " in the future")))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2160 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2161 (error "Unknown conversion type: %s" type))))) |
17493 | 2162 |
2163 (defun article-date-local (&optional highlight) | |
2164 "Convert the current article date to the local timezone." | |
2165 (interactive (list t)) | |
2166 (article-date-ut 'local highlight)) | |
2167 | |
2168 (defun article-date-original (&optional highlight) | |
2169 "Convert the current article date to what it was originally. | |
2170 This is only useful if you have used some other date conversion | |
2171 function and want to see what the date was before converting." | |
2172 (interactive (list t)) | |
2173 (article-date-ut 'original highlight)) | |
2174 | |
2175 (defun article-date-lapsed (&optional highlight) | |
2176 "Convert the current article date to time lapsed since it was sent." | |
2177 (interactive (list t)) | |
2178 (article-date-ut 'lapsed highlight)) | |
2179 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2180 (defun article-update-date-lapsed () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2181 "Function to be run from a timer to update the lapsed time line." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2182 (let (deactivate-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2183 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2184 (ignore-errors |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2185 (walk-windows |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2186 (lambda (w) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2187 (set-buffer (window-buffer w)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2188 (when (eq major-mode 'gnus-article-mode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2189 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2190 (when (re-search-forward "^X-Sent:" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2191 (article-date-lapsed t)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2192 nil 'visible))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2193 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2194 (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
|
2195 "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
|
2196 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
|
2197 is to run." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2198 (interactive "p") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2199 (unless n |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2200 (setq n 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2201 (gnus-stop-date-timer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2202 (setq article-lapsed-timer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2203 (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
|
2204 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2205 (defun gnus-stop-date-timer () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2206 "Stop the X-Sent timer." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2207 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2208 (when article-lapsed-timer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2209 (nnheader-cancel-timer article-lapsed-timer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2210 (setq article-lapsed-timer nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2211 |
17493 | 2212 (defun article-date-user (&optional highlight) |
2213 "Convert the current article date to the user-defined format. | |
2214 This format is defined by the `gnus-article-time-format' variable." | |
2215 (interactive (list t)) | |
2216 (article-date-ut 'user highlight)) | |
2217 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2218 (defun article-date-iso8601 (&optional highlight) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2219 "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
|
2220 (interactive (list t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2221 (article-date-ut 'iso8601 highlight)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2222 |
17493 | 2223 (defun article-show-all () |
2224 "Show all hidden text in the article buffer." | |
2225 (interactive) | |
2226 (save-excursion | |
2227 (let ((buffer-read-only nil)) | |
2228 (gnus-article-unhide-text (point-min) (point-max))))) | |
2229 | |
2230 (defun article-emphasize (&optional arg) | |
2231 "Emphasize text according to `gnus-emphasis-alist'." | |
2232 (interactive (gnus-article-hidden-arg)) | |
2233 (unless (gnus-article-check-hidden-text 'emphasis arg) | |
2234 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2235 (let ((alist (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2236 (condition-case nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2237 (with-current-buffer gnus-summary-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2238 gnus-article-emphasis-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2239 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2240 gnus-emphasis-alist)) |
17493 | 2241 (buffer-read-only nil) |
2242 (props (append '(article-type emphasis) | |
2243 gnus-hidden-properties)) | |
2244 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
|
2245 (article-goto-body) |
17493 | 2246 (setq beg (point)) |
2247 (while (setq elem (pop alist)) | |
2248 (goto-char beg) | |
2249 (setq regexp (car elem) | |
2250 invisible (nth 1 elem) | |
2251 visible (nth 2 elem) | |
2252 face (nth 3 elem)) | |
2253 (while (re-search-forward regexp nil t) | |
2254 (when (and (match-beginning visible) (match-beginning invisible)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2255 (push 'emphasis gnus-article-wash-types) |
17493 | 2256 (gnus-article-hide-text |
2257 (match-beginning invisible) (match-end invisible) props) | |
2258 (gnus-article-unhide-text-type | |
2259 (match-beginning visible) (match-end visible) 'emphasis) | |
2260 (gnus-put-text-property-excluding-newlines | |
2261 (match-beginning visible) (match-end visible) 'face face) | |
2262 (goto-char (match-end invisible))))))))) | |
2263 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2264 (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
|
2265 "Setup newsgroup emphasis alist." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2266 (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
|
2267 (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
|
2268 (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
|
2269 (make-local-variable 'gnus-article-emphasis-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2270 (setq gnus-article-emphasis-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2271 (nconc |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2272 (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
|
2273 (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
|
2274 (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
|
2275 (setq alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2276 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
|
2277 highlight) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2278 (copy-sequence highlight-words) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2279 (if gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2280 (copy-sequence (gnus-group-find-parameter |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2281 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
|
2282 gnus-emphasis-alist))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2283 |
17493 | 2284 (defvar gnus-summary-article-menu) |
2285 (defvar gnus-summary-post-menu) | |
2286 | |
2287 ;;; Saving functions. | |
2288 | |
2289 (defun gnus-article-save (save-buffer file &optional num) | |
2290 "Save the currently selected article." | |
2291 (unless gnus-save-all-headers | |
2292 ;; Remove headers according to `gnus-saved-headers'. | |
2293 (let ((gnus-visible-headers | |
2294 (or gnus-saved-headers gnus-visible-headers)) | |
2295 (gnus-article-buffer save-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2296 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2297 (set-buffer save-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2298 (article-hide-headers 1 t)))) |
17493 | 2299 (save-window-excursion |
2300 (if (not gnus-default-article-saver) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2301 (error "No default saver is defined") |
17493 | 2302 ;; !!! 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
|
2303 ;; `gnus-save-article-buffer' (or so they think), but we |
17493 | 2304 ;; bind that variable to our save-buffer. |
2305 (set-buffer gnus-article-buffer) | |
2306 (let* ((gnus-save-article-buffer save-buffer) | |
2307 (filename | |
2308 (cond | |
2309 ((not gnus-prompt-before-saving) 'default) | |
2310 ((eq gnus-prompt-before-saving 'always) nil) | |
2311 (t file))) | |
2312 (gnus-number-of-articles-to-be-saved | |
2313 (when (eq gnus-prompt-before-saving t) | |
2314 num))) ; Magic | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2315 (set-buffer gnus-article-current-summary) |
17493 | 2316 (funcall gnus-default-article-saver filename))))) |
2317 | |
2318 (defun gnus-read-save-file-name (prompt &optional filename | |
2319 function group headers variable) | |
2320 (let ((default-name | |
2321 (funcall function group headers (symbol-value variable))) | |
2322 result) | |
33077 | 2323 (setq result |
2324 (expand-file-name | |
2325 (cond | |
2326 ((eq filename 'default) | |
2327 default-name) | |
2328 ((eq filename t) | |
2329 default-name) | |
2330 (filename filename) | |
2331 (t | |
2332 (let* ((split-name (gnus-get-split-value gnus-split-methods)) | |
2333 (prompt | |
2334 (format prompt | |
2335 (if (and gnus-number-of-articles-to-be-saved | |
2336 (> gnus-number-of-articles-to-be-saved 1)) | |
2337 (format "these %d articles" | |
2338 gnus-number-of-articles-to-be-saved) | |
2339 "this article"))) | |
2340 (file | |
2341 ;; Let the split methods have their say. | |
2342 (cond | |
2343 ;; No split name was found. | |
2344 ((null split-name) | |
2345 (read-file-name | |
2346 (concat prompt " (default " | |
2347 (file-name-nondirectory default-name) ") ") | |
2348 (file-name-directory default-name) | |
2349 default-name)) | |
2350 ;; A single group name is returned. | |
2351 ((stringp split-name) | |
2352 (setq default-name | |
2353 (funcall function split-name headers | |
2354 (symbol-value variable))) | |
2355 (read-file-name | |
2356 (concat prompt " (default " | |
2357 (file-name-nondirectory default-name) ") ") | |
2358 (file-name-directory default-name) | |
2359 default-name)) | |
2360 ;; A single split name was found | |
2361 ((= 1 (length split-name)) | |
2362 (let* ((name (expand-file-name | |
2363 (car split-name) gnus-article-save-directory)) | |
2364 (dir (cond ((file-directory-p name) | |
2365 (file-name-as-directory name)) | |
2366 ((file-exists-p name) name) | |
2367 (t gnus-article-save-directory)))) | |
2368 (read-file-name | |
2369 (concat prompt " (default " name ") ") | |
2370 dir name))) | |
2371 ;; A list of splits was found. | |
2372 (t | |
2373 (setq split-name (nreverse split-name)) | |
2374 (let (result) | |
2375 (let ((file-name-history | |
2376 (nconc split-name file-name-history))) | |
2377 (setq result | |
2378 (expand-file-name | |
2379 (read-file-name | |
2380 (concat prompt " (`M-p' for defaults) ") | |
2381 gnus-article-save-directory | |
2382 (car split-name)) | |
2383 gnus-article-save-directory))) | |
2384 (car (push result file-name-history))))))) | |
2385 ;; Create the directory. | |
2386 (gnus-make-directory (file-name-directory file)) | |
2387 ;; If we have read a directory, we append the default file name. | |
2388 (when (file-directory-p file) | |
2389 (setq file (expand-file-name (file-name-nondirectory default-name) | |
2390 (file-name-as-directory file)))) | |
2391 ;; Possibly translate some characters. | |
2392 (nnheader-translate-file-chars file)))))) | |
17493 | 2393 (gnus-make-directory (file-name-directory result)) |
2394 (set variable result))) | |
2395 | |
2396 (defun gnus-article-archive-name (group) | |
2397 "Return the first instance of an \"Archive-name\" in the current buffer." | |
2398 (let ((case-fold-search t)) | |
2399 (when (re-search-forward "archive-name: *\\([^ \n\t]+\\)[ \t]*$" nil t) | |
2400 (nnheader-concat gnus-article-save-directory | |
2401 (match-string 1))))) | |
2402 | |
2403 (defun gnus-article-nndoc-name (group) | |
2404 "If GROUP is an nndoc group, return the name of the parent group." | |
2405 (when (eq (car (gnus-find-method-for-group group)) 'nndoc) | |
2406 (gnus-group-get-parameter group 'save-article-group))) | |
2407 | |
2408 (defun gnus-summary-save-in-rmail (&optional filename) | |
2409 "Append this article to Rmail file. | |
2410 Optional argument FILENAME specifies file name. | |
2411 Directory to save to is default to `gnus-article-save-directory'." | |
2412 (setq filename (gnus-read-save-file-name | |
2413 "Save %s in rmail file:" filename | |
2414 gnus-rmail-save-name gnus-newsgroup-name | |
2415 gnus-current-headers 'gnus-newsgroup-last-rmail)) | |
2416 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
2417 (save-excursion | |
2418 (save-restriction | |
2419 (widen) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2420 (gnus-output-to-rmail filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2421 filename) |
17493 | 2422 |
2423 (defun gnus-summary-save-in-mail (&optional filename) | |
2424 "Append this article to Unix mail file. | |
2425 Optional argument FILENAME specifies file name. | |
2426 Directory to save to is default to `gnus-article-save-directory'." | |
2427 (setq filename (gnus-read-save-file-name | |
2428 "Save %s in Unix mail file:" filename | |
2429 gnus-mail-save-name gnus-newsgroup-name | |
2430 gnus-current-headers 'gnus-newsgroup-last-mail)) | |
2431 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
2432 (save-excursion | |
2433 (save-restriction | |
2434 (widen) | |
2435 (if (and (file-readable-p filename) | |
2436 (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
|
2437 (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
|
2438 (gnus-output-to-mail filename))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2439 filename) |
17493 | 2440 |
2441 (defun gnus-summary-save-in-file (&optional filename overwrite) | |
2442 "Append this article to file. | |
2443 Optional argument FILENAME specifies file name. | |
2444 Directory to save to is default to `gnus-article-save-directory'." | |
2445 (setq filename (gnus-read-save-file-name | |
2446 "Save %s in file:" filename | |
2447 gnus-file-save-name gnus-newsgroup-name | |
2448 gnus-current-headers 'gnus-newsgroup-last-file)) | |
2449 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
2450 (save-excursion | |
2451 (save-restriction | |
2452 (widen) | |
2453 (when (and overwrite | |
2454 (file-exists-p filename)) | |
2455 (delete-file filename)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2456 (gnus-output-to-file filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2457 filename) |
17493 | 2458 |
2459 (defun gnus-summary-write-to-file (&optional filename) | |
2460 "Write this article to a file. | |
2461 Optional argument FILENAME specifies file name. | |
2462 The directory to save in defaults to `gnus-article-save-directory'." | |
2463 (gnus-summary-save-in-file nil t)) | |
2464 | |
2465 (defun gnus-summary-save-body-in-file (&optional filename) | |
2466 "Append this article body to a file. | |
2467 Optional argument FILENAME specifies file name. | |
2468 The directory to save in defaults to `gnus-article-save-directory'." | |
2469 (setq filename (gnus-read-save-file-name | |
2470 "Save %s body in file:" filename | |
2471 gnus-file-save-name gnus-newsgroup-name | |
2472 gnus-current-headers 'gnus-newsgroup-last-file)) | |
2473 (gnus-eval-in-buffer-window gnus-save-article-buffer | |
2474 (save-excursion | |
2475 (save-restriction | |
2476 (widen) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2477 (when (article-goto-body) |
17493 | 2478 (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
|
2479 (gnus-output-to-file filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2480 filename) |
17493 | 2481 |
2482 (defun gnus-summary-save-in-pipe (&optional command) | |
2483 "Pipe this article to subprocess." | |
2484 (setq command | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2485 (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
|
2486 gnus-last-shell-command) |
17493 | 2487 gnus-last-shell-command) |
2488 (command command) | |
2489 (t (read-string | |
2490 (format | |
2491 "Shell command on %s: " | |
2492 (if (and gnus-number-of-articles-to-be-saved | |
2493 (> gnus-number-of-articles-to-be-saved 1)) | |
2494 (format "these %d articles" | |
2495 gnus-number-of-articles-to-be-saved) | |
2496 "this article")) | |
2497 gnus-last-shell-command)))) | |
2498 (when (string-equal command "") | |
2499 (setq command gnus-last-shell-command)) | |
2500 (gnus-eval-in-buffer-window gnus-article-buffer | |
2501 (save-restriction | |
2502 (widen) | |
2503 (shell-command-on-region (point-min) (point-max) command nil))) | |
2504 (setq gnus-last-shell-command command)) | |
2505 | |
2506 ;;; Article file names when saving. | |
2507 | |
2508 (defun gnus-capitalize-newsgroup (newsgroup) | |
2509 "Capitalize NEWSGROUP name." | |
2510 (when (not (zerop (length newsgroup))) | |
2511 (concat (char-to-string (upcase (aref newsgroup 0))) | |
2512 (substring newsgroup 1)))) | |
2513 | |
2514 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file) | |
2515 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
2516 If variable `gnus-use-long-file-name' is non-nil, it is ~/News/News.group/num. | |
2517 Otherwise, it is like ~/News/news/group/num." | |
2518 (let ((default | |
2519 (expand-file-name | |
2520 (concat (if (gnus-use-long-file-name 'not-save) | |
2521 (gnus-capitalize-newsgroup newsgroup) | |
2522 (gnus-newsgroup-directory-form newsgroup)) | |
2523 "/" (int-to-string (mail-header-number headers))) | |
2524 gnus-article-save-directory))) | |
2525 (if (and last-file | |
2526 (string-equal (file-name-directory default) | |
2527 (file-name-directory last-file)) | |
2528 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
2529 default | |
2530 (or last-file default)))) | |
2531 | |
2532 (defun gnus-numeric-save-name (newsgroup headers &optional last-file) | |
2533 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
2534 If variable `gnus-use-long-file-name' is non-nil, it is | |
2535 ~/News/news.group/num. Otherwise, it is like ~/News/news/group/num." | |
2536 (let ((default | |
2537 (expand-file-name | |
2538 (concat (if (gnus-use-long-file-name 'not-save) | |
2539 newsgroup | |
2540 (gnus-newsgroup-directory-form newsgroup)) | |
2541 "/" (int-to-string (mail-header-number headers))) | |
2542 gnus-article-save-directory))) | |
2543 (if (and last-file | |
2544 (string-equal (file-name-directory default) | |
2545 (file-name-directory last-file)) | |
2546 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
2547 default | |
2548 (or last-file default)))) | |
2549 | |
2550 (defun gnus-plain-save-name (newsgroup headers &optional last-file) | |
2551 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
2552 If variable `gnus-use-long-file-name' is non-nil, it is | |
2553 ~/News/news.group. Otherwise, it is like ~/News/news/group/news." | |
2554 (or last-file | |
2555 (expand-file-name | |
2556 (if (gnus-use-long-file-name 'not-save) | |
2557 newsgroup | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2558 (expand-file-name "news" (gnus-newsgroup-directory-form newsgroup))) |
17493 | 2559 gnus-article-save-directory))) |
2560 | |
2561 (eval-and-compile | |
2562 (mapcar | |
2563 (lambda (func) | |
2564 (let (afunc gfunc) | |
2565 (if (consp func) | |
2566 (setq afunc (car func) | |
2567 gfunc (cdr func)) | |
2568 (setq afunc func | |
2569 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
|
2570 (defalias gfunc |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2571 (if (fboundp afunc) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2572 `(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
|
2573 ,(documentation afunc t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2574 (interactive (list t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2575 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2576 (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
|
2577 (if interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2578 (call-interactively ',afunc) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2579 (apply ',afunc args)))))))) |
17493 | 2580 '(article-hide-headers |
2581 article-hide-boring-headers | |
2582 article-treat-overstrike | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2583 article-fill-long-lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2584 article-capitalize-sentences |
17493 | 2585 article-remove-cr |
2586 article-display-x-face | |
2587 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
|
2588 article-de-base64-unreadable |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2589 article-decode-HZ |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2590 article-wash-html |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2591 article-hide-list-identifiers |
17493 | 2592 article-hide-pgp |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2593 article-strip-banner |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2594 article-babel |
17493 | 2595 article-hide-pem |
2596 article-hide-signature | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2597 article-strip-headers-in-body |
17493 | 2598 article-remove-trailing-blank-lines |
2599 article-strip-leading-blank-lines | |
2600 article-strip-multiple-blank-lines | |
2601 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
|
2602 article-strip-trailing-space |
17493 | 2603 article-strip-blank-lines |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2604 article-strip-all-blank-lines |
17493 | 2605 article-date-local |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2606 article-date-iso8601 |
17493 | 2607 article-date-original |
2608 article-date-ut | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2609 article-decode-mime-words |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2610 article-decode-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2611 article-decode-encoded-words |
17493 | 2612 article-date-user |
2613 article-date-lapsed | |
2614 article-emphasize | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2615 article-treat-dumbquotes |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2616 article-normalize-headers |
17493 | 2617 (article-show-all . gnus-article-show-all-headers)))) |
2618 | |
2619 ;;; | |
2620 ;;; Gnus article mode | |
2621 ;;; | |
2622 | |
2623 (put 'gnus-article-mode 'mode-class 'special) | |
2624 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2625 (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
|
2626 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2627 (gnus-define-keys gnus-article-mode-map |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2628 " " gnus-article-goto-next-page |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2629 "\177" gnus-article-goto-prev-page |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2630 [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
|
2631 [backspace] gnus-article-goto-prev-page |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2632 "\C-c^" gnus-article-refer-article |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2633 "h" gnus-article-show-summary |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2634 "s" gnus-article-show-summary |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2635 "\C-c\C-m" gnus-article-mail |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2636 "?" 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
|
2637 "e" gnus-summary-edit-article |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2638 "<" beginning-of-buffer |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2639 ">" end-of-buffer |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2640 "\C-c\C-i" gnus-info-find-node |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2641 "\C-c\C-b" gnus-bug |
17493 | 2642 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2643 "\C-d" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2644 "\M-*" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2645 "\M-#" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2646 "\M-^" gnus-article-read-summary-keys |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2647 "\M-g" gnus-article-read-summary-keys) |
17493 | 2648 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2649 (substitute-key-definition |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
2650 'undefined 'gnus-article-read-summary-keys gnus-article-mode-map) |
17493 | 2651 |
2652 (defun gnus-article-make-menu-bar () | |
2653 (gnus-turn-off-edit-menu 'article) | |
2654 (unless (boundp 'gnus-article-article-menu) | |
2655 (easy-menu-define | |
2656 gnus-article-article-menu gnus-article-mode-map "" | |
2657 '("Article" | |
2658 ["Scroll forwards" gnus-article-goto-next-page t] | |
2659 ["Scroll backwards" gnus-article-goto-prev-page t] | |
2660 ["Show summary" gnus-article-show-summary t] | |
2661 ["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
|
2662 ["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
|
2663 ["Send a bug report" gnus-bug t])) |
17493 | 2664 |
2665 (easy-menu-define | |
2666 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
|
2667 ;; Fixme: this should use :active (and maybe :visible). |
17493 | 2668 '("Treatment" |
2669 ["Hide headers" gnus-article-hide-headers t] | |
2670 ["Hide signature" gnus-article-hide-signature t] | |
2671 ["Hide citation" gnus-article-hide-citation t] | |
2672 ["Treat overstrike" gnus-article-treat-overstrike t] | |
2673 ["Remove carriage return" gnus-article-remove-cr t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2674 ["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
|
2675 ["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
|
2676 ["Treat html" gnus-article-wash-html t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2677 ["Decode HZ" gnus-article-decode-HZ t])) |
17493 | 2678 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2679 ;; Note "Commands" menu is defined in gnus-sum.el for consistency |
17493 | 2680 |
2681 (when (boundp 'gnus-summary-post-menu) | |
2682 (define-key gnus-article-mode-map [menu-bar post] | |
2683 (cons "Post" gnus-summary-post-menu))) | |
2684 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2685 (gnus-run-hooks 'gnus-article-menu-hook))) |
17493 | 2686 |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2687 ;; Fixme: do something for the Emacs tool bar in Article mode a la |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2688 ;; Summary. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2689 |
17493 | 2690 (defun gnus-article-mode () |
2691 "Major mode for displaying an article. | |
2692 | |
2693 All normal editing commands are switched off. | |
2694 | |
2695 The following commands are available in addition to all summary mode | |
2696 commands: | |
2697 \\<gnus-article-mode-map> | |
2698 \\[gnus-article-next-page]\t Scroll the article one page forwards | |
2699 \\[gnus-article-prev-page]\t Scroll the article one page backwards | |
2700 \\[gnus-article-refer-article]\t Go to the article referred to by an article id near point | |
2701 \\[gnus-article-show-summary]\t Display the summary buffer | |
2702 \\[gnus-article-mail]\t Send a reply to the address near point | |
2703 \\[gnus-article-describe-briefly]\t Describe the current mode briefly | |
2704 \\[gnus-info-find-node]\t Go to the Gnus info node" | |
2705 (interactive) | |
2706 (when (gnus-visual-p 'article-menu 'menu) | |
2707 (gnus-article-make-menu-bar)) | |
2708 (gnus-simplify-mode-line) | |
2709 (setq mode-name "Article") | |
2710 (setq major-mode 'gnus-article-mode) | |
2711 (make-local-variable 'minor-mode-alist) | |
2712 (use-local-map gnus-article-mode-map) | |
2713 (gnus-update-format-specifications nil 'article-mode) | |
2714 (set (make-local-variable 'page-delimiter) gnus-page-delimiter) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2715 (make-local-variable 'gnus-page-broken) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2716 (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
|
2717 (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
|
2718 (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
|
2719 (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
|
2720 (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
|
2721 (make-local-variable 'gnus-article-wash-types) |
17493 | 2722 (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
|
2723 (buffer-disable-undo) |
17493 | 2724 (setq buffer-read-only t) |
2725 (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
|
2726 (mm-enable-multibyte) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2727 (gnus-run-hooks 'gnus-article-mode-hook)) |
17493 | 2728 |
2729 (defun gnus-article-setup-buffer () | |
2730 "Initialize the article buffer." | |
2731 (let* ((name (if gnus-single-article-buffer "*Article*" | |
2732 (concat "*Article " gnus-newsgroup-name "*"))) | |
2733 (original | |
2734 (progn (string-match "\\*Article" name) | |
2735 (concat " *Original Article" | |
2736 (substring name (match-end 0)))))) | |
2737 (setq gnus-article-buffer name) | |
2738 (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
|
2739 (setq gnus-article-mime-handle-alist nil) |
17493 | 2740 ;; This might be a variable local to the summary buffer. |
2741 (unless gnus-single-article-buffer | |
2742 (save-excursion | |
2743 (set-buffer gnus-summary-buffer) | |
2744 (setq gnus-article-buffer name) | |
2745 (setq gnus-original-article-buffer original) | |
2746 (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
|
2747 (gnus-article-setup-highlight-words) |
17493 | 2748 ;; Init original article buffer. |
2749 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2750 (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
|
2751 (mm-enable-multibyte) |
17493 | 2752 (setq major-mode 'gnus-original-article-mode) |
2753 (make-local-variable 'gnus-original-article)) | |
2754 (if (get-buffer name) | |
2755 (save-excursion | |
2756 (set-buffer name) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2757 (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
|
2758 (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
|
2759 (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
|
2760 ;; Set it to nil in article-buffer! |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2761 (setq gnus-article-mime-handle-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2762 (buffer-disable-undo) |
17493 | 2763 (setq buffer-read-only t) |
2764 (unless (eq major-mode 'gnus-article-mode) | |
2765 (gnus-article-mode)) | |
2766 (current-buffer)) | |
2767 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2768 (set-buffer (gnus-get-buffer-create name)) |
17493 | 2769 (gnus-article-mode) |
2770 (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
|
2771 (gnus-summary-set-local-parameters gnus-newsgroup-name) |
17493 | 2772 (current-buffer))))) |
2773 | |
2774 ;; Set article window start at LINE, where LINE is the number of lines | |
2775 ;; from the head of the article. | |
2776 (defun gnus-article-set-window-start (&optional line) | |
2777 (set-window-start | |
2778 (get-buffer-window gnus-article-buffer t) | |
2779 (save-excursion | |
2780 (set-buffer gnus-article-buffer) | |
2781 (goto-char (point-min)) | |
2782 (if (not line) | |
2783 (point-min) | |
2784 (gnus-message 6 "Moved to bookmark") | |
2785 (search-forward "\n\n" nil t) | |
2786 (forward-line line) | |
2787 (point))))) | |
2788 | |
2789 (defun gnus-article-prepare (article &optional all-headers header) | |
2790 "Prepare ARTICLE in article mode buffer. | |
2791 ARTICLE should either be an article number or a Message-ID. | |
2792 If ARTICLE is an id, HEADER should be the article headers. | |
2793 If ALL-HEADERS is non-nil, no headers are hidden." | |
2794 (save-excursion | |
2795 ;; Make sure we start in a summary buffer. | |
2796 (unless (eq major-mode 'gnus-summary-mode) | |
2797 (set-buffer gnus-summary-buffer)) | |
2798 (setq gnus-summary-buffer (current-buffer)) | |
2799 (let* ((gnus-article (if header (mail-header-number header) article)) | |
2800 (summary-buffer (current-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2801 (gnus-tmp-internal-hook gnus-article-internal-prepare-hook) |
17493 | 2802 (group gnus-newsgroup-name) |
2803 result) | |
2804 (save-excursion | |
2805 (gnus-article-setup-buffer) | |
2806 (set-buffer gnus-article-buffer) | |
2807 ;; Deactivate active regions. | |
2808 (when (and (boundp 'transient-mark-mode) | |
2809 transient-mark-mode) | |
2810 (setq mark-active nil)) | |
2811 (if (not (setq result (let ((buffer-read-only nil)) | |
2812 (gnus-request-article-this-buffer | |
2813 article group)))) | |
2814 ;; There is no such article. | |
2815 (save-excursion | |
2816 (when (and (numberp article) | |
2817 (not (memq article gnus-newsgroup-sparse))) | |
2818 (setq gnus-article-current | |
2819 (cons gnus-newsgroup-name article)) | |
2820 (set-buffer gnus-summary-buffer) | |
2821 (setq gnus-current-article article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2822 (if (eq (gnus-article-mark article) gnus-undownloaded-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2823 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2824 (gnus-summary-set-agent-mark article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2825 (message "Message marked for downloading")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2826 (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
|
2827 (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
|
2828 (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
|
2829 (if (or (eq result 'pseudo) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2830 (eq result 'nneething)) |
17493 | 2831 (progn |
2832 (save-excursion | |
2833 (set-buffer summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2834 (push article gnus-newsgroup-history) |
17493 | 2835 (setq gnus-last-article gnus-current-article |
2836 gnus-current-article 0 | |
2837 gnus-current-headers nil | |
2838 gnus-article-current nil) | |
2839 (if (eq result 'nneething) | |
2840 (gnus-configure-windows 'summary) | |
2841 (gnus-configure-windows 'article)) | |
2842 (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
|
2843 (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
|
2844 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
|
2845 (gnus-set-mode-line 'article))) |
17493 | 2846 ;; The result from the `request' was an actual article - |
2847 ;; or at least some text that is now displayed in the | |
2848 ;; article buffer. | |
2849 (when (and (numberp article) | |
2850 (not (eq article gnus-current-article))) | |
2851 ;; Seems like a new article has been selected. | |
2852 ;; `gnus-current-article' must be an article number. | |
2853 (save-excursion | |
2854 (set-buffer summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2855 (push article gnus-newsgroup-history) |
17493 | 2856 (setq gnus-last-article gnus-current-article |
2857 gnus-current-article article | |
2858 gnus-current-headers | |
2859 (gnus-summary-article-header gnus-current-article) | |
2860 gnus-article-current | |
2861 (cons gnus-newsgroup-name gnus-current-article)) | |
2862 (unless (vectorp gnus-current-headers) | |
2863 (setq gnus-current-headers nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2864 (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
|
2865 (when (gnus-summary-show-thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2866 ;; 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
|
2867 ;; 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
|
2868 ;; 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
|
2869 ;; So we go again. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2870 (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
|
2871 (gnus-run-hooks 'gnus-mark-article-hook) |
17493 | 2872 (gnus-set-mode-line 'summary) |
2873 (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
|
2874 (gnus-run-hooks 'gnus-visual-mark-article-hook)) |
17493 | 2875 ;; Set the global newsgroup variables here. |
2876 (gnus-set-global-variables) | |
2877 (setq gnus-have-all-headers | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
2878 (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
|
2879 (save-excursion |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
2880 (gnus-configure-windows 'article)) |
17493 | 2881 (when (or (numberp article) |
2882 (stringp article)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2883 (gnus-article-prepare-display) |
17493 | 2884 ;; Do page break. |
2885 (goto-char (point-min)) | |
2886 (setq gnus-page-broken | |
2887 (when gnus-break-pages | |
2888 (gnus-narrow-to-page) | |
2889 t))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2890 (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
|
2891 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
|
2892 (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
|
2893 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2894 (set-window-point (get-buffer-window (current-buffer)) (point)) |
17493 | 2895 (gnus-configure-windows 'article) |
2896 t)))))) | |
2897 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2898 ;;;###autoload |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2899 (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
|
2900 "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
|
2901 ;; 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
|
2902 ;; 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
|
2903 (let ((gnus-article-buffer (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2904 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2905 (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
|
2906 (gnus-article-mode)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2907 (setq buffer-read-only nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2908 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
|
2909 (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
|
2910 (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
|
2911 (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
|
2912 (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
|
2913 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2914 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2915 ;;; Gnus MIME viewing functions |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2916 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2917 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2918 (defvar gnus-mime-button-line-format "%{%([%p. %d%T]%)%}%e\n" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2919 "The following specs can be used: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2920 %t The MIME type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2921 %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
|
2922 %n The `name' parameter |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2923 %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
|
2924 %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
|
2925 %p The part identifier number |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2926 %e Dots if the part isn't displayed") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2927 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2928 (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
|
2929 '((?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
|
2930 (?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
|
2931 (?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
|
2932 (?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
|
2933 (?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
|
2934 (?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
|
2935 (?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
|
2936 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2937 (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
|
2938 '((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
|
2939 (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
|
2940 (gnus-mime-view-part-as-type "t" "View As Type...") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2941 (gnus-mime-save-part "o" "Save...") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2942 (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
|
2943 (gnus-mime-inline-part "i" "View As Text, In This Buffer") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2944 (gnus-mime-internalize-part "E" "View Internally") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2945 (gnus-mime-externalize-part "e" "View Externally") |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
2946 (gnus-mime-pipe-part "|" "Pipe To Command...") |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
2947 (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
|
2948 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2949 (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
|
2950 (if gnus-article-mime-handle-alist-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2951 (format " (%d parts)" (length gnus-article-mime-handle-alist-1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2952 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2953 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2954 (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
|
2955 (let ((map (make-sparse-keymap))) |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2956 ;; Not for Emacs 21: fixme better. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2957 ;; (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
|
2958 (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
|
2959 (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
|
2960 (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
|
2961 (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
|
2962 map)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2963 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2964 (defun gnus-mime-button-menu (event) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2965 "Construct a context-sensitive menu of MIME commands." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2966 (interactive "e") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2967 (save-excursion |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2968 (mouse-set-point event) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2969 (gnus-article-check-buffer) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2970 (let ((response (x-popup-menu |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2971 t `("MIME Part" |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2972 ("" ,@(mapcar (lambda (c) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2973 (cons (caddr c) (car c))) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2974 gnus-mime-button-commands)))))) |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2975 (if response |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
2976 (call-interactively response))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2977 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2978 (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
|
2979 "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
|
2980 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2981 (save-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2982 (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
|
2983 (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
|
2984 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2985 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2986 (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
|
2987 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2988 (if (stringp (car handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2989 (gnus-mime-view-all-parts (cdr handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2990 (mapcar 'mm-display-part handles))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2991 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2992 (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
|
2993 "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
|
2994 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2995 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2996 (let ((data (get-text-property (point) 'gnus-data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2997 (mm-save-part data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2998 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
2999 (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
|
3000 "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
|
3001 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3002 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3003 (let ((data (get-text-property (point) 'gnus-data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3004 (mm-pipe-part data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3005 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3006 (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
|
3007 "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
|
3008 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3009 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3010 (let ((data (get-text-property (point) 'gnus-data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3011 (mm-interactively-view-part data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3012 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3013 (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
|
3014 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3015 (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
|
3016 (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
|
3017 'name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3018 (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
|
3019 (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
|
3020 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3021 (defun gnus-mime-view-part-as-type (mime-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3022 "Choose a MIME media type, and view the part as such." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3023 (interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3024 (list (completing-read |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3025 "View as MIME type: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3026 (mapcar #'list (mailcap-mime-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3027 nil nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3028 (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
|
3029 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3030 (let ((handle (get-text-property (point) 'gnus-data))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3031 (gnus-mm-display-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3032 (mm-make-handle (mm-handle-buffer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3033 (cons mime-type (cdr (mm-handle-type handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3034 (mm-handle-encoding handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3035 (mm-handle-undisplayer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3036 (mm-handle-disposition handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3037 (mm-handle-description handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3038 (mm-handle-cache handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3039 (mm-handle-id handle))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3040 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3041 (defun gnus-mime-copy-part (&optional handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3042 "Put the the MIME part under point into a new buffer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3043 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3044 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3045 (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
|
3046 (contents (mm-get-part handle))| |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3047 (base (file-name-nondirectory |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3048 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3049 (mail-content-type-get (mm-handle-type handle) 'name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3050 (mail-content-type-get (mm-handle-type handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3051 'filename) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3052 "*decoded*"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3053 (buffer (generate-new-buffer base))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3054 (switch-to-buffer buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3055 (insert contents) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3056 ;; We do it this way to make `normal-mode' set the appropriate mode. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3057 (unwind-protect |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3058 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3059 (setq buffer-file-name (expand-file-name base)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3060 (normal-mode)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3061 (setq buffer-file-name nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3062 (goto-char (point-min)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3063 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3064 (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
|
3065 "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
|
3066 (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
|
3067 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3068 (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
|
3069 contents charset |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3070 (b (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3071 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3072 (if (mm-handle-undisplayer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3073 (mm-remove-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3074 (setq contents (mm-get-part handle)) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3075 (cond |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3076 ((not arg) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3077 (setq charset (or (mail-content-type-get |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3078 (mm-handle-type handle) 'charset) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3079 gnus-newsgroup-charset))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3080 ((numberp arg) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3081 (setq charset |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3082 (or (cdr (assq arg |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3083 gnus-summary-show-article-charset-alist)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3084 (read-coding-system "Charset: "))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3085 (forward-line 2) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3086 (mm-insert-inline handle |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3087 (if (and charset |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3088 (setq charset (mm-charset-to-coding-system |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3089 charset)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3090 (not (eq charset 'ascii))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3091 (mm-decode-coding-string contents charset) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3092 contents)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3093 (goto-char b)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3094 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3095 (defun gnus-mime-externalize-part (&optional handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3096 "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
|
3097 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3098 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3099 (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
|
3100 (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
|
3101 (mm-inlined-types nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3102 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3103 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3104 (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
|
3105 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3106 (if (mm-handle-undisplayer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3107 (mm-remove-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3108 (mm-display-part handle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3109 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3110 (defun gnus-mime-internalize-part (&optional handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3111 "View the MIME part under point with an internal viewer. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3112 In no internal viewer is available, use an external viewer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3113 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3114 (gnus-article-check-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3115 (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
|
3116 (mm-inlined-types '(".*")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3117 (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
|
3118 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3119 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3120 (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
|
3121 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3122 (if (mm-handle-undisplayer handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3123 (mm-remove-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3124 (mm-display-part handle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3125 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3126 (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
|
3127 "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
|
3128 (interactive |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3129 (list (completing-read "Action: " gnus-mime-action-alist))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3130 (gnus-article-check-buffer) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3131 (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
|
3132 (if action-pair |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3133 (funcall (cdr action-pair))))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3134 |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3135 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3136 (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
|
3137 (save-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3138 (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
|
3139 (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
|
3140 (error "No such part")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3141 (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
|
3142 (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
|
3143 (funcall function handle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3144 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3145 (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
|
3146 "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
|
3147 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3148 (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
|
3149 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3150 (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
|
3151 "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
|
3152 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3153 (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
|
3154 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3155 (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
|
3156 "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
|
3157 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3158 (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
|
3159 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3160 (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
|
3161 "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
|
3162 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3163 (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
|
3164 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3165 (defun gnus-article-externalize-part (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3166 "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
|
3167 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3168 (gnus-article-part-wrapper n 'gnus-mime-externalize-part)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3169 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3170 (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
|
3171 "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
|
3172 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3173 (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
|
3174 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3175 (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
|
3176 (if condition |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3177 (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
|
3178 (while (setq ihandle (pop alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3179 (if (and (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3180 ((functionp condition) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3181 (funcall condition (cdr ihandle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3182 ((eq condition 'undisplayed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3183 (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
|
3184 (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
|
3185 "multipart/alternative")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3186 ((eq condition 'undisplayed-alternative) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3187 (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
|
3188 (t t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3189 (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
|
3190 (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
|
3191 (setq n (car ihandle)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3192 (or n 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3193 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3194 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3195 (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
|
3196 "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
|
3197 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3198 (save-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3199 (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
|
3200 (or (numberp n) (setq n (gnus-article-mime-match-handle-first |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3201 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
|
3202 (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
|
3203 (error "No such part")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3204 (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
|
3205 (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
|
3206 (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
|
3207 (gnus-article-press-button) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3208 (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
|
3209 (gnus-set-window-start))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3210 |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3211 (defsubst gnus-article-mime-total-parts () |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3212 (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
|
3213 1 ;; single part |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3214 (1- (length gnus-article-mime-handles)))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3215 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3216 (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
|
3217 "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
|
3218 (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
|
3219 (point (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3220 buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3221 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3222 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3223 (let ((window (selected-window)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3224 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3225 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3226 (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
|
3227 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3228 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3229 (unwind-protect |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3230 (let ((win (get-buffer-window (current-buffer) t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3231 (beg (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3232 (when win |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3233 (select-window win)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3234 (goto-char point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3235 (forward-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3236 (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
|
3237 ;; 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
|
3238 (mm-display-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3239 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3240 (narrow-to-region (point) (1+ (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3241 (mm-display-part handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3242 ;; 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
|
3243 ;; 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
|
3244 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3245 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3246 (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
|
3247 (gnus-treat-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3248 nil id |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3249 (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
|
3250 (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
|
3251 (select-window window)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3252 (goto-char point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3253 (delete-region (gnus-point-at-bol) (progn (forward-line 1) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3254 (gnus-insert-mime-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3255 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
|
3256 (goto-char point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3257 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3258 (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
|
3259 "Go to MIME part N." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3260 (let ((point (text-property-any (point-min) (point-max) 'gnus-part n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3261 (when point |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3262 (goto-char point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3263 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3264 (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
|
3265 (let ((gnus-tmp-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3266 (or (mail-content-type-get (mm-handle-type handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3267 'name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3268 (mail-content-type-get (mm-handle-disposition handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3269 'filename) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3270 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3271 (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
|
3272 (gnus-tmp-description |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3273 (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
|
3274 ""))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3275 (gnus-tmp-dots |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3276 (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
|
3277 (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
|
3278 "" "...")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3279 (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
|
3280 (buffer-size))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3281 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
|
3282 (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
|
3283 (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
|
3284 (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
|
3285 (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
|
3286 (concat "; " gnus-tmp-name)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3287 (or (equal gnus-tmp-description "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3288 (setq gnus-tmp-type-long (concat " --- " gnus-tmp-type-long))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3289 (unless (bolp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3290 (insert "\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3291 (setq b (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3292 (gnus-eval-format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3293 gnus-mime-button-line-format gnus-mime-button-line-format-alist |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3294 `(keymap ,gnus-mime-button-map |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3295 ;; Not for Emacs 21: fixme better. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3296 ;; local-map ,gnus-mime-button-map |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3297 gnus-callback gnus-mm-display-part |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3298 gnus-part ,gnus-tmp-id |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3299 article-type annotation |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3300 gnus-data ,handle)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3301 (setq e (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3302 (widget-convert-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3303 'link b e |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3304 :mime-handle handle |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3305 :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
|
3306 :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
|
3307 :help-echo |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3308 (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
|
3309 ;; 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
|
3310 ;; wid-edit (XEmacs only). |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3311 (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
|
3312 (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
|
3313 (format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3314 "%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
|
3315 (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
|
3316 ;; 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
|
3317 ;; window, overlay, position. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3318 (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
|
3319 (if overlay |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3320 (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
|
3321 (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
|
3322 :mime-handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3323 (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
|
3324 "hide" "show") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3325 (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
|
3326 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3327 (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
|
3328 (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
|
3329 (gnus-article-press-button)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3330 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3331 (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
|
3332 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3333 (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
|
3334 "Display the MIME parts." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3335 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3336 (save-selected-window |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3337 (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
|
3338 (point (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3339 (when window |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3340 (select-window window) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3341 ;; 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
|
3342 ;; 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
|
3343 (set-window-point window point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3344 (let* ((handles (or ihandles (mm-dissect-buffer) (mm-uu-dissect))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3345 buffer-read-only handle name type b e display) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3346 (when (and (not ihandles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3347 (not gnus-displaying-mime)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3348 ;; 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
|
3349 (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
|
3350 (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
|
3351 (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
|
3352 (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
|
3353 ;; 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
|
3354 (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
|
3355 (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
|
3356 (if (and handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3357 (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
|
3358 (cdr handles))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3359 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3360 (when (and (not ihandles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3361 (not gnus-displaying-mime)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3362 ;; 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
|
3363 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3364 (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
|
3365 (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
|
3366 (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
|
3367 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3368 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3369 (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
|
3370 (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
|
3371 (widen))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3372 (unless ihandles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3373 ;; Highlight the headers. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3374 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3375 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3376 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3377 (narrow-to-region (point-min) (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3378 (gnus-treat-article 'head)))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3379 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3380 (defvar gnus-mime-display-multipart-as-mixed nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3381 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3382 (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
|
3383 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3384 ;; Single part. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3385 ((not (stringp (car handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3386 (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
|
3387 ;; User-defined multipart |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3388 ((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
|
3389 (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
|
3390 handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3391 ;; multipart/alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3392 ((and (equal (car handle) "multipart/alternative") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3393 (not gnus-mime-display-multipart-as-mixed)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3394 (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
|
3395 (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
|
3396 (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
|
3397 ;; multipart/related |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3398 ((and (equal (car handle) "multipart/related") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3399 (not gnus-mime-display-multipart-as-mixed)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3400 ;;;!!!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
|
3401 ;;;!!!to the first part. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3402 (gnus-mime-display-part (cadr handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3403 ;; 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
|
3404 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3405 (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
|
3406 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3407 (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
|
3408 (if (stringp (car handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3409 (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
|
3410 (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
|
3411 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3412 (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
|
3413 (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
|
3414 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3415 (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
|
3416 (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
|
3417 (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
|
3418 (not-attachment t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3419 (move nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3420 display text) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3421 (catch 'ignored |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3422 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3423 (while ignored |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3424 (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
|
3425 (throw 'ignored nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3426 (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
|
3427 (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
|
3428 (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
|
3429 (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
|
3430 "inline") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3431 (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
|
3432 (mm-automatic-display-p handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3433 (or (mm-inlined-p handle) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3434 (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
|
3435 (setq display t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3436 (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
|
3437 (setq text t))) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3438 (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
|
3439 beg) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3440 (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
|
3441 (when (or (not display) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3442 (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
|
3443 ;(gnus-article-insert-newline) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3444 (gnus-insert-mime-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3445 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
|
3446 (gnus-article-insert-newline) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3447 ;(gnus-article-insert-newline) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3448 (setq move t)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3449 (setq beg (point)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3450 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3451 (display |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3452 (when move |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3453 (forward-line -2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3454 (setq beg (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3455 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3456 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3457 (save-excursion (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3458 (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
|
3459 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3460 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3461 (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
|
3462 (goto-char (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3463 ((and text not-attachment) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3464 (when move |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3465 (forward-line -2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3466 (setq beg (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3467 (gnus-article-insert-newline) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3468 (mm-insert-inline handle (mm-get-part handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3469 (goto-char (point-max)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3470 ;; Do highlighting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3471 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3472 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3473 (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
|
3474 (gnus-treat-article |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3475 nil id |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3476 (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
|
3477 (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
|
3478 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3479 (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
|
3480 "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
|
3481 (unless gnus-inhibit-mime-unbuttonizing |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3482 (catch 'found |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3483 (let ((types gnus-unbuttonized-mime-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3484 (while types |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3485 (when (string-match (pop types) type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3486 (throw 'found t))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3487 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3488 (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
|
3489 "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
|
3490 (gnus-put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3491 (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
|
3492 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3493 (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
|
3494 (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
|
3495 (ihandles handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3496 (point (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3497 handle buffer-read-only from props begend not-pref) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3498 (save-window-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3499 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3500 (when ibegend |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3501 (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
|
3502 (or (cdr ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3503 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3504 (goto-char (car ibegend)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3505 (forward-line 2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3506 (point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3507 (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
|
3508 (mm-remove-parts handles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3509 (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
|
3510 ;; Do the toggle. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3511 (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
|
3512 (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
|
3513 (when (or ibegend |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3514 (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
|
3515 "multipart/alternative"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3516 (gnus-add-text-properties |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3517 (setq from (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3518 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3519 (insert (format "%d. " id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3520 (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3521 `(gnus-callback |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3522 (lambda (handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3523 (unless ,(not ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3524 (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
|
3525 ',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
|
3526 (gnus-mime-display-alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3527 ',ihandles ',not-pref ',begend ,id)) |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3528 ;; Not for Emacs 21: fixme better. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3529 ;; local-map ,gnus-mime-button-map |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3530 ,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
|
3531 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
|
3532 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
|
3533 gnus-part ,id |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3534 gnus-data ,handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3535 (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
|
3536 :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
|
3537 :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
|
3538 ;; Do the handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3539 (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
|
3540 (gnus-add-text-properties |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3541 (setq from (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3542 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3543 (insert (format "(%c) %-18s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3544 (if (equal handle preferred) ?* ? ) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3545 (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
|
3546 (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3547 `(gnus-callback |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3548 (lambda (handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3549 (unless ,(not ibegend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3550 (setq gnus-article-mime-handle-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3551 ',gnus-article-mime-handle-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3552 (gnus-mime-display-alternative |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3553 ',ihandles ',handle ',begend ,id)) |
33691
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3554 ;; Not for Emacs 21: fixme better. |
936c632692fd
(gnus-mime-button-map): Don't inherit from
Dave Love <fx@gnu.org>
parents:
33397
diff
changeset
|
3555 ;; local-map ,gnus-mime-button-map |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3556 ,gnus-mouse-face-prop ,gnus-article-mouse-face |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3557 face ,gnus-article-button-face |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3558 keymap ,gnus-mime-button-map |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3559 gnus-part ,id |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3560 gnus-data ,handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3561 (widget-convert-button 'link from (point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3562 :action 'gnus-widget-press-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3563 :button-keymap gnus-widget-button-keymap) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3564 (insert " ")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3565 (insert "\n\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3566 (when preferred |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3567 (if (stringp (car preferred)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3568 (gnus-display-mime preferred) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3569 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3570 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3571 (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
|
3572 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3573 (mm-display-part preferred) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3574 ;; Do highlighting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3575 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3576 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3577 (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
|
3578 (gnus-treat-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3579 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
|
3580 (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
|
3581 (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
|
3582 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3583 (setcdr begend (point-marker))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3584 (when ibegend |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3585 (goto-char point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3586 |
17493 | 3587 (defun gnus-article-wash-status () |
3588 "Return a string which display status of article washing." | |
3589 (save-excursion | |
3590 (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
|
3591 (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
|
3592 (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
|
3593 (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
|
3594 (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
|
3595 (pem (memq 'pem gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3596 (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
|
3597 (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
|
3598 (emphasis (memq 'emphasis gnus-article-wash-types))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3599 (format "%c%c%c%c%c%c" |
17493 | 3600 (if cite ?c ? ) |
3601 (if (or headers boring) ?h ? ) | |
3602 (if (or pgp pem) ?p ? ) | |
3603 (if signature ?s ? ) | |
3604 (if overstrike ?o ? ) | |
3605 (if emphasis ?e ? ))))) | |
3606 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3607 (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
|
3608 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3609 (defun gnus-article-maybe-hide-headers () |
17493 | 3610 "Hide unwanted headers if `gnus-have-all-headers' is nil. |
3611 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
|
3612 (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
|
3613 (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
|
3614 gnus-have-all-headers))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3615 (not gnus-inhibit-hiding)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3616 (gnus-article-hide-headers))) |
17493 | 3617 |
3618 ;;; Article savers. | |
3619 | |
3620 (defun gnus-output-to-file (file-name) | |
3621 "Append the current article to a file named FILE-NAME." | |
3622 (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
|
3623 (with-temp-buffer |
17493 | 3624 (insert-buffer-substring artbuf) |
3625 ;; Append newline at end of the buffer as separator, and then | |
3626 ;; save it to file. | |
3627 (goto-char (point-max)) | |
3628 (insert "\n") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3629 (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
|
3630 t))) |
17493 | 3631 |
3632 (defun gnus-narrow-to-page (&optional arg) | |
3633 "Narrow the article buffer to a page. | |
3634 If given a numerical ARG, move forward ARG pages." | |
3635 (interactive "P") | |
3636 (setq arg (if arg (prefix-numeric-value arg) 0)) | |
3637 (save-excursion | |
3638 (set-buffer gnus-article-buffer) | |
3639 (goto-char (point-min)) | |
3640 (widen) | |
3641 ;; Remove any old next/prev buttons. | |
3642 (when (gnus-visual-p 'page-marker) | |
3643 (let ((buffer-read-only nil)) | |
3644 (gnus-remove-text-with-property 'gnus-prev) | |
3645 (gnus-remove-text-with-property 'gnus-next))) | |
3646 (when | |
3647 (cond ((< arg 0) | |
3648 (re-search-backward page-delimiter nil 'move (1+ (abs arg)))) | |
3649 ((> arg 0) | |
3650 (re-search-forward page-delimiter nil 'move arg))) | |
3651 (goto-char (match-end 0))) | |
3652 (narrow-to-region | |
3653 (point) | |
3654 (if (re-search-forward page-delimiter nil 'move) | |
3655 (match-beginning 0) | |
3656 (point))) | |
3657 (when (and (gnus-visual-p 'page-marker) | |
3658 (not (= (point-min) 1))) | |
3659 (save-excursion | |
3660 (goto-char (point-min)) | |
3661 (gnus-insert-prev-page-button))) | |
3662 (when (and (gnus-visual-p 'page-marker) | |
3663 (< (+ (point-max) 2) (buffer-size))) | |
3664 (save-excursion | |
3665 (goto-char (point-max)) | |
3666 (gnus-insert-next-page-button))))) | |
3667 | |
3668 ;; Article mode commands | |
3669 | |
3670 (defun gnus-article-goto-next-page () | |
3671 "Show the next page of the article." | |
3672 (interactive) | |
3673 (when (gnus-article-next-page) | |
3674 (goto-char (point-min)) | |
3675 (gnus-article-read-summary-keys nil (gnus-character-to-event ?n)))) | |
3676 | |
3677 (defun gnus-article-goto-prev-page () | |
3678 "Show the next page of the article." | |
3679 (interactive) | |
3680 (if (bobp) (gnus-article-read-summary-keys nil (gnus-character-to-event ?p)) | |
3681 (gnus-article-prev-page nil))) | |
3682 | |
3683 (defun gnus-article-next-page (&optional lines) | |
3684 "Show the next page of the current article. | |
3685 If end of article, return non-nil. Otherwise return nil. | |
3686 Argument LINES specifies lines to be scrolled up." | |
3687 (interactive "p") | |
3688 (move-to-window-line -1) | |
3689 (if (save-excursion | |
3690 (end-of-line) | |
3691 (and (pos-visible-in-window-p) ;Not continuation line. | |
3692 (eobp))) | |
3693 ;; Nothing in this page. | |
3694 (if (or (not gnus-page-broken) | |
3695 (save-excursion | |
3696 (save-restriction | |
3697 (widen) (forward-line 1) (eobp)))) ;Real end-of-buffer? | |
3698 t ;Nothing more. | |
3699 (gnus-narrow-to-page 1) ;Go to next page. | |
3700 nil) | |
3701 ;; More in this page. | |
3702 (let ((scroll-in-place nil)) | |
3703 (condition-case () | |
3704 (scroll-up lines) | |
3705 (end-of-buffer | |
3706 ;; Long lines may cause an end-of-buffer error. | |
3707 (goto-char (point-max))))) | |
3708 (move-to-window-line 0) | |
3709 nil)) | |
3710 | |
3711 (defun gnus-article-prev-page (&optional lines) | |
3712 "Show previous page of current article. | |
3713 Argument LINES specifies lines to be scrolled down." | |
3714 (interactive "p") | |
3715 (move-to-window-line 0) | |
3716 (if (and gnus-page-broken | |
3717 (bobp) | |
3718 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer? | |
3719 (progn | |
3720 (gnus-narrow-to-page -1) ;Go to previous page. | |
3721 (goto-char (point-max)) | |
3722 (recenter -1)) | |
3723 (let ((scroll-in-place nil)) | |
3724 (prog1 | |
3725 (condition-case () | |
3726 (scroll-down lines) | |
3727 (beginning-of-buffer | |
3728 (goto-char (point-min)))) | |
3729 (move-to-window-line 0))))) | |
3730 | |
3731 (defun gnus-article-refer-article () | |
3732 "Read article specified by message-id around point." | |
3733 (interactive) | |
3734 (let ((point (point))) | |
3735 (search-forward ">" nil t) ;Move point to end of "<....>". | |
3736 (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t) | |
3737 (let ((message-id (match-string 1))) | |
3738 (goto-char point) | |
3739 (set-buffer gnus-summary-buffer) | |
3740 (gnus-summary-refer-article message-id)) | |
3741 (goto-char (point)) | |
3742 (error "No references around point")))) | |
3743 | |
3744 (defun gnus-article-show-summary () | |
3745 "Reconfigure windows to show summary buffer." | |
3746 (interactive) | |
3747 (if (not (gnus-buffer-live-p gnus-summary-buffer)) | |
3748 (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
|
3749 (gnus-article-set-globals) |
17493 | 3750 (gnus-configure-windows 'article) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3751 (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
|
3752 (gnus-summary-position-point))) |
17493 | 3753 |
3754 (defun gnus-article-describe-briefly () | |
3755 "Describe article mode commands briefly." | |
3756 (interactive) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3757 (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 | 3758 |
3759 (defun gnus-article-summary-command () | |
3760 "Execute the last keystroke in the summary buffer." | |
3761 (interactive) | |
3762 (let ((obuf (current-buffer)) | |
3763 (owin (current-window-configuration)) | |
3764 func) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3765 (switch-to-buffer gnus-article-current-summary 'norecord) |
17493 | 3766 (setq func (lookup-key (current-local-map) (this-command-keys))) |
3767 (call-interactively func) | |
3768 (set-buffer obuf) | |
3769 (set-window-configuration owin) | |
3770 (set-window-point (get-buffer-window (current-buffer)) (point)))) | |
3771 | |
3772 (defun gnus-article-summary-command-nosave () | |
3773 "Execute the last keystroke in the summary buffer." | |
3774 (interactive) | |
3775 (let (func) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3776 (pop-to-buffer gnus-article-current-summary 'norecord) |
17493 | 3777 (setq func (lookup-key (current-local-map) (this-command-keys))) |
3778 (call-interactively func))) | |
3779 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3780 (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
|
3781 "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
|
3782 (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
|
3783 (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
|
3784 |
17493 | 3785 (defun gnus-article-read-summary-keys (&optional arg key not-restore-window) |
3786 "Read a summary buffer key sequence and execute it from the article buffer." | |
3787 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3788 (gnus-article-check-buffer) |
17493 | 3789 (let ((nosaves |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3790 '("q" "Q" "c" "r" "R" "\C-c\C-f" "m" "a" "f" "F" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3791 "Zc" "ZC" "ZE" "ZQ" "ZZ" "Zn" "ZR" "ZG" "ZN" "ZP" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3792 "=" "^" "\M-^" "|")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3793 (nosave-but-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3794 '("A\r")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3795 (nosave-in-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3796 '("\C-d")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3797 (up-to-top |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3798 '("n" "Gn" "p" "Gp")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3799 keys new-sum-point) |
17493 | 3800 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3801 (set-buffer gnus-article-current-summary) |
17493 | 3802 (let (gnus-pick-mode) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3803 (push (or key last-command-event) unread-command-events) |
32939
c8119677d63e
Use (featurep 'xemacs) instead of the `gnus-xemacs' variable, as the
Miles Bader <miles@gnu.org>
parents:
32927
diff
changeset
|
3804 (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
|
3805 (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
|
3806 (read-key-sequence nil))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3807 |
17493 | 3808 (message "") |
3809 | |
3810 (if (or (member keys nosaves) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3811 (member keys nosave-but-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3812 (member keys nosave-in-article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3813 (let (func) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3814 (save-window-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3815 (pop-to-buffer gnus-article-current-summary 'norecord) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3816 ;; We disable the pick minor mode commands. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3817 (let (gnus-pick-mode) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3818 (setq func (lookup-key (current-local-map) keys)))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3819 (if (or (not func) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3820 (numberp func)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3821 (ding) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3822 (unless (member keys nosave-in-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3823 (set-buffer gnus-article-current-summary)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3824 (call-interactively func) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3825 (setq new-sum-point (point))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3826 (when (member keys nosave-but-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3827 (pop-to-buffer gnus-article-buffer 'norecord))) |
17493 | 3828 ;; These commands should restore window configuration. |
3829 (let ((obuf (current-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3830 (owin (current-window-configuration)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3831 (opoint (point)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3832 (summary gnus-article-current-summary) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3833 func in-buffer selected) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3834 (if not-restore-window |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3835 (pop-to-buffer summary 'norecord) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3836 (switch-to-buffer summary 'norecord)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3837 (setq in-buffer (current-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3838 ;; We disable the pick minor mode commands. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3839 (if (setq func (let (gnus-pick-mode) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3840 (lookup-key (current-local-map) keys))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3841 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3842 (call-interactively func) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3843 (setq new-sum-point (point))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3844 (ding)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3845 (when (eq in-buffer (current-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3846 (setq selected (gnus-summary-select-article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3847 (set-buffer obuf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3848 (unless not-restore-window |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3849 (set-window-configuration owin)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3850 (when (eq selected 'old) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3851 (article-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3852 (set-window-start (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
|
3853 1) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3854 (set-window-point (get-buffer-window (current-buffer)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3855 (point))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3856 (let ((win (get-buffer-window gnus-article-current-summary))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3857 (when win |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3858 (set-window-point win new-sum-point)))))))) |
17493 | 3859 |
3860 (defun gnus-article-hide (&optional arg force) | |
3861 "Hide all the gruft in the current article. | |
3862 This means that PGP stuff, signatures, cited text and (some) | |
3863 headers will be hidden. | |
3864 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
|
3865 (interactive (append (gnus-article-hidden-arg) (list 'force))) |
17493 | 3866 (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
|
3867 (gnus-article-hide-list-identifiers arg) |
17493 | 3868 (gnus-article-hide-pgp arg) |
3869 (gnus-article-hide-citation-maybe arg force) | |
3870 (gnus-article-hide-signature arg)) | |
3871 | |
3872 (defun gnus-article-maybe-highlight () | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3873 "Do some article highlighting if article highlighting is requested." |
17493 | 3874 (when (gnus-visual-p 'article-highlight 'highlight) |
3875 (gnus-article-highlight-some))) | |
3876 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3877 (defun gnus-check-group-server () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3878 ;; 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
|
3879 (unless (gnus-server-opened |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3880 (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
|
3881 (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
|
3882 (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
|
3883 |
17493 | 3884 (defun gnus-request-article-this-buffer (article group) |
3885 "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
|
3886 (let (do-update-line sparse-header) |
17493 | 3887 (prog1 |
3888 (save-excursion | |
3889 (erase-buffer) | |
3890 (gnus-kill-all-overlays) | |
3891 (setq group (or group gnus-newsgroup-name)) | |
3892 | |
3893 ;; Using `gnus-request-article' directly will insert the article into | |
3894 ;; `nntp-server-buffer' - so we'll save some time by not having to | |
3895 ;; copy it from the server buffer into the article buffer. | |
3896 | |
3897 ;; We only request an article by message-id when we do not have the | |
3898 ;; headers for it, so we'll have to get those. | |
3899 (when (stringp article) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3900 (gnus-read-header article)) |
17493 | 3901 |
3902 ;; If the article number is negative, that means that this article | |
3903 ;; doesn't belong in this newsgroup (possibly), so we find its | |
3904 ;; message-id and request it by id instead of number. | |
3905 (when (and (numberp article) | |
3906 gnus-summary-buffer | |
3907 (get-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3908 (gnus-buffer-exists-p gnus-summary-buffer)) |
17493 | 3909 (save-excursion |
3910 (set-buffer gnus-summary-buffer) | |
3911 (let ((header (gnus-summary-article-header article))) | |
3912 (when (< article 0) | |
3913 (cond | |
3914 ((memq article gnus-newsgroup-sparse) | |
3915 ;; This is a sparse gap article. | |
3916 (setq do-update-line article) | |
3917 (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
|
3918 (setq sparse-header (gnus-read-header article)) |
17493 | 3919 (setq gnus-newsgroup-sparse |
3920 (delq article gnus-newsgroup-sparse))) | |
3921 ((vectorp header) | |
3922 ;; It's a real article. | |
3923 (setq article (mail-header-id header))) | |
3924 (t | |
3925 ;; It is an extracted pseudo-article. | |
3926 (setq article 'pseudo) | |
3927 (gnus-request-pseudo-article header)))) | |
3928 | |
3929 (let ((method (gnus-find-method-for-group | |
3930 gnus-newsgroup-name))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3931 (when (and (eq (car method) 'nneething) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3932 (vectorp header)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3933 (let ((dir (expand-file-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3934 (mail-header-subject header) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3935 (file-name-as-directory |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3936 (or (cadr (assq 'nneething-address method)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3937 (nth 1 method)))))) |
17493 | 3938 (when (file-directory-p dir) |
3939 (setq article 'nneething) | |
3940 (gnus-group-enter-directory dir)))))))) | |
3941 | |
3942 (cond | |
3943 ;; Refuse to select canceled articles. | |
3944 ((and (numberp article) | |
3945 gnus-summary-buffer | |
3946 (get-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
3947 (gnus-buffer-exists-p gnus-summary-buffer) |
17493 | 3948 (eq (cdr (save-excursion |
3949 (set-buffer gnus-summary-buffer) | |
3950 (assq article gnus-newsgroup-reads))) | |
3951 gnus-canceled-mark)) | |
3952 nil) | |
3953 ;; We first check `gnus-original-article-buffer'. | |
3954 ((and (get-buffer gnus-original-article-buffer) | |
3955 (numberp article) | |
3956 (save-excursion | |
3957 (set-buffer gnus-original-article-buffer) | |
3958 (and (equal (car gnus-original-article) group) | |
3959 (eq (cdr gnus-original-article) article)))) | |
3960 (insert-buffer-substring gnus-original-article-buffer) | |
3961 'article) | |
3962 ;; Check the backlog. | |
3963 ((and gnus-keep-backlog | |
3964 (gnus-backlog-request-article group article (current-buffer))) | |
3965 'article) | |
3966 ;; Check asynchronous pre-fetch. | |
3967 ((gnus-async-request-fetched-article group article (current-buffer)) | |
3968 (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
|
3969 (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
|
3970 (gnus-backlog-enter-article group article (current-buffer))) |
17493 | 3971 'article) |
3972 ;; Check the cache. | |
3973 ((and gnus-use-cache | |
3974 (numberp article) | |
3975 (gnus-cache-request-article article group)) | |
3976 'article) | |
3977 ;; 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
|
3978 ((or (stringp article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3979 (numberp article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3980 (let ((gnus-override-method gnus-override-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3981 (methods (and (stringp article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3982 gnus-refer-article-method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3983 result |
17493 | 3984 (buffer-read-only nil)) |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3985 (if (or (not (listp methods)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3986 (and (symbolp (car methods)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3987 (assq (car methods) nnoo-definition-alist))) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
3988 (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
|
3989 (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
|
3990 methods) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3991 (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
|
3992 (while (not result) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3993 (when (eq gnus-override-method 'current) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3994 (setq gnus-override-method gnus-current-select-method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3995 (erase-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3996 (gnus-kill-all-overlays) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3997 (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
|
3998 (gnus-check-group-server)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
3999 (when (gnus-request-article article group (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4000 (when (numberp article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4001 (gnus-async-prefetch-next group article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4002 gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4003 (when gnus-keep-backlog |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4004 (gnus-backlog-enter-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4005 group article (current-buffer)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4006 (setq result 'article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4007 (if (not result) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4008 (if methods |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4009 (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
|
4010 (setq result 'done)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4011 (and (eq result 'article) 'article))) |
17493 | 4012 ;; It was a pseudo. |
4013 (t article))) | |
4014 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4015 ;; 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
|
4016 (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
|
4017 |
17493 | 4018 ;; Take the article from the original article buffer |
4019 ;; and place it in the buffer it's supposed to be in. | |
4020 (when (and (get-buffer gnus-article-buffer) | |
4021 (equal (buffer-name (current-buffer)) | |
4022 (buffer-name (get-buffer gnus-article-buffer)))) | |
4023 (save-excursion | |
4024 (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
|
4025 (set-buffer gnus-original-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4026 (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
|
4027 (buffer-disable-undo) |
17493 | 4028 (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
|
4029 (setq buffer-read-only t)) |
17493 | 4030 (let (buffer-read-only) |
4031 (erase-buffer) | |
4032 (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
|
4033 (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
|
4034 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4035 ;; Decode charsets. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4036 (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
|
4037 ;; 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
|
4038 (setq gnus-article-decoded-p gnus-article-decode-hook)) |
17493 | 4039 |
4040 ;; Update sparse articles. | |
4041 (when (and do-update-line | |
4042 (or (numberp article) | |
4043 (stringp article))) | |
4044 (let ((buf (current-buffer))) | |
4045 (set-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4046 (gnus-summary-update-article do-update-line sparse-header) |
17493 | 4047 (gnus-summary-goto-subject do-update-line nil t) |
4048 (set-window-point (get-buffer-window (current-buffer) t) | |
4049 (point)) | |
4050 (set-buffer buf)))))) | |
4051 | |
4052 ;;; | |
4053 ;;; Article editing | |
4054 ;;; | |
4055 | |
4056 (defcustom gnus-article-edit-mode-hook nil | |
4057 "Hook run in article edit mode buffers." | |
4058 :group 'gnus-article-various | |
4059 :type 'hook) | |
4060 | |
4061 (defvar gnus-article-edit-done-function nil) | |
4062 | |
4063 (defvar gnus-article-edit-mode-map nil) | |
4064 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4065 ;; Should we be using derived.el for this? |
17493 | 4066 (unless gnus-article-edit-mode-map |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4067 (setq gnus-article-edit-mode-map (make-sparse-keymap)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4068 (set-keymap-parent gnus-article-edit-mode-map text-mode-map) |
17493 | 4069 |
4070 (gnus-define-keys gnus-article-edit-mode-map | |
4071 "\C-c\C-c" gnus-article-edit-done | |
4072 "\C-c\C-k" gnus-article-edit-exit) | |
4073 | |
4074 (gnus-define-keys (gnus-article-edit-wash-map | |
4075 "\C-c\C-w" gnus-article-edit-mode-map) | |
4076 "f" gnus-article-edit-full-stops)) | |
4077 | |
4078 (defun gnus-article-edit-mode () | |
4079 "Major mode for editing articles. | |
4080 This is an extended text-mode. | |
4081 | |
4082 \\{gnus-article-edit-mode-map}" | |
4083 (interactive) | |
4084 (setq major-mode 'gnus-article-edit-mode) | |
4085 (setq mode-name "Article Edit") | |
4086 (use-local-map gnus-article-edit-mode-map) | |
4087 (make-local-variable 'gnus-article-edit-done-function) | |
4088 (make-local-variable 'gnus-prev-winconf) | |
4089 (setq buffer-read-only nil) | |
4090 (buffer-enable-undo) | |
4091 (widen) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4092 (gnus-run-hooks 'text-mode-hook 'gnus-article-edit-mode-hook)) |
17493 | 4093 |
4094 (defun gnus-article-edit (&optional force) | |
4095 "Edit the current article. | |
4096 This will have permanent effect only in mail groups. | |
4097 If FORCE is non-nil, allow editing of articles even in read-only | |
4098 groups." | |
4099 (interactive "P") | |
4100 (when (and (not force) | |
4101 (gnus-group-read-only-p)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4102 (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
|
4103 (gnus-article-date-original) |
17493 | 4104 (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
|
4105 'ignore |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4106 `(lambda (no-highlight) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4107 'ignore |
17493 | 4108 (gnus-summary-edit-article-done |
4109 ,(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
|
4110 ,(gnus-group-read-only-p) ,gnus-summary-buffer no-highlight)))) |
17493 | 4111 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4112 (defun gnus-article-edit-article (start-func exit-func) |
17493 | 4113 "Start editing the contents of the current article buffer." |
4114 (let ((winconf (current-window-configuration))) | |
4115 (set-buffer gnus-article-buffer) | |
4116 (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
|
4117 (funcall start-func) |
17493 | 4118 (gnus-configure-windows 'edit-article) |
4119 (setq gnus-article-edit-done-function exit-func) | |
4120 (setq gnus-prev-winconf winconf) | |
4121 (gnus-message 6 "C-c C-c to end edits"))) | |
4122 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4123 (defun gnus-article-edit-done (&optional arg) |
17493 | 4124 "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
|
4125 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4126 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4127 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4128 (widen) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4129 (when (article-goto-body) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4130 (let ((lines (count-lines (point) (point-max))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4131 (length (- (point-max) (point))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4132 (case-fold-search t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4133 (body (copy-marker (point)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4134 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4135 (when (re-search-forward "^content-length:[ \t]\\([0-9]+\\)" body t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4136 (delete-region (match-beginning 1) (match-end 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4137 (insert (number-to-string length))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4138 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4139 (when (re-search-forward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4140 "^x-content-length:[ \t]\\([0-9]+\\)" body t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4141 (delete-region (match-beginning 1) (match-end 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4142 (insert (number-to-string length))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4143 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4144 (when (re-search-forward "^lines:[ \t]\\([0-9]+\\)" body t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4145 (delete-region (match-beginning 1) (match-end 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4146 (insert (number-to-string lines))))))) |
17493 | 4147 (let ((func gnus-article-edit-done-function) |
4148 (buf (current-buffer)) | |
4149 (start (window-start))) | |
4150 (gnus-article-edit-exit) | |
4151 (save-excursion | |
4152 (set-buffer buf) | |
4153 (let ((buffer-read-only nil)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4154 (funcall func arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4155 ;; The cache and backlog have to be flushed somewhat. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4156 (when gnus-keep-backlog |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4157 (gnus-backlog-remove-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4158 (car gnus-article-current) (cdr gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4159 ;; Flush original article as well. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4160 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4161 (when (get-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4162 (set-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4163 (setq gnus-original-article nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4164 (when gnus-use-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4165 (gnus-cache-update-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4166 (car gnus-article-current) (cdr gnus-article-current)))) |
17493 | 4167 (set-buffer buf) |
4168 (set-window-start (get-buffer-window buf) start) | |
4169 (set-window-point (get-buffer-window buf) (point)))) | |
4170 | |
4171 (defun gnus-article-edit-exit () | |
4172 "Exit the article editing without updating." | |
4173 (interactive) | |
4174 ;; We remove all text props from the article buffer. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4175 (let ((buf (buffer-substring-no-properties (point-min) (point-max))) |
17493 | 4176 (curbuf (current-buffer)) |
4177 (p (point)) | |
4178 (window-start (window-start))) | |
4179 (erase-buffer) | |
4180 (insert buf) | |
4181 (let ((winconf gnus-prev-winconf)) | |
4182 (gnus-article-mode) | |
4183 (set-window-configuration winconf) | |
4184 ;; Tippy-toe some to make sure that point remains where it was. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4185 (save-current-buffer |
17493 | 4186 (set-buffer curbuf) |
4187 (set-window-start (get-buffer-window (current-buffer)) window-start) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4188 (goto-char p))))) |
17493 | 4189 |
4190 (defun gnus-article-edit-full-stops () | |
4191 "Interactively repair spacing at end of sentences." | |
4192 (interactive) | |
4193 (save-excursion | |
4194 (goto-char (point-min)) | |
4195 (search-forward-regexp "^$" nil t) | |
4196 (let ((case-fold-search nil)) | |
4197 (query-replace-regexp "\\([.!?][])}]* \\)\\([[({A-Z]\\)" "\\1 \\2")))) | |
4198 | |
4199 ;;; | |
4200 ;;; Article highlights | |
4201 ;;; | |
4202 | |
4203 ;; Written by Per Abrahamsen <abraham@iesd.auc.dk>. | |
4204 | |
4205 ;;; Internal Variables: | |
4206 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4207 (defcustom gnus-button-url-regexp "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\)\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?\\([-a-zA-Z0-9_=!?#$@~`%&*+|\\/:;.,]\\|\\w\\)+\\([-a-zA-Z0-9_=#$@~`%&*+|\\/]\\|\\w\\)\\)" |
17493 | 4208 "Regular expression that matches URLs." |
4209 :group 'gnus-article-buttons | |
4210 :type 'regexp) | |
4211 | |
4212 (defcustom gnus-button-alist | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4213 `(("<\\(url:[>\n\t ]*?\\)?news:[>\n\t ]*\\([^>\n\t ]*@[^>\n\t ]*\\)>" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4214 0 t gnus-button-message-id 2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4215 ("\\bnews:\\([^>\n\t ]*@[^>)!;:,\n\t ]*\\)" 0 t gnus-button-message-id 1) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4216 ("\\(\\b<\\(url:[>\n\t ]*\\)?news:[>\n\t ]*\\(//\\)?\\([^>\n\t ]*\\)>\\)" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4217 1 t |
17493 | 4218 gnus-button-fetch-group 4) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4219 ("\\bnews:\\(//\\)?\\([^'\">\n\t ]+\\)" 0 t gnus-button-fetch-group 2) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4220 ("\\bin\\( +article\\| +message\\)? +\\(<\\([^\n @<>]+@[^\n @<>]+\\)>\\)" 2 |
17493 | 4221 t gnus-button-message-id 3) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4222 ("\\(<URL: *\\)mailto: *\\([^> \n\t]+\\)>" 0 t gnus-url-mailto 2) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4223 ("mailto:\\([-a-zA-Z.@_+0-9%]+\\)" 0 t gnus-url-mailto 1) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4224 ("\\bmailto:\\([^ \n\t]+\\)" 0 t gnus-url-mailto 1) |
17493 | 4225 ;; This is how URLs _should_ be embedded in text... |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4226 ("<URL: *\\([^<>]*\\)>" 0 t gnus-button-embedded-url 1) |
17493 | 4227 ;; Raw URLs. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4228 (,gnus-button-url-regexp 0 t browse-url 0)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4229 "*Alist of regexps matching buttons in article bodies. |
17493 | 4230 |
4231 Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where | |
4232 REGEXP: is the string matching text around the button, | |
4233 BUTTON: is the number of the regexp grouping actually matching the button, | |
4234 FORM: is a lisp expression which must eval to true for the button to | |
4235 be added, | |
4236 CALLBACK: is the function to call when the user push this button, and each | |
4237 PAR: is a number of a regexp grouping whose text will be passed to CALLBACK. | |
4238 | |
4239 CALLBACK can also be a variable, in that case the value of that | |
4240 variable it the real callback function." | |
4241 :group 'gnus-article-buttons | |
4242 :type '(repeat (list regexp | |
4243 (integer :tag "Button") | |
4244 (sexp :tag "Form") | |
4245 (function :tag "Callback") | |
4246 (repeat :tag "Par" | |
4247 :inline t | |
4248 (integer :tag "Regexp group"))))) | |
4249 | |
4250 (defcustom gnus-header-button-alist | |
4251 `(("^\\(References\\|Message-I[Dd]\\):" "<[^>]+>" | |
4252 0 t gnus-button-message-id 0) | |
4253 ("^\\(From\\|Reply-To\\):" ": *\\(.+\\)$" 1 t gnus-button-reply 1) | |
4254 ("^\\(Cc\\|To\\):" "[^ \t\n<>,()\"]+@[^ \t\n<>,()\"]+" | |
4255 0 t gnus-button-mailto 0) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4256 ("^X-[Uu][Rr][Ll]:" ,gnus-button-url-regexp 0 t browse-url 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4257 ("^Subject:" ,gnus-button-url-regexp 0 t browse-url 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4258 ("^[^:]+:" ,gnus-button-url-regexp 0 t browse-url 0) |
17493 | 4259 ("^[^:]+:" "\\(<\\(url: \\)?news:\\([^>\n ]*\\)>\\)" 1 t |
4260 gnus-button-message-id 3)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4261 "*Alist of headers and regexps to match buttons in article heads. |
17493 | 4262 |
4263 This alist is very similar to `gnus-button-alist', except that each | |
4264 alist has an additional HEADER element first in each entry: | |
4265 | |
4266 \(HEADER REGEXP BUTTON FORM CALLBACK PAR) | |
4267 | |
4268 HEADER is a regexp to match a header. For a fuller explanation, see | |
4269 `gnus-button-alist'." | |
4270 :group 'gnus-article-buttons | |
4271 :group 'gnus-article-headers | |
4272 :type '(repeat (list (regexp :tag "Header") | |
4273 regexp | |
4274 (integer :tag "Button") | |
4275 (sexp :tag "Form") | |
4276 (function :tag "Callback") | |
4277 (repeat :tag "Par" | |
4278 :inline t | |
4279 (integer :tag "Regexp group"))))) | |
4280 | |
4281 (defvar gnus-button-regexp nil) | |
4282 (defvar gnus-button-marker-list nil) | |
4283 ;; Regexp matching any of the regexps from `gnus-button-alist'. | |
4284 | |
4285 (defvar gnus-button-last nil) | |
4286 ;; The value of `gnus-button-alist' when `gnus-button-regexp' was build. | |
4287 | |
4288 ;;; Commands: | |
4289 | |
4290 (defun gnus-article-push-button (event) | |
4291 "Check text under the mouse pointer for a callback function. | |
4292 If the text under the mouse pointer has a `gnus-callback' property, | |
4293 call it with the value of the `gnus-data' text property." | |
4294 (interactive "e") | |
4295 (set-buffer (window-buffer (posn-window (event-start event)))) | |
4296 (let* ((pos (posn-point (event-start event))) | |
4297 (data (get-text-property pos 'gnus-data)) | |
4298 (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
|
4299 (goto-char pos) |
17493 | 4300 (when fun |
4301 (funcall fun data)))) | |
4302 | |
4303 (defun gnus-article-press-button () | |
4304 "Check text at point for a callback function. | |
4305 If the text at point has a `gnus-callback' property, | |
4306 call it with the value of the `gnus-data' text property." | |
4307 (interactive) | |
4308 (let* ((data (get-text-property (point) 'gnus-data)) | |
4309 (fun (get-text-property (point) 'gnus-callback))) | |
4310 (when fun | |
4311 (funcall fun data)))) | |
4312 | |
4313 (defun gnus-article-highlight (&optional force) | |
4314 "Highlight current article. | |
4315 This function calls `gnus-article-highlight-headers', | |
4316 `gnus-article-highlight-citation', | |
4317 `gnus-article-highlight-signature', and `gnus-article-add-buttons' to | |
4318 do the highlighting. See the documentation for those functions." | |
4319 (interactive (list 'force)) | |
4320 (gnus-article-highlight-headers) | |
4321 (gnus-article-highlight-citation force) | |
4322 (gnus-article-highlight-signature) | |
4323 (gnus-article-add-buttons force) | |
4324 (gnus-article-add-buttons-to-head)) | |
4325 | |
4326 (defun gnus-article-highlight-some (&optional force) | |
4327 "Highlight current article. | |
4328 This function calls `gnus-article-highlight-headers', | |
4329 `gnus-article-highlight-signature', and `gnus-article-add-buttons' to | |
4330 do the highlighting. See the documentation for those functions." | |
4331 (interactive (list 'force)) | |
4332 (gnus-article-highlight-headers) | |
4333 (gnus-article-highlight-signature) | |
4334 (gnus-article-add-buttons)) | |
4335 | |
4336 (defun gnus-article-highlight-headers () | |
4337 "Highlight article headers as specified by `gnus-header-face-alist'." | |
4338 (interactive) | |
4339 (save-excursion | |
4340 (set-buffer gnus-article-buffer) | |
4341 (save-restriction | |
4342 (let ((alist gnus-header-face-alist) | |
4343 (buffer-read-only nil) | |
4344 (case-fold-search t) | |
4345 (inhibit-point-motion-hooks t) | |
4346 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
|
4347 (article-narrow-to-head) |
17493 | 4348 (while (setq entry (pop alist)) |
4349 (goto-char (point-min)) | |
4350 (setq regexp (concat "^\\(" | |
4351 (if (string-equal "" (nth 0 entry)) | |
4352 "[^\t ]" | |
4353 (nth 0 entry)) | |
4354 "\\)") | |
4355 header-face (nth 1 entry) | |
4356 field-face (nth 2 entry)) | |
4357 (while (and (re-search-forward regexp nil t) | |
4358 (not (eobp))) | |
4359 (beginning-of-line) | |
4360 (setq from (point)) | |
4361 (unless (search-forward ":" nil t) | |
4362 (forward-char 1)) | |
4363 (when (and header-face | |
4364 (not (memq (point) hpoints))) | |
4365 (push (point) hpoints) | |
4366 (gnus-put-text-property from (point) 'face header-face)) | |
4367 (when (and field-face | |
4368 (not (memq (setq from (point)) fpoints))) | |
4369 (push from fpoints) | |
4370 (if (re-search-forward "^[^ \t]" nil t) | |
4371 (forward-char -2) | |
4372 (goto-char (point-max))) | |
4373 (gnus-put-text-property from (point) 'face field-face)))))))) | |
4374 | |
4375 (defun gnus-article-highlight-signature () | |
4376 "Highlight the signature in an article. | |
4377 It does this by highlighting everything after | |
4378 `gnus-signature-separator' using `gnus-signature-face'." | |
4379 (interactive) | |
4380 (save-excursion | |
4381 (set-buffer gnus-article-buffer) | |
4382 (let ((buffer-read-only nil) | |
4383 (inhibit-point-motion-hooks t)) | |
4384 (save-restriction | |
4385 (when (and gnus-signature-face | |
4386 (gnus-article-narrow-to-signature)) | |
4387 (gnus-overlay-put (gnus-make-overlay (point-min) (point-max)) | |
4388 'face gnus-signature-face) | |
4389 (widen) | |
4390 (gnus-article-search-signature) | |
4391 (let ((start (match-beginning 0)) | |
4392 (end (set-marker (make-marker) (1+ (match-end 0))))) | |
4393 (gnus-article-add-button start (1- end) 'gnus-signature-toggle | |
4394 end))))))) | |
4395 | |
4396 (defun gnus-button-in-region-p (b e prop) | |
4397 "Say whether PROP exists in the region." | |
4398 (text-property-not-all b e prop nil)) | |
4399 | |
4400 (defun gnus-article-add-buttons (&optional force) | |
4401 "Find external references in the article and make buttons of them. | |
4402 \"External references\" are things like Message-IDs and URLs, as | |
4403 specified by `gnus-button-alist'." | |
4404 (interactive (list 'force)) | |
4405 (save-excursion | |
4406 (set-buffer gnus-article-buffer) | |
4407 (let ((buffer-read-only nil) | |
4408 (inhibit-point-motion-hooks t) | |
4409 (case-fold-search t) | |
4410 (alist gnus-button-alist) | |
4411 beg entry regexp) | |
4412 ;; 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
|
4413 (let (marker entry new-list) |
17493 | 4414 (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
|
4415 (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
|
4416 (push marker new-list) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4417 (goto-char marker) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4418 (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
|
4419 (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
|
4420 (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
|
4421 'gnus-callback nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4422 (set-marker marker nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4423 (setq gnus-button-marker-list new-list)) |
17493 | 4424 ;; 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
|
4425 (article-goto-body) |
17493 | 4426 (setq beg (point)) |
4427 (while (setq entry (pop alist)) | |
4428 (setq regexp (car entry)) | |
4429 (goto-char beg) | |
4430 (while (re-search-forward regexp nil t) | |
4431 (let* ((start (and entry (match-beginning (nth 1 entry)))) | |
4432 (end (and entry (match-end (nth 1 entry)))) | |
4433 (from (match-beginning 0))) | |
4434 (when (and (or (eq t (nth 2 entry)) | |
4435 (eval (nth 2 entry))) | |
4436 (not (gnus-button-in-region-p | |
4437 start end 'gnus-callback))) | |
4438 ;; That optional form returned non-nil, so we add the | |
4439 ;; button. | |
4440 (gnus-article-add-button | |
4441 start end 'gnus-button-push | |
4442 (car (push (set-marker (make-marker) from) | |
4443 gnus-button-marker-list)))))))))) | |
4444 | |
4445 ;; Add buttons to the head of an article. | |
4446 (defun gnus-article-add-buttons-to-head () | |
4447 "Add buttons to the head of the article." | |
4448 (interactive) | |
4449 (save-excursion | |
4450 (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
|
4451 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4452 (let ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4453 (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
|
4454 (case-fold-search t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4455 (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
|
4456 entry beg end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4457 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4458 (while alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4459 ;; Each alist entry. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4460 (setq entry (car alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4461 alist (cdr alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4462 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4463 (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
|
4464 ;; 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
|
4465 (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
|
4466 (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
|
4467 (match-beginning 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4468 (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4469 (goto-char beg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4470 (while (re-search-forward (nth 1 entry) end t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4471 ;; 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
|
4472 (let* ((entry (cdr entry)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4473 (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
|
4474 (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
|
4475 (form (nth 2 entry))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4476 (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
|
4477 (when (eval form) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4478 (gnus-article-add-button |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4479 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
|
4480 (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
|
4481 (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
|
4482 (goto-char end))))))) |
17493 | 4483 |
4484 ;;; External functions: | |
4485 | |
4486 (defun gnus-article-add-button (from to fun &optional data) | |
4487 "Create a button between FROM and TO with callback FUN and data DATA." | |
4488 (when gnus-article-button-face | |
4489 (gnus-overlay-put (gnus-make-overlay from to) | |
4490 'face gnus-article-button-face)) | |
4491 (gnus-add-text-properties | |
4492 from to | |
4493 (nconc (and gnus-article-mouse-face | |
4494 (list gnus-mouse-face-prop gnus-article-mouse-face)) | |
4495 (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
|
4496 (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
|
4497 (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
|
4498 :button-keymap gnus-widget-button-keymap)) |
17493 | 4499 |
4500 ;;; Internal functions: | |
4501 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4502 (defun gnus-article-set-globals () |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4503 (save-excursion |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4504 (set-buffer gnus-summary-buffer) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4505 (gnus-set-global-variables))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19537
diff
changeset
|
4506 |
17493 | 4507 (defun gnus-signature-toggle (end) |
4508 (save-excursion | |
4509 (set-buffer gnus-article-buffer) | |
4510 (let ((buffer-read-only nil) | |
4511 (inhibit-point-motion-hooks t)) | |
4512 (if (get-text-property end 'invisible) | |
4513 (gnus-article-unhide-text end (point-max)) | |
4514 (gnus-article-hide-text end (point-max) gnus-hidden-properties))))) | |
4515 | |
4516 (defun gnus-button-entry () | |
4517 ;; Return the first entry in `gnus-button-alist' matching this place. | |
4518 (let ((alist gnus-button-alist) | |
4519 (entry nil)) | |
4520 (while alist | |
4521 (setq entry (pop alist)) | |
4522 (if (looking-at (car entry)) | |
4523 (setq alist nil) | |
4524 (setq entry nil))) | |
4525 entry)) | |
4526 | |
4527 (defun gnus-button-push (marker) | |
4528 ;; Push button starting at MARKER. | |
4529 (save-excursion | |
4530 (goto-char marker) | |
4531 (let* ((entry (gnus-button-entry)) | |
4532 (inhibit-point-motion-hooks t) | |
4533 (fun (nth 3 entry)) | |
4534 (args (mapcar (lambda (group) | |
4535 (let ((string (match-string group))) | |
4536 (gnus-set-text-properties | |
4537 0 (length string) nil string) | |
4538 string)) | |
4539 (nthcdr 4 entry)))) | |
4540 (cond | |
4541 ((fboundp fun) | |
4542 (apply fun args)) | |
4543 ((and (boundp fun) | |
4544 (fboundp (symbol-value fun))) | |
4545 (apply (symbol-value fun) args)) | |
4546 (t | |
4547 (gnus-message 1 "You must define `%S' to use this button" | |
4548 (cons fun args))))))) | |
4549 | |
4550 (defun gnus-button-message-id (message-id) | |
4551 "Fetch MESSAGE-ID." | |
4552 (save-excursion | |
4553 (set-buffer gnus-summary-buffer) | |
4554 (gnus-summary-refer-article message-id))) | |
4555 | |
4556 (defun gnus-button-fetch-group (address) | |
4557 "Fetch GROUP specified by ADDRESS." | |
4558 (if (not (string-match "[:/]" address)) | |
4559 ;; This is just a simple group url. | |
4560 (gnus-group-read-ephemeral-group address gnus-select-method) | |
4561 (if (not (string-match "^\\([^:/]+\\)\\(:\\([^/]+\\)/\\)?\\(.*\\)$" | |
4562 address)) | |
4563 (error "Can't parse %s" address) | |
4564 (gnus-group-read-ephemeral-group | |
4565 (match-string 4 address) | |
4566 `(nntp ,(match-string 1 address) | |
4567 (nntp-address ,(match-string 1 address)) | |
4568 (nntp-port-number ,(if (match-end 3) | |
4569 (match-string 3 address) | |
4570 "nntp"))))))) | |
4571 | |
4572 (defun gnus-url-parse-query-string (query &optional downcase) | |
4573 (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
|
4574 (setq pairs (split-string query "&")) |
17493 | 4575 (while pairs |
4576 (setq cur (car pairs) | |
4577 pairs (cdr pairs)) | |
4578 (if (not (string-match "=" cur)) | |
4579 nil ; Grace | |
4580 (setq key (gnus-url-unhex-string (substring cur 0 (match-beginning 0))) | |
4581 val (gnus-url-unhex-string (substring cur (match-end 0) nil))) | |
4582 (if downcase | |
4583 (setq key (downcase key))) | |
4584 (setq cur (assoc key retval)) | |
4585 (if cur | |
4586 (setcdr cur (cons val (cdr cur))) | |
4587 (setq retval (cons (list key val) retval))))) | |
4588 retval)) | |
4589 | |
4590 (defun gnus-url-unhex (x) | |
4591 (if (> x ?9) | |
4592 (if (>= x ?a) | |
4593 (+ 10 (- x ?a)) | |
4594 (+ 10 (- x ?A))) | |
4595 (- x ?0))) | |
4596 | |
4597 (defun gnus-url-unhex-string (str &optional allow-newlines) | |
4598 "Remove %XXX embedded spaces, etc in a url. | |
4599 If optional second argument ALLOW-NEWLINES is non-nil, then allow the | |
4600 decoding of carriage returns and line feeds in the string, which is normally | |
4601 forbidden in URL encoding." | |
4602 (setq str (or str "")) | |
4603 (let ((tmp "") | |
4604 (case-fold-search t)) | |
4605 (while (string-match "%[0-9a-f][0-9a-f]" str) | |
4606 (let* ((start (match-beginning 0)) | |
4607 (ch1 (gnus-url-unhex (elt str (+ start 1)))) | |
4608 (code (+ (* 16 ch1) | |
4609 (gnus-url-unhex (elt str (+ start 2)))))) | |
4610 (setq tmp (concat | |
4611 tmp (substring str 0 start) | |
4612 (cond | |
4613 (allow-newlines | |
4614 (char-to-string code)) | |
4615 ((or (= code ?\n) (= code ?\r)) | |
4616 " ") | |
4617 (t (char-to-string code)))) | |
4618 str (substring str (match-end 0))))) | |
4619 (setq tmp (concat tmp str)) | |
4620 tmp)) | |
4621 | |
4622 (defun gnus-url-mailto (url) | |
4623 ;; Send mail to someone | |
4624 (when (string-match "mailto:/*\\(.*\\)" url) | |
4625 (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
|
4626 (let (to args subject func) |
17493 | 4627 (if (string-match (regexp-quote "?") url) |
4628 (setq to (gnus-url-unhex-string (substring url 0 (match-beginning 0))) | |
4629 args (gnus-url-parse-query-string | |
4630 (substring url (match-end 0) nil) t)) | |
4631 (setq to (gnus-url-unhex-string url))) | |
4632 (setq args (cons (list "to" to) args) | |
4633 subject (cdr-safe (assoc "subject" args))) | |
4634 (message-mail) | |
4635 (while args | |
4636 (setq func (intern-soft (concat "message-goto-" (downcase (caar args))))) | |
4637 (if (fboundp func) | |
4638 (funcall func) | |
4639 (message-position-on-field (caar args))) | |
4640 (insert (mapconcat 'identity (cdar args) ", ")) | |
4641 (setq args (cdr args))) | |
4642 (if subject | |
4643 (message-goto-body) | |
4644 (message-goto-subject)))) | |
4645 | |
4646 (defun gnus-button-mailto (address) | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4647 "Mail to ADDRESS." |
17493 | 4648 (set-buffer (gnus-copy-article-buffer)) |
4649 (message-reply address)) | |
4650 | |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4651 (defalias 'gnus-button-reply 'message-reply) |
17493 | 4652 |
4653 (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
|
4654 "Activate ADDRESS with `browse-url'." |
23608
3805e63b8caf
(gnus-button-embedded-url, gnus-button-url):
Dave Love <fx@gnu.org>
parents:
23361
diff
changeset
|
4655 (browse-url (gnus-strip-whitespace address))) |
17493 | 4656 |
4657 ;;; Next/prev buttons in the article buffer. | |
4658 | |
4659 (defvar gnus-next-page-line-format "%{%(Next page...%)%}\n") | |
4660 (defvar gnus-prev-page-line-format "%{%(Previous page...%)%}\n") | |
4661 | |
4662 (defvar gnus-prev-page-map nil) | |
4663 (unless gnus-prev-page-map | |
4664 (setq gnus-prev-page-map (make-sparse-keymap)) | |
4665 (define-key gnus-prev-page-map gnus-mouse-2 'gnus-button-prev-page) | |
4666 (define-key gnus-prev-page-map "\r" 'gnus-button-prev-page)) | |
4667 | |
4668 (defun gnus-insert-prev-page-button () | |
4669 (let ((buffer-read-only nil)) | |
4670 (gnus-eval-format | |
4671 gnus-prev-page-line-format nil | |
4672 `(gnus-prev t local-map ,gnus-prev-page-map | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4673 gnus-callback gnus-article-button-prev-page |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4674 article-type annotation)))) |
17493 | 4675 |
4676 (defvar gnus-next-page-map nil) | |
4677 (unless gnus-next-page-map | |
4678 (setq gnus-next-page-map (make-keymap)) | |
4679 (suppress-keymap gnus-prev-page-map) | |
4680 (define-key gnus-next-page-map gnus-mouse-2 'gnus-button-next-page) | |
4681 (define-key gnus-next-page-map "\r" 'gnus-button-next-page)) | |
4682 | |
4683 (defun gnus-button-next-page () | |
4684 "Go to the next page." | |
4685 (interactive) | |
4686 (let ((win (selected-window))) | |
4687 (select-window (get-buffer-window gnus-article-buffer t)) | |
4688 (gnus-article-next-page) | |
4689 (select-window win))) | |
4690 | |
4691 (defun gnus-button-prev-page () | |
4692 "Go to the prev page." | |
4693 (interactive) | |
4694 (let ((win (selected-window))) | |
4695 (select-window (get-buffer-window gnus-article-buffer t)) | |
4696 (gnus-article-prev-page) | |
4697 (select-window win))) | |
4698 | |
4699 (defun gnus-insert-next-page-button () | |
4700 (let ((buffer-read-only nil)) | |
4701 (gnus-eval-format gnus-next-page-line-format nil | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4702 `(gnus-next |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4703 t local-map ,gnus-next-page-map |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23608
diff
changeset
|
4704 gnus-callback gnus-article-button-next-page |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4705 article-type annotation)))) |
17493 | 4706 |
4707 (defun gnus-article-button-next-page (arg) | |
4708 "Go to the next page." | |
4709 (interactive "P") | |
4710 (let ((win (selected-window))) | |
4711 (select-window (get-buffer-window gnus-article-buffer t)) | |
4712 (gnus-article-next-page) | |
4713 (select-window win))) | |
4714 | |
4715 (defun gnus-article-button-prev-page (arg) | |
4716 "Go to the prev page." | |
4717 (interactive "P") | |
4718 (let ((win (selected-window))) | |
4719 (select-window (get-buffer-window gnus-article-buffer t)) | |
4720 (gnus-article-prev-page) | |
4721 (select-window win))) | |
4722 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4723 (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
|
4724 '(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
|
4725 "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
|
4726 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4727 This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4728 is FUNCTION, FUNCTION will be apply to all newsgroups. If item is a |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4729 (REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4730 whose names match REGEXP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4731 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4732 For example: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4733 ((\"chinese\" . gnus-decode-encoded-word-region-by-guess) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4734 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
|
4735 (\"chinese\" . rfc1843-decode-region)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4736 ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4737 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4738 (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
|
4739 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4740 (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
|
4741 "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
|
4742 (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
|
4743 (eq gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4744 (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
|
4745 (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
|
4746 (mapcar (lambda (x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4747 (if (symbolp x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4748 (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
|
4749 (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
|
4750 (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
|
4751 (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
|
4752 (list (cdr x)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4753 gnus-decode-header-methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4754 (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
|
4755 (pop xlist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4756 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4757 (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
|
4758 (while xlist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4759 (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
|
4760 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4761 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4762 ;;; Treatment top-level handling. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4763 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4764 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4765 (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
|
4766 (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
|
4767 (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
|
4768 (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
|
4769 (treated-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4770 (or (not type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4771 (catch 'found |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4772 (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
|
4773 (while list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4774 (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
|
4775 (throw 'found t))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4776 (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
|
4777 val elem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4778 (gnus-run-hooks 'gnus-part-display-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4779 (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
|
4780 (setq val |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4781 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4782 (if (gnus-buffer-live-p gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4783 (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
|
4784 (symbol-value (car elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4785 (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
|
4786 treated-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4787 (gnus-treat-predicate val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4788 (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
|
4789 highlightp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4790 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4791 (funcall (cadr elem))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4792 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4793 ;; Dynamic variables. |
32993
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4794 (eval-when-compile |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4795 (defvar part-number) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4796 (defvar total-parts) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4797 (defvar type) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4798 (defvar condition) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4799 (defvar length)) |
ce95094f21e7
2000-10-27 John Wiegley <johnw@gnu.org>
Dave Love <fx@gnu.org>
parents:
32939
diff
changeset
|
4800 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4801 (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
|
4802 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4803 ((null val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4804 nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4805 ((and (listp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4806 (stringp (car val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4807 (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
|
4808 (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
|
4809 val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4810 ((listp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4811 (let ((pred (pop val))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4812 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4813 ((eq pred 'or) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4814 (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
|
4815 ((eq pred 'and) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4816 (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
|
4817 ((eq pred 'not) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4818 (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
|
4819 ((eq pred 'typep) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4820 (equal (car val) type)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4821 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4822 (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
|
4823 (condition |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4824 (eq condition val)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4825 ((eq val t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4826 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4827 ((eq val 'head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4828 nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4829 ((eq val 'last) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4830 (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
|
4831 ((numberp val) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4832 (< length val)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4833 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25382
diff
changeset
|
4834 (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
|
4835 |
17493 | 4836 (gnus-ems-redefine) |
4837 | |
4838 (provide 'gnus-art) | |
4839 | |
4840 (run-hooks 'gnus-art-load-hook) | |
4841 | |
4842 ;;; gnus-art.el ends here |