Mercurial > emacs
annotate lisp/gnus/gnus-uu.el @ 36246:fd61c05ce91c
Add index entries for Follow mode.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 20 Feb 2001 22:00:38 +0000 |
parents | a35d9c07d074 |
children | e11fd97820c0 |
rev | line source |
---|---|
17493 | 1 ;;; gnus-uu.el --- extract (uu)encoded files in Gnus |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
2 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 2000, |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
3 ;; 2001 Free Software Foundation, Inc. |
17493 | 4 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 6 ;; Created: 2 Oct 1993 |
7 ;; Keyword: news | |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;;; Code: | |
29 | |
19634
118761d47324
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
118761d47324
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
31 |
17493 | 32 (require 'gnus) |
33 (require 'gnus-art) | |
34 (require 'message) | |
35 (require 'gnus-msg) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
36 (require 'mm-decode) |
17493 | 37 |
38 (defgroup gnus-extract nil | |
39 "Extracting encoded files." | |
40 :prefix "gnus-uu-" | |
41 :group 'gnus) | |
42 | |
43 (defgroup gnus-extract-view nil | |
44 "Viewwing extracted files." | |
45 :group 'gnus-extract) | |
46 | |
47 (defgroup gnus-extract-archive nil | |
48 "Extracting encoded archives." | |
49 :group 'gnus-extract) | |
50 | |
51 (defgroup gnus-extract-post nil | |
52 "Extracting encoded archives." | |
53 :prefix "gnus-uu-post" | |
54 :group 'gnus-extract) | |
55 | |
56 ;; Default viewing action rules | |
57 | |
58 (defcustom gnus-uu-default-view-rules | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
59 '(("\\.te?xt$\\|\\.doc$\\|read.*me\\|\\.c?$\\|\\.h$\\|\\.bat$\\|\\.asm$\\|makefile" "cat %s | sed 's/\r$//'") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
60 ("\\.pas$" "cat %s | sed 's/\r$//'") |
17493 | 61 ("\\.[1-9]$" "groff -mandoc -Tascii %s | sed s/\b.//g") |
29734
afc9d8eb0666
(gnus-uu-default-view-rules): Don't use `xv'.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
62 ("\\.\\(jpe?g\\|gif\\|tiff?\\|p[pgb]m\\|xwd\\|xbm\\|pcx\\)$" "display") |
afc9d8eb0666
(gnus-uu-default-view-rules): Don't use `xv'.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
63 ("\\.tga$" "tgatoppm %s | ee -") |
17493 | 64 ("\\.\\(wav\\|aiff\\|hcom\\|u[blw]\\|s[bfw]\\|voc\\|smp\\)$" |
65 "sox -v .5 %s -t .au -u - > /dev/audio") | |
66 ("\\.au$" "cat %s > /dev/audio") | |
67 ("\\.midi?$" "playmidi -f") | |
68 ("\\.mod$" "str32") | |
69 ("\\.ps$" "ghostview") | |
70 ("\\.dvi$" "xdvi") | |
71 ("\\.html$" "xmosaic") | |
72 ("\\.mpe?g$" "mpeg_play") | |
73 ("\\.\\(flc\\|fli\\|rle\\|iff\\|pfx\\|avi\\|sme\\|rpza\\|dl\\|qt\\|rsrc\\|mov\\)$" "xanim") | |
74 ("\\.\\(tar\\|arj\\|zip\\|zoo\\|arc\\|gz\\|Z\\|lzh\\|ar\\|lha\\)$" | |
75 "gnus-uu-archive")) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
76 "*Default actions to be taken when the user asks to view a file. |
17493 | 77 To change the behaviour, you can either edit this variable or set |
78 `gnus-uu-user-view-rules' to something useful. | |
79 | |
80 For example: | |
81 | |
82 To make gnus-uu use 'xli' to display JPEG and GIF files, put the | |
83 following in your .emacs file: | |
84 | |
85 (setq gnus-uu-user-view-rules '((\"jpg$\\\\|gif$\" \"xli\"))) | |
86 | |
87 Both these variables are lists of lists with two string elements. The | |
88 first string is a regular expression. If the file name matches this | |
89 regular expression, the command in the second string is executed with | |
90 the file as an argument. | |
91 | |
92 If the command string contains \"%s\", the file name will be inserted | |
93 at that point in the command string. If there's no \"%s\" in the | |
94 command string, the file name will be appended to the command string | |
95 before executing. | |
96 | |
97 There are several user variables to tailor the behaviour of gnus-uu to | |
98 your needs. First we have `gnus-uu-user-view-rules', which is the | |
99 variable gnus-uu first consults when trying to decide how to view a | |
100 file. If this variable contains no matches, gnus-uu examines the | |
101 default rule variable provided in this package. If gnus-uu finds no | |
102 match here, it uses `gnus-uu-user-view-rules-end' to try to make a | |
103 match." | |
104 :group 'gnus-extract-view | |
105 :type '(repeat (group regexp (string :tag "Command")))) | |
106 | |
107 (defcustom gnus-uu-user-view-rules nil | |
108 "What actions are to be taken to view a file. | |
109 See the documentation on the `gnus-uu-default-view-rules' variable for | |
110 details." | |
111 :group 'gnus-extract-view | |
112 :type '(repeat (group regexp (string :tag "Command")))) | |
113 | |
114 (defcustom gnus-uu-user-view-rules-end | |
115 '(("" "file")) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
116 "*What actions are to be taken if no rule matched the file name. |
17493 | 117 See the documentation on the `gnus-uu-default-view-rules' variable for |
118 details." | |
119 :group 'gnus-extract-view | |
120 :type '(repeat (group regexp (string :tag "Command")))) | |
121 | |
122 ;; Default unpacking commands | |
123 | |
124 (defcustom gnus-uu-default-archive-rules | |
125 '(("\\.tar$" "tar xf") | |
126 ("\\.zip$" "unzip -o") | |
127 ("\\.ar$" "ar x") | |
128 ("\\.arj$" "unarj x") | |
129 ("\\.zoo$" "zoo -e") | |
130 ("\\.\\(lzh\\|lha\\)$" "lha x") | |
131 ("\\.Z$" "uncompress") | |
132 ("\\.gz$" "gunzip") | |
133 ("\\.arc$" "arc -x")) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
134 "*See `gnus-uu-user-archive-rules'." |
17493 | 135 :group 'gnus-extract-archive |
136 :type '(repeat (group regexp (string :tag "Command")))) | |
137 | |
138 (defvar gnus-uu-destructive-archivers | |
139 (list "uncompress" "gunzip")) | |
140 | |
141 (defcustom gnus-uu-user-archive-rules nil | |
142 "A list that can be set to override the default archive unpacking commands. | |
143 To use, for instance, 'untar' to unpack tar files and 'zip -x' to | |
144 unpack zip files, say the following: | |
145 (setq gnus-uu-user-archive-rules | |
146 '((\"\\\\.tar$\" \"untar\") | |
147 (\"\\\\.zip$\" \"zip -x\")))" | |
148 :group 'gnus-extract-archive | |
149 :type '(repeat (group regexp (string :tag "Command")))) | |
150 | |
151 (defcustom gnus-uu-ignore-files-by-name nil | |
152 "*A regular expression saying what files should not be viewed based on name. | |
153 If, for instance, you want gnus-uu to ignore all .au and .wav files, | |
154 you could say something like | |
155 | |
156 (setq gnus-uu-ignore-files-by-name \"\\\\.au$\\\\|\\\\.wav$\") | |
157 | |
158 Note that this variable can be used in conjunction with the | |
159 `gnus-uu-ignore-files-by-type' variable." | |
160 :group 'gnus-extract | |
161 :type '(choice (const :tag "off" nil) | |
162 (regexp :format "%v"))) | |
163 | |
164 (defcustom gnus-uu-ignore-files-by-type nil | |
165 "*A regular expression saying what files that shouldn't be viewed, based on MIME file type. | |
166 If, for instance, you want gnus-uu to ignore all audio files and all mpegs, | |
167 you could say something like | |
168 | |
169 (setq gnus-uu-ignore-files-by-type \"audio/\\\\|video/mpeg\") | |
170 | |
171 Note that this variable can be used in conjunction with the | |
172 `gnus-uu-ignore-files-by-name' variable." | |
173 :group 'gnus-extract | |
174 :type '(choice (const :tag "off" nil) | |
175 (regexp :format "%v"))) | |
176 | |
177 ;; Pseudo-MIME support | |
178 | |
179 (defconst gnus-uu-ext-to-mime-list | |
180 '(("\\.gif$" "image/gif") | |
181 ("\\.jpe?g$" "image/jpeg") | |
182 ("\\.tiff?$" "image/tiff") | |
183 ("\\.xwd$" "image/xwd") | |
184 ("\\.pbm$" "image/pbm") | |
185 ("\\.pgm$" "image/pgm") | |
186 ("\\.ppm$" "image/ppm") | |
187 ("\\.xbm$" "image/xbm") | |
188 ("\\.pcx$" "image/pcx") | |
189 ("\\.tga$" "image/tga") | |
190 ("\\.ps$" "image/postscript") | |
191 ("\\.fli$" "video/fli") | |
192 ("\\.wav$" "audio/wav") | |
193 ("\\.aiff$" "audio/aiff") | |
194 ("\\.hcom$" "audio/hcom") | |
195 ("\\.voc$" "audio/voc") | |
196 ("\\.smp$" "audio/smp") | |
197 ("\\.mod$" "audio/mod") | |
198 ("\\.dvi$" "image/dvi") | |
199 ("\\.mpe?g$" "video/mpeg") | |
200 ("\\.au$" "audio/basic") | |
201 ("\\.\\(te?xt\\|doc\\|c\\|h\\)$" "text/plain") | |
202 ("\\.\\(c\\|h\\)$" "text/source") | |
203 ("read.*me" "text/plain") | |
204 ("\\.html$" "text/html") | |
205 ("\\.bat$" "text/bat") | |
206 ("\\.[1-6]$" "text/man") | |
207 ("\\.flc$" "video/flc") | |
208 ("\\.rle$" "video/rle") | |
209 ("\\.pfx$" "video/pfx") | |
210 ("\\.avi$" "video/avi") | |
211 ("\\.sme$" "video/sme") | |
212 ("\\.rpza$" "video/prza") | |
213 ("\\.dl$" "video/dl") | |
214 ("\\.qt$" "video/qt") | |
215 ("\\.rsrc$" "video/rsrc") | |
216 ("\\..*$" "unknown/unknown"))) | |
217 | |
218 ;; Various variables users may set | |
219 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
220 (defcustom gnus-uu-tmp-dir |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
221 (cond ((fboundp 'temp-directory) (temp-directory)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
222 ((boundp 'temporary-file-directory) temporary-file-directory) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
223 ("/tmp/")) |
17493 | 224 "*Variable saying where gnus-uu is to do its work. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
225 Default is \"/tmp/\"." |
17493 | 226 :group 'gnus-extract |
227 :type 'directory) | |
228 | |
229 (defcustom gnus-uu-do-not-unpack-archives nil | |
230 "*Non-nil means that gnus-uu won't peek inside archives looking for files to display. | |
231 Default is nil." | |
232 :group 'gnus-extract-archive | |
233 :type 'boolean) | |
234 | |
235 (defcustom gnus-uu-ignore-default-view-rules nil | |
236 "*Non-nil means that gnus-uu will ignore the default viewing rules. | |
237 Only the user viewing rules will be consulted. Default is nil." | |
238 :group 'gnus-extract-view | |
239 :type 'boolean) | |
240 | |
241 (defcustom gnus-uu-grabbed-file-functions nil | |
242 "Functions run on each file after successful decoding. | |
243 They will be called with the name of the file as the argument. | |
244 Likely functions you can use in this list are `gnus-uu-grab-view' | |
245 and `gnus-uu-grab-move'." | |
246 :group 'gnus-extract | |
247 :options '(gnus-uu-grab-view gnus-uu-grab-move) | |
248 :type 'hook) | |
249 | |
250 (defcustom gnus-uu-ignore-default-archive-rules nil | |
251 "*Non-nil means that gnus-uu will ignore the default archive unpacking commands. | |
252 Only the user unpacking commands will be consulted. Default is nil." | |
253 :group 'gnus-extract-archive | |
254 :type 'boolean) | |
255 | |
256 (defcustom gnus-uu-kill-carriage-return t | |
257 "*Non-nil means that gnus-uu will strip all carriage returns from articles. | |
258 Default is t." | |
259 :group 'gnus-extract | |
260 :type 'boolean) | |
261 | |
262 (defcustom gnus-uu-view-with-metamail nil | |
263 "*Non-nil means that files will be viewed with metamail. | |
264 The gnus-uu viewing functions will be ignored and gnus-uu will try | |
265 to guess at a content-type based on file name suffixes. Default | |
266 it nil." | |
267 :group 'gnus-extract | |
268 :type 'boolean) | |
269 | |
270 (defcustom gnus-uu-unmark-articles-not-decoded nil | |
271 "*Non-nil means that gnus-uu will mark articles that were unsuccessfully decoded as unread. | |
272 Default is nil." | |
273 :group 'gnus-extract | |
274 :type 'boolean) | |
275 | |
276 (defcustom gnus-uu-correct-stripped-uucode nil | |
277 "*Non-nil means that gnus-uu will *try* to fix uuencoded files that have had trailing spaces deleted. | |
278 Default is nil." | |
279 :group 'gnus-extract | |
280 :type 'boolean) | |
281 | |
282 (defcustom gnus-uu-save-in-digest nil | |
283 "*Non-nil means that gnus-uu, when asked to save without decoding, will save in digests. | |
284 If this variable is nil, gnus-uu will just save everything in a | |
285 file without any embellishments. The digesting almost conforms to RFC1153 - | |
286 no easy way to specify any meaningful volume and issue numbers were found, | |
287 so I simply dropped them." | |
288 :group 'gnus-extract | |
289 :type 'boolean) | |
290 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
291 (defcustom gnus-uu-pre-uudecode-hook nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
292 "Hook run before sending a message to uudecode." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
293 :group 'gnus-extract |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
294 :type 'hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
295 |
17493 | 296 (defcustom gnus-uu-digest-headers |
297 '("^Date:" "^From:" "^To:" "^Cc:" "^Subject:" "^Message-ID:" "^Keywords:" | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
298 "^Summary:" "^References:" "^Content-Type:" "^Content-Transfer-Encoding:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
299 "^MIME-Version:" "^Content-Disposition:" "^Content-Description:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
300 "^Content-ID:") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
301 "*List of regexps to match headers included in digested messages. |
17493 | 302 The headers will be included in the sequence they are matched." |
303 :group 'gnus-extract | |
304 :type '(repeat regexp)) | |
305 | |
306 (defcustom gnus-uu-save-separate-articles nil | |
307 "*Non-nil means that gnus-uu will save articles in separate files." | |
308 :group 'gnus-extract | |
309 :type 'boolean) | |
310 | |
311 (defcustom gnus-uu-be-dangerous 'ask | |
312 "*Specifies what to do if unusual situations arise during decoding. | |
313 If nil, be as conservative as possible. If t, ignore things that | |
314 didn't work, and overwrite existing files. Otherwise, ask each time." | |
315 :group 'gnus-extract | |
316 :type '(choice (const :tag "conservative" nil) | |
317 (const :tag "ask" ask) | |
318 (const :tag "liberal" t))) | |
319 | |
320 ;; Internal variables | |
321 | |
322 (defvar gnus-uu-saved-article-name nil) | |
323 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
324 (defvar gnus-uu-begin-string "^begin[ \t]+[0-7][0-7][0-7][ \t]+\\(.*\\)$") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
325 (defvar gnus-uu-end-string "^end[ \t]*$") |
17493 | 326 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
327 (defvar gnus-uu-body-line "^M") |
17493 | 328 (let ((i 61)) |
329 (while (> (setq i (1- i)) 0) | |
330 (setq gnus-uu-body-line (concat gnus-uu-body-line "[^a-z]"))) | |
331 (setq gnus-uu-body-line (concat gnus-uu-body-line ".?$"))) | |
332 | |
333 ;"^M.............................................................?$" | |
334 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
335 (defvar gnus-uu-shar-begin-string "^#! */bin/sh") |
17493 | 336 |
337 (defvar gnus-uu-shar-file-name nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
338 (defvar gnus-uu-shar-name-marker |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
339 "begin [0-7][0-7][0-7][ \t]+\\(\\(\\w\\|\\.\\)*\\b\\)") |
17493 | 340 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
341 (defvar gnus-uu-postscript-begin-string "^%!PS-") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
342 (defvar gnus-uu-postscript-end-string "^%%EOF$") |
17493 | 343 |
344 (defvar gnus-uu-file-name nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
345 (defvar gnus-uu-uudecode-process nil) |
17493 | 346 (defvar gnus-uu-binhex-article-name nil) |
347 | |
348 (defvar gnus-uu-work-dir nil) | |
349 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
350 (defvar gnus-uu-output-buffer-name " *Gnus UU Output*") |
17493 | 351 |
352 (defvar gnus-uu-default-dir gnus-article-save-directory) | |
353 (defvar gnus-uu-digest-from-subject nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
354 (defvar gnus-uu-digest-buffer nil) |
17493 | 355 |
356 ;; Keymaps | |
357 | |
358 (gnus-define-keys (gnus-uu-mark-map "P" gnus-summary-mark-map) | |
359 "p" gnus-summary-mark-as-processable | |
360 "u" gnus-summary-unmark-as-processable | |
361 "U" gnus-summary-unmark-all-processable | |
362 "v" gnus-uu-mark-over | |
363 "s" gnus-uu-mark-series | |
364 "r" gnus-uu-mark-region | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
365 "g" gnus-uu-unmark-region |
17493 | 366 "R" gnus-uu-mark-by-regexp |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
367 "G" gnus-uu-unmark-by-regexp |
17493 | 368 "t" gnus-uu-mark-thread |
369 "T" gnus-uu-unmark-thread | |
370 "a" gnus-uu-mark-all | |
371 "b" gnus-uu-mark-buffer | |
372 "S" gnus-uu-mark-sparse | |
373 "k" gnus-summary-kill-process-mark | |
374 "y" gnus-summary-yank-process-mark | |
375 "w" gnus-summary-save-process-mark | |
376 "i" gnus-uu-invert-processable) | |
377 | |
378 (gnus-define-keys (gnus-uu-extract-map "X" gnus-summary-mode-map) | |
379 ;;"x" gnus-uu-extract-any | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
380 "m" gnus-summary-save-parts |
17493 | 381 "u" gnus-uu-decode-uu |
382 "U" gnus-uu-decode-uu-and-save | |
383 "s" gnus-uu-decode-unshar | |
384 "S" gnus-uu-decode-unshar-and-save | |
385 "o" gnus-uu-decode-save | |
386 "O" gnus-uu-decode-save | |
387 "b" gnus-uu-decode-binhex | |
388 "B" gnus-uu-decode-binhex | |
389 "p" gnus-uu-decode-postscript | |
390 "P" gnus-uu-decode-postscript-and-save) | |
391 | |
392 (gnus-define-keys | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
393 (gnus-uu-extract-view-map "v" gnus-uu-extract-map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
394 "u" gnus-uu-decode-uu-view |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
395 "U" gnus-uu-decode-uu-and-save-view |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
396 "s" gnus-uu-decode-unshar-view |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
397 "S" gnus-uu-decode-unshar-and-save-view |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
398 "o" gnus-uu-decode-save-view |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
399 "O" gnus-uu-decode-save-view |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
400 "b" gnus-uu-decode-binhex-view |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
401 "B" gnus-uu-decode-binhex-view |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
402 "p" gnus-uu-decode-postscript-view |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
403 "P" gnus-uu-decode-postscript-and-save-view) |
17493 | 404 |
405 | |
406 ;; Commands. | |
407 | |
408 (defun gnus-uu-decode-uu (&optional n) | |
409 "Uudecodes the current article." | |
410 (interactive "P") | |
411 (gnus-uu-decode-with-method 'gnus-uu-uustrip-article n)) | |
412 | |
413 (defun gnus-uu-decode-uu-and-save (n dir) | |
414 "Decodes and saves the resulting file." | |
415 (interactive | |
416 (list current-prefix-arg | |
417 (file-name-as-directory | |
418 (read-file-name "Uudecode and save in dir: " | |
419 gnus-uu-default-dir | |
420 gnus-uu-default-dir t)))) | |
421 (gnus-uu-decode-with-method 'gnus-uu-uustrip-article n dir nil nil t)) | |
422 | |
423 (defun gnus-uu-decode-unshar (&optional n) | |
424 "Unshars the current article." | |
425 (interactive "P") | |
426 (gnus-uu-decode-with-method 'gnus-uu-unshar-article n nil nil 'scan t)) | |
427 | |
428 (defun gnus-uu-decode-unshar-and-save (n dir) | |
429 "Unshars and saves the current article." | |
430 (interactive | |
431 (list current-prefix-arg | |
432 (file-name-as-directory | |
433 (read-file-name "Unshar and save in dir: " | |
434 gnus-uu-default-dir | |
435 gnus-uu-default-dir t)))) | |
436 (gnus-uu-decode-with-method 'gnus-uu-unshar-article n dir nil 'scan t)) | |
437 | |
438 (defun gnus-uu-decode-save (n file) | |
439 "Saves the current article." | |
440 (interactive | |
441 (list current-prefix-arg | |
442 (read-file-name | |
443 (if gnus-uu-save-separate-articles | |
444 "Save articles is dir: " | |
445 "Save articles in file: ") | |
446 gnus-uu-default-dir | |
447 gnus-uu-default-dir))) | |
448 (setq gnus-uu-saved-article-name file) | |
449 (gnus-uu-decode-with-method 'gnus-uu-save-article n nil t)) | |
450 | |
451 (defun gnus-uu-decode-binhex (n dir) | |
452 "Unbinhexes the current article." | |
453 (interactive | |
454 (list current-prefix-arg | |
455 (file-name-as-directory | |
456 (read-file-name "Unbinhex and save in dir: " | |
457 gnus-uu-default-dir | |
458 gnus-uu-default-dir)))) | |
459 (setq gnus-uu-binhex-article-name | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
460 (make-temp-name (concat gnus-uu-work-dir "binhex"))) |
17493 | 461 (gnus-uu-decode-with-method 'gnus-uu-binhex-article n dir)) |
462 | |
463 (defun gnus-uu-decode-uu-view (&optional n) | |
464 "Uudecodes and views the current article." | |
465 (interactive "P") | |
466 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
467 (gnus-uu-decode-uu n))) | |
468 | |
469 (defun gnus-uu-decode-uu-and-save-view (n dir) | |
470 "Decodes, views and saves the resulting file." | |
471 (interactive | |
472 (list current-prefix-arg | |
473 (read-file-name "Uudecode, view and save in dir: " | |
474 gnus-uu-default-dir | |
475 gnus-uu-default-dir t))) | |
476 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
477 (gnus-uu-decode-uu-and-save n dir))) | |
478 | |
479 (defun gnus-uu-decode-unshar-view (&optional n) | |
480 "Unshars and views the current article." | |
481 (interactive "P") | |
482 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
483 (gnus-uu-decode-unshar n))) | |
484 | |
485 (defun gnus-uu-decode-unshar-and-save-view (n dir) | |
486 "Unshars and saves the current article." | |
487 (interactive | |
488 (list current-prefix-arg | |
489 (read-file-name "Unshar, view and save in dir: " | |
490 gnus-uu-default-dir | |
491 gnus-uu-default-dir t))) | |
492 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
493 (gnus-uu-decode-unshar-and-save n dir))) | |
494 | |
495 (defun gnus-uu-decode-save-view (n file) | |
496 "Saves and views the current article." | |
497 (interactive | |
498 (list current-prefix-arg | |
499 (read-file-name (if gnus-uu-save-separate-articles | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
500 "Save articles is dir: " |
17493 | 501 "Save articles in file: ") |
502 gnus-uu-default-dir gnus-uu-default-dir))) | |
503 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
504 (gnus-uu-decode-save n file))) | |
505 | |
506 (defun gnus-uu-decode-binhex-view (n file) | |
507 "Unbinhexes and views the current article." | |
508 (interactive | |
509 (list current-prefix-arg | |
510 (read-file-name "Unbinhex, view and save in dir: " | |
511 gnus-uu-default-dir gnus-uu-default-dir))) | |
512 (setq gnus-uu-binhex-article-name | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
513 (make-temp-name (concat gnus-uu-work-dir "binhex"))) |
17493 | 514 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) |
515 (gnus-uu-decode-binhex n file))) | |
516 | |
517 | |
518 ;; Digest and forward articles | |
519 | |
520 (defun gnus-uu-digest-mail-forward (&optional n post) | |
521 "Digests and forwards all articles in this series." | |
522 (interactive "P") | |
523 (let ((gnus-uu-save-in-digest t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
524 (file (make-temp-name (nnheader-concat gnus-uu-tmp-dir "forward"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
525 (message-forward-as-mime message-forward-as-mime) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
526 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
527 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
528 gnus-uu-digest-buffer subject from) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
529 (if (and n (not (numberp n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
530 (setq message-forward-as-mime (not message-forward-as-mime) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
531 n nil)) |
17493 | 532 (gnus-setup-message 'forward |
533 (setq gnus-uu-digest-from-subject nil) | |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
534 (setq gnus-uu-digest-buffer |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
535 (gnus-get-buffer-create " *gnus-uu-forward*")) |
17493 | 536 (gnus-uu-decode-save n file) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
537 (switch-to-buffer gnus-uu-digest-buffer) |
17493 | 538 (let ((fs gnus-uu-digest-from-subject)) |
539 (when fs | |
540 (setq from (caar fs) | |
541 subject (gnus-simplify-subject-fuzzy (cdar fs)) | |
542 fs (cdr fs)) | |
543 (while (and fs (or from subject)) | |
544 (when from | |
545 (unless (string= from (caar fs)) | |
546 (setq from nil))) | |
547 (when subject | |
548 (unless (string= (gnus-simplify-subject-fuzzy (cdar fs)) | |
549 subject) | |
550 (setq subject nil))) | |
551 (setq fs (cdr fs)))) | |
552 (unless subject | |
553 (setq subject "Digested Articles")) | |
554 (unless from | |
555 (setq from | |
556 (if (gnus-news-group-p gnus-newsgroup-name) | |
557 gnus-newsgroup-name | |
558 "Various")))) | |
559 (goto-char (point-min)) | |
560 (when (re-search-forward "^Subject: ") | |
561 (delete-region (point) (gnus-point-at-eol)) | |
562 (insert subject)) | |
563 (goto-char (point-min)) | |
33765
d67ce1c9c62b
2000-11-22 Simon Josefsson <simon@josefsson.org>
Dave Love <fx@gnu.org>
parents:
31716
diff
changeset
|
564 (when (re-search-forward "^From:") |
17493 | 565 (delete-region (point) (gnus-point-at-eol)) |
33765
d67ce1c9c62b
2000-11-22 Simon Josefsson <simon@josefsson.org>
Dave Love <fx@gnu.org>
parents:
31716
diff
changeset
|
566 (insert " " from)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
567 (message-forward post t)) |
17493 | 568 (setq gnus-uu-digest-from-subject nil))) |
569 | |
570 (defun gnus-uu-digest-post-forward (&optional n) | |
571 "Digest and forward to a newsgroup." | |
572 (interactive "P") | |
573 (gnus-uu-digest-mail-forward n t)) | |
574 | |
575 ;; Process marking. | |
576 | |
577 (defun gnus-uu-mark-by-regexp (regexp &optional unmark) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
578 "Set the process mark on articles whose subjects match REGEXP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
579 When called interactively, prompt for REGEXP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
580 Optional UNMARK non-nil means unmark instead of mark." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
581 (interactive "sMark (regexp): \nP") |
17493 | 582 (let ((articles (gnus-uu-find-articles-matching regexp))) |
583 (while articles | |
584 (if unmark | |
585 (gnus-summary-remove-process-mark (pop articles)) | |
586 (gnus-summary-set-process-mark (pop articles)))) | |
587 (message "")) | |
588 (gnus-summary-position-point)) | |
589 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
590 (defun gnus-uu-unmark-by-regexp (regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
591 "Remove the process mark from articles whose subjects match REGEXP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
592 When called interactively, prompt for REGEXP." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
593 (interactive "sUnmark (regexp): ") |
17493 | 594 (gnus-uu-mark-by-regexp regexp t)) |
595 | |
596 (defun gnus-uu-mark-series () | |
597 "Mark the current series with the process mark." | |
598 (interactive) | |
599 (let ((articles (gnus-uu-find-articles-matching))) | |
600 (while articles | |
601 (gnus-summary-set-process-mark (car articles)) | |
602 (setq articles (cdr articles))) | |
603 (message "")) | |
604 (gnus-summary-position-point)) | |
605 | |
606 (defun gnus-uu-mark-region (beg end &optional unmark) | |
607 "Set the process mark on all articles between point and mark." | |
608 (interactive "r") | |
609 (save-excursion | |
610 (goto-char beg) | |
611 (while (< (point) end) | |
612 (if unmark | |
613 (gnus-summary-remove-process-mark (gnus-summary-article-number)) | |
614 (gnus-summary-set-process-mark (gnus-summary-article-number))) | |
615 (forward-line 1))) | |
616 (gnus-summary-position-point)) | |
617 | |
618 (defun gnus-uu-unmark-region (beg end) | |
619 "Remove the process mark from all articles between point and mark." | |
620 (interactive "r") | |
621 (gnus-uu-mark-region beg end t)) | |
622 | |
623 (defun gnus-uu-mark-buffer () | |
624 "Set the process mark on all articles in the buffer." | |
625 (interactive) | |
626 (gnus-uu-mark-region (point-min) (point-max))) | |
627 | |
628 (defun gnus-uu-unmark-buffer () | |
629 "Remove the process mark on all articles in the buffer." | |
630 (interactive) | |
631 (gnus-uu-mark-region (point-min) (point-max) t)) | |
632 | |
633 (defun gnus-uu-mark-thread () | |
634 "Marks all articles downwards in this thread." | |
635 (interactive) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
636 (gnus-save-hidden-threads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
637 (let ((level (gnus-summary-thread-level))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
638 (while (and (gnus-summary-set-process-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
639 (gnus-summary-article-number)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
640 (zerop (gnus-summary-next-subject 1 nil t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
641 (> (gnus-summary-thread-level) level))))) |
17493 | 642 (gnus-summary-position-point)) |
643 | |
644 (defun gnus-uu-unmark-thread () | |
645 "Unmarks all articles downwards in this thread." | |
646 (interactive) | |
647 (let ((level (gnus-summary-thread-level))) | |
648 (while (and (gnus-summary-remove-process-mark | |
649 (gnus-summary-article-number)) | |
650 (zerop (gnus-summary-next-subject 1)) | |
651 (> (gnus-summary-thread-level) level)))) | |
652 (gnus-summary-position-point)) | |
653 | |
654 (defun gnus-uu-invert-processable () | |
655 "Invert the list of process-marked articles." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
656 (interactive) |
17493 | 657 (let ((data gnus-newsgroup-data) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
658 number) |
17493 | 659 (save-excursion |
660 (while data | |
661 (if (memq (setq number (gnus-data-number (pop data))) | |
662 gnus-newsgroup-processable) | |
663 (gnus-summary-remove-process-mark number) | |
664 (gnus-summary-set-process-mark number))))) | |
665 (gnus-summary-position-point)) | |
666 | |
667 (defun gnus-uu-mark-over (&optional score) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
668 "Mark all articles with a score over SCORE (the prefix)." |
17493 | 669 (interactive "P") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
670 (let ((score (or score gnus-summary-default-score 0)) |
17493 | 671 (data gnus-newsgroup-data)) |
672 (save-excursion | |
673 (while data | |
674 (when (> (or (cdr (assq (gnus-data-number (car data)) | |
675 gnus-newsgroup-scored)) | |
676 gnus-summary-default-score 0) | |
677 score) | |
678 (gnus-summary-set-process-mark (caar data))) | |
679 (setq data (cdr data)))) | |
680 (gnus-summary-position-point))) | |
681 | |
682 (defun gnus-uu-mark-sparse () | |
683 "Mark all series that have some articles marked." | |
684 (interactive) | |
685 (let ((marked (nreverse gnus-newsgroup-processable)) | |
686 subject articles total headers) | |
687 (unless marked | |
688 (error "No articles marked with the process mark")) | |
689 (setq gnus-newsgroup-processable nil) | |
690 (save-excursion | |
691 (while marked | |
692 (and (vectorp (setq headers | |
693 (gnus-summary-article-header (car marked)))) | |
694 (setq subject (mail-header-subject headers) | |
695 articles (gnus-uu-find-articles-matching | |
696 (gnus-uu-reginize-string subject)) | |
697 total (nconc total articles))) | |
698 (while articles | |
699 (gnus-summary-set-process-mark (car articles)) | |
700 (setcdr marked (delq (car articles) (cdr marked))) | |
701 (setq articles (cdr articles))) | |
702 (setq marked (cdr marked))) | |
703 (setq gnus-newsgroup-processable (nreverse total))) | |
704 (gnus-summary-position-point))) | |
705 | |
706 (defun gnus-uu-mark-all () | |
707 "Mark all articles in \"series\" order." | |
708 (interactive) | |
709 (setq gnus-newsgroup-processable nil) | |
710 (save-excursion | |
711 (let ((data gnus-newsgroup-data) | |
712 number) | |
713 (while data | |
714 (when (and (not (memq (setq number (gnus-data-number (car data))) | |
715 gnus-newsgroup-processable)) | |
716 (vectorp (gnus-data-header (car data)))) | |
717 (gnus-summary-goto-subject number) | |
718 (gnus-uu-mark-series)) | |
719 (setq data (cdr data))))) | |
720 (gnus-summary-position-point)) | |
721 | |
722 ;; All PostScript functions written by Erik Selberg <speed@cs.washington.edu>. | |
723 | |
724 (defun gnus-uu-decode-postscript (&optional n) | |
725 "Gets postscript of the current article." | |
726 (interactive "P") | |
727 (gnus-uu-decode-with-method 'gnus-uu-decode-postscript-article n)) | |
728 | |
729 (defun gnus-uu-decode-postscript-view (&optional n) | |
730 "Gets and views the current article." | |
731 (interactive "P") | |
732 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
733 (gnus-uu-decode-postscript n))) | |
734 | |
735 (defun gnus-uu-decode-postscript-and-save (n dir) | |
736 "Extracts postscript and saves the current article." | |
737 (interactive | |
738 (list current-prefix-arg | |
739 (file-name-as-directory | |
740 (read-file-name "Save in dir: " | |
741 gnus-uu-default-dir | |
742 gnus-uu-default-dir t)))) | |
743 (gnus-uu-decode-with-method 'gnus-uu-decode-postscript-article | |
744 n dir nil nil t)) | |
745 | |
746 (defun gnus-uu-decode-postscript-and-save-view (n dir) | |
747 "Decodes, views and saves the resulting file." | |
748 (interactive | |
749 (list current-prefix-arg | |
750 (read-file-name "Where do you want to save the file(s)? " | |
751 gnus-uu-default-dir | |
752 gnus-uu-default-dir t))) | |
753 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
754 (gnus-uu-decode-postscript-and-save n dir))) | |
755 | |
756 | |
757 ;; Internal functions. | |
758 | |
759 (defun gnus-uu-decode-with-method (method n &optional save not-insert | |
760 scan cdir) | |
761 (gnus-uu-initialize scan) | |
762 (when save | |
763 (setq gnus-uu-default-dir save)) | |
764 ;; Create the directory we save to. | |
765 (when (and scan cdir save | |
766 (not (file-exists-p save))) | |
767 (make-directory save t)) | |
768 (let ((articles (gnus-uu-get-list-of-articles n)) | |
769 files) | |
770 (setq files (gnus-uu-grab-articles articles method t)) | |
771 (let ((gnus-current-article (car articles))) | |
772 (when scan | |
773 (setq files (gnus-uu-scan-directory gnus-uu-work-dir)))) | |
774 (when save | |
775 (gnus-uu-save-files files save)) | |
776 (when (eq gnus-uu-do-not-unpack-archives nil) | |
777 (setq files (gnus-uu-unpack-files files))) | |
778 (setq files (nreverse (gnus-uu-get-actions files))) | |
779 (or not-insert (not gnus-insert-pseudo-articles) | |
780 (gnus-summary-insert-pseudos files save)))) | |
781 | |
782 (defun gnus-uu-scan-directory (dir &optional rec) | |
783 "Return a list of all files under DIR." | |
784 (let ((files (directory-files dir t)) | |
785 out file) | |
786 (while (setq file (pop files)) | |
787 (unless (member (file-name-nondirectory file) '("." "..")) | |
788 (push (list (cons 'name file) | |
789 (cons 'article gnus-current-article)) | |
790 out) | |
791 (when (file-directory-p file) | |
792 (setq out (nconc (gnus-uu-scan-directory file t) out))))) | |
793 (if rec | |
794 out | |
795 (nreverse out)))) | |
796 | |
797 (defun gnus-uu-save-files (files dir) | |
798 "Save FILES in DIR." | |
799 (let ((len (length files)) | |
800 (reg (concat "^" (regexp-quote gnus-uu-work-dir))) | |
801 to-file file fromdir) | |
802 (while (setq file (cdr (assq 'name (pop files)))) | |
803 (when (file-exists-p file) | |
804 (string-match reg file) | |
805 (setq fromdir (substring file (match-end 0))) | |
806 (if (file-directory-p file) | |
807 (gnus-make-directory (concat dir fromdir)) | |
808 (setq to-file (concat dir fromdir)) | |
809 (when (or (not (file-exists-p to-file)) | |
810 (eq gnus-uu-be-dangerous t) | |
811 (and gnus-uu-be-dangerous | |
812 (gnus-y-or-n-p (format "%s exists; overwrite? " | |
813 to-file)))) | |
814 (copy-file file to-file t t))))) | |
815 (gnus-message 5 "Saved %d file%s" len (if (= len 1) "" "s")))) | |
816 | |
817 ;; Functions for saving and possibly digesting articles without | |
818 ;; any decoding. | |
819 | |
820 ;; Function called by gnus-uu-grab-articles to treat each article. | |
821 (defun gnus-uu-save-article (buffer in-state) | |
822 (cond | |
823 (gnus-uu-save-separate-articles | |
824 (save-excursion | |
825 (set-buffer buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
826 (let ((coding-system-for-write mm-text-coding-system)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
827 (gnus-write-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
828 (concat gnus-uu-saved-article-name gnus-current-article))) |
17493 | 829 (cond ((eq in-state 'first) (list gnus-uu-saved-article-name 'begin)) |
830 ((eq in-state 'first-and-last) (list gnus-uu-saved-article-name | |
831 'begin 'end)) | |
832 ((eq in-state 'last) (list 'end)) | |
833 (t (list 'middle))))) | |
834 ((not gnus-uu-save-in-digest) | |
835 (save-excursion | |
836 (set-buffer buffer) | |
837 (write-region (point-min) (point-max) gnus-uu-saved-article-name t) | |
838 (cond ((eq in-state 'first) (list gnus-uu-saved-article-name 'begin)) | |
839 ((eq in-state 'first-and-last) (list gnus-uu-saved-article-name | |
840 'begin 'end)) | |
841 ((eq in-state 'last) (list 'end)) | |
842 (t (list 'middle))))) | |
843 (t | |
844 (let ((header (gnus-summary-article-header))) | |
845 (push (cons (mail-header-from header) | |
846 (mail-header-subject header)) | |
847 gnus-uu-digest-from-subject)) | |
848 (let ((name (file-name-nondirectory gnus-uu-saved-article-name)) | |
849 beg subj headers headline sorthead body end-string state) | |
850 (if (or (eq in-state 'first) | |
851 (eq in-state 'first-and-last)) | |
852 (progn | |
853 (setq state (list 'begin)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
854 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
855 (set-buffer (gnus-get-buffer-create "*gnus-uu-body*")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
856 (erase-buffer)) |
17493 | 857 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
858 (set-buffer (gnus-get-buffer-create "*gnus-uu-pre*")) |
17493 | 859 (erase-buffer) |
860 (insert (format | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
861 "Date: %s\nFrom: %s\nSubject: %s Digest\n\n" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
862 (current-time-string) name name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
863 (when (and message-forward-as-mime gnus-uu-digest-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
864 ;; The default part in multipart/digest is message/rfc822. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
865 ;; Subject is a fake head. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
866 (insert "<#part type=text/plain>\nSubject: Topics\n\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
867 (insert "Topics:\n"))) |
17493 | 868 (when (not (eq in-state 'end)) |
869 (setq state (list 'middle)))) | |
870 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
871 (set-buffer "*gnus-uu-body*") |
17493 | 872 (goto-char (setq beg (point-max))) |
873 (save-excursion | |
874 (save-restriction | |
875 (set-buffer buffer) | |
876 (let (buffer-read-only) | |
877 (gnus-set-text-properties (point-min) (point-max) nil) | |
878 ;; These two are necessary for XEmacs 19.12 fascism. | |
879 (put-text-property (point-min) (point-max) 'invisible nil) | |
880 (put-text-property (point-min) (point-max) 'intangible nil)) | |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
881 (when (and message-forward-as-mime |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
882 message-forward-show-mml |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
883 gnus-uu-digest-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
884 (mm-enable-multibyte) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
885 (mime-to-mml)) |
17493 | 886 (goto-char (point-min)) |
887 (re-search-forward "\n\n") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
888 (unless (and message-forward-as-mime gnus-uu-digest-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
889 ;; Quote all 30-dash lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
890 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
891 (while (re-search-forward "^-" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
892 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
893 (delete-char 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
894 (insert "- ")))) |
17493 | 895 (setq body (buffer-substring (1- (point)) (point-max))) |
896 (narrow-to-region (point-min) (point)) | |
897 (if (not (setq headers gnus-uu-digest-headers)) | |
898 (setq sorthead (buffer-substring (point-min) (point-max))) | |
899 (while headers | |
900 (setq headline (car headers)) | |
901 (setq headers (cdr headers)) | |
902 (goto-char (point-min)) | |
903 (while (re-search-forward headline nil t) | |
904 (setq sorthead | |
905 (concat sorthead | |
906 (buffer-substring | |
907 (match-beginning 0) | |
908 (or (and (re-search-forward "^[^ \t]" nil t) | |
909 (1- (point))) | |
910 (progn (forward-line 1) (point))))))))) | |
911 (widen))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
912 (if (and message-forward-as-mime gnus-uu-digest-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
913 (if message-forward-show-mml |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
914 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
915 (insert "\n<#mml type=message/rfc822>\n") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
916 (insert sorthead) (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
917 (insert body) (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
918 (insert "\n<#/mml>\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
919 (let ((buf (mml-generate-new-buffer " *mml*"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
920 (with-current-buffer buf |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
921 (insert sorthead) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
922 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
923 (when (re-search-forward "^Subject: \\(.*\\)$" nil t) |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
924 (setq subj (buffer-substring (match-beginning 1) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
925 (match-end 1)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
926 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
927 (insert body)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
928 (insert "\n<#part type=message/rfc822" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
929 " buffer=\"" (buffer-name buf) "\">\n"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
930 (insert sorthead) (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
931 (insert body) (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
932 (insert (concat "\n" (make-string 30 ?-) "\n\n"))) |
17493 | 933 (goto-char beg) |
934 (when (re-search-forward "^Subject: \\(.*\\)$" nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
935 (setq subj (buffer-substring (match-beginning 1) (match-end 1)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
936 (when subj |
17493 | 937 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
938 (set-buffer "*gnus-uu-pre*") |
17493 | 939 (insert (format " %s\n" subj))))) |
940 (when (or (eq in-state 'last) | |
941 (eq in-state 'first-and-last)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
942 (if (and message-forward-as-mime gnus-uu-digest-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
943 (with-current-buffer gnus-uu-digest-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
944 (erase-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
945 (insert-buffer "*gnus-uu-pre*") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
946 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
947 (insert-buffer "*gnus-uu-body*")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
948 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
949 (set-buffer "*gnus-uu-pre*") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
950 (insert (format "\n\n%s\n\n" (make-string 70 ?-))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
951 (if gnus-uu-digest-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
952 (with-current-buffer gnus-uu-digest-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
953 (erase-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
954 (insert-buffer "*gnus-uu-pre*")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
955 (let ((coding-system-for-write mm-text-coding-system)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
956 (gnus-write-buffer gnus-uu-saved-article-name)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
957 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
958 (set-buffer "*gnus-uu-body*") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
959 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
960 (insert |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
961 (concat (setq end-string (format "End of %s Digest" name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
962 "\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
963 (insert (concat (make-string (length end-string) ?*) "\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
964 (if gnus-uu-digest-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
965 (with-current-buffer gnus-uu-digest-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
966 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
967 (insert-buffer "*gnus-uu-body*")) |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
968 (let ((coding-system-for-write mm-text-coding-system) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
969 (file-name-coding-system nnmail-pathname-coding-system)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
970 (write-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
971 (point-min) (point-max) gnus-uu-saved-article-name t))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
972 (gnus-kill-buffer "*gnus-uu-pre*") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
973 (gnus-kill-buffer "*gnus-uu-body*") |
17493 | 974 (push 'end state)) |
975 (if (memq 'begin state) | |
976 (cons gnus-uu-saved-article-name state) | |
977 state))))) | |
978 | |
979 ;; Binhex treatment - not very advanced. | |
980 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
981 (defvar gnus-uu-binhex-body-line |
17493 | 982 "^[^:]...............................................................$") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
983 (defvar gnus-uu-binhex-begin-line |
17493 | 984 "^:...............................................................$") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
985 (defvar gnus-uu-binhex-end-line |
17493 | 986 ":$") |
987 | |
988 (defun gnus-uu-binhex-article (buffer in-state) | |
989 (let (state start-char) | |
990 (save-excursion | |
991 (set-buffer buffer) | |
992 (widen) | |
993 (goto-char (point-min)) | |
994 (when (not (re-search-forward gnus-uu-binhex-begin-line nil t)) | |
995 (when (not (re-search-forward gnus-uu-binhex-body-line nil t)) | |
996 (setq state (list 'wrong-type)))) | |
997 | |
998 (if (memq 'wrong-type state) | |
999 () | |
1000 (beginning-of-line) | |
1001 (setq start-char (point)) | |
1002 (if (looking-at gnus-uu-binhex-begin-line) | |
1003 (progn | |
1004 (setq state (list 'begin)) | |
1005 (write-region 1 1 gnus-uu-binhex-article-name)) | |
1006 (setq state (list 'middle))) | |
1007 (goto-char (point-max)) | |
1008 (re-search-backward (concat gnus-uu-binhex-body-line "\\|" | |
1009 gnus-uu-binhex-end-line) | |
1010 nil t) | |
1011 (when (looking-at gnus-uu-binhex-end-line) | |
1012 (setq state (if (memq 'begin state) | |
1013 (cons 'end state) | |
1014 (list 'end)))) | |
1015 (beginning-of-line) | |
1016 (forward-line 1) | |
1017 (when (file-exists-p gnus-uu-binhex-article-name) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1018 (mm-append-to-file start-char (point) gnus-uu-binhex-article-name)))) |
17493 | 1019 (if (memq 'begin state) |
1020 (cons gnus-uu-binhex-article-name state) | |
1021 state))) | |
1022 | |
1023 ;; PostScript | |
1024 | |
1025 (defun gnus-uu-decode-postscript-article (process-buffer in-state) | |
1026 (let ((state (list 'ok)) | |
1027 start-char end-char file-name) | |
1028 (save-excursion | |
1029 (set-buffer process-buffer) | |
1030 (goto-char (point-min)) | |
1031 (if (not (re-search-forward gnus-uu-postscript-begin-string nil t)) | |
1032 (setq state (list 'wrong-type)) | |
1033 (beginning-of-line) | |
1034 (setq start-char (point)) | |
1035 (if (not (re-search-forward gnus-uu-postscript-end-string nil t)) | |
1036 (setq state (list 'wrong-type)) | |
1037 (setq end-char (point)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1038 (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name)) |
17493 | 1039 (insert-buffer-substring process-buffer start-char end-char) |
1040 (setq file-name (concat gnus-uu-work-dir | |
1041 (cdr gnus-article-current) ".ps")) | |
1042 (write-region (point-min) (point-max) file-name) | |
1043 (setq state (list file-name 'begin 'end))))) | |
1044 state)) | |
1045 | |
1046 | |
1047 ;; Find actions. | |
1048 | |
1049 (defun gnus-uu-get-actions (files) | |
1050 (let ((ofiles files) | |
1051 action name) | |
1052 (while files | |
1053 (setq name (cdr (assq 'name (car files)))) | |
1054 (and | |
1055 (setq action (gnus-uu-get-action name)) | |
1056 (setcar files (nconc (list (if (string= action "gnus-uu-archive") | |
1057 (cons 'action "file") | |
1058 (cons 'action action)) | |
1059 (cons 'execute (gnus-uu-command | |
1060 action name))) | |
1061 (car files)))) | |
1062 (setq files (cdr files))) | |
1063 ofiles)) | |
1064 | |
1065 (defun gnus-uu-get-action (file-name) | |
1066 (let (action) | |
1067 (setq action | |
1068 (gnus-uu-choose-action | |
1069 file-name | |
1070 (append | |
1071 gnus-uu-user-view-rules | |
1072 (if gnus-uu-ignore-default-view-rules | |
1073 nil | |
1074 gnus-uu-default-view-rules) | |
1075 gnus-uu-user-view-rules-end))) | |
1076 (when (and (not (string= (or action "") "gnus-uu-archive")) | |
1077 gnus-uu-view-with-metamail) | |
1078 (when (setq action | |
1079 (gnus-uu-choose-action file-name gnus-uu-ext-to-mime-list)) | |
1080 (setq action (format "metamail -d -b -c \"%s\"" action)))) | |
1081 action)) | |
1082 | |
1083 | |
1084 ;; Functions for treating subjects and collecting series. | |
1085 | |
1086 (defun gnus-uu-reginize-string (string) | |
1087 ;; Takes a string and puts a \ in front of every special character; | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1088 ;; replaces the last thing that looks like "2/3" with "[0-9]+/3" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1089 ;; or, if it can't find something like that, tries "2 of 3", then |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1090 ;; finally just replaces the next to last number with "[0-9]+". |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1091 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1092 (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1093 (buffer-disable-undo) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1094 (erase-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1095 (insert (regexp-quote string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1096 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1097 (setq case-fold-search nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1098 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1099 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1100 (if (re-search-backward "\\([^0-9]\\)[0-9]+/\\([0-9]+\\)" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1101 (replace-match "\\1[0-9]+/\\2") |
17493 | 1102 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1103 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1104 (if (re-search-backward "\\([^0-9]\\)[0-9]+[ \t]*of[ \t]*\\([0-9]+\\)" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1105 nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1106 (replace-match "\\1[0-9]+ of \\2") |
17493 | 1107 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1108 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1109 (if (re-search-backward "\\([^0-9]\\)[0-9]+\\([^0-9]+\\)[0-9]+" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1110 nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1111 (replace-match "\\1[0-9]+\\2[0-9]+" t nil nil nil)))) |
17493 | 1112 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1113 (goto-char 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1114 (while (re-search-forward "[ \t]+" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1115 (replace-match "[ \t]+" t t)) |
17493 | 1116 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1117 (buffer-substring 1 (point-max)))) |
17493 | 1118 |
1119 (defun gnus-uu-get-list-of-articles (n) | |
1120 ;; If N is non-nil, the article numbers of the N next articles | |
1121 ;; will be returned. | |
1122 ;; If any articles have been marked as processable, they will be | |
1123 ;; returned. | |
1124 ;; Failing that, articles that have subjects that are part of the | |
1125 ;; same "series" as the current will be returned. | |
1126 (let (articles) | |
1127 (cond | |
1128 (n | |
1129 (setq n (prefix-numeric-value n)) | |
1130 (let ((backward (< n 0)) | |
1131 (n (abs n))) | |
1132 (save-excursion | |
1133 (while (and (> n 0) | |
1134 (push (gnus-summary-article-number) | |
1135 articles) | |
1136 (gnus-summary-search-forward nil nil backward)) | |
1137 (setq n (1- n)))) | |
1138 (nreverse articles))) | |
1139 (gnus-newsgroup-processable | |
1140 (reverse gnus-newsgroup-processable)) | |
1141 (t | |
1142 (gnus-uu-find-articles-matching))))) | |
1143 | |
1144 (defun gnus-uu-string< (l1 l2) | |
1145 (string< (car l1) (car l2))) | |
1146 | |
1147 (defun gnus-uu-find-articles-matching | |
1148 (&optional subject only-unread do-not-translate) | |
1149 ;; Finds all articles that matches the regexp SUBJECT. If it is | |
1150 ;; nil, the current article name will be used. If ONLY-UNREAD is | |
1151 ;; non-nil, only unread articles are chosen. If DO-NOT-TRANSLATE is | |
1152 ;; non-nil, article names are not equalized before sorting. | |
1153 (let ((subject (or subject | |
1154 (gnus-uu-reginize-string (gnus-summary-article-subject)))) | |
1155 list-of-subjects) | |
1156 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1157 (when subject |
17493 | 1158 ;; Collect all subjects matching subject. |
1159 (let ((case-fold-search t) | |
1160 (data gnus-newsgroup-data) | |
1161 subj mark d) | |
1162 (while data | |
1163 (setq d (pop data)) | |
1164 (and (not (gnus-data-pseudo-p d)) | |
1165 (or (not only-unread) | |
1166 (= (setq mark (gnus-data-mark d)) | |
1167 gnus-unread-mark) | |
1168 (= mark gnus-ticked-mark) | |
1169 (= mark gnus-dormant-mark)) | |
1170 (setq subj (mail-header-subject (gnus-data-header d))) | |
1171 (string-match subject subj) | |
1172 (push (cons subj (gnus-data-number d)) | |
1173 list-of-subjects)))) | |
1174 | |
1175 ;; Expand numbers, sort, and return the list of article | |
1176 ;; numbers. | |
1177 (mapcar (lambda (sub) (cdr sub)) | |
1178 (sort (gnus-uu-expand-numbers | |
1179 list-of-subjects | |
1180 (not do-not-translate)) | |
1181 'gnus-uu-string<)))))) | |
1182 | |
1183 (defun gnus-uu-expand-numbers (string-list &optional translate) | |
1184 ;; Takes a list of strings and "expands" all numbers in all the | |
1185 ;; strings. That is, this function makes all numbers equal length by | |
1186 ;; prepending lots of zeroes before each number. This is to ease later | |
1187 ;; sorting to find out what sequence the articles are supposed to be | |
1188 ;; decoded in. Returns the list of expanded strings. | |
1189 (let ((out-list string-list) | |
1190 string) | |
1191 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1192 (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1193 (buffer-disable-undo) |
17493 | 1194 (while string-list |
1195 (erase-buffer) | |
1196 (insert (caar string-list)) | |
1197 ;; Translate multiple spaces to one space. | |
1198 (goto-char (point-min)) | |
1199 (while (re-search-forward "[ \t]+" nil t) | |
1200 (replace-match " ")) | |
1201 ;; Translate all characters to "a". | |
1202 (goto-char (point-min)) | |
1203 (when translate | |
1204 (while (re-search-forward "[A-Za-z]" nil t) | |
1205 (replace-match "a" t t))) | |
1206 ;; Expand numbers. | |
1207 (goto-char (point-min)) | |
1208 (while (re-search-forward "[0-9]+" nil t) | |
1209 (replace-match | |
1210 (format "%06d" | |
1211 (string-to-int (buffer-substring | |
1212 (match-beginning 0) (match-end 0)))))) | |
1213 (setq string (buffer-substring 1 (point-max))) | |
1214 (setcar (car string-list) string) | |
1215 (setq string-list (cdr string-list)))) | |
1216 out-list)) | |
1217 | |
1218 | |
1219 ;; `gnus-uu-grab-articles' is the general multi-article treatment | |
1220 ;; function. It takes a list of articles to be grabbed and a function | |
1221 ;; to apply to each article. | |
1222 ;; | |
1223 ;; The function to be called should take two parameters. The first | |
1224 ;; parameter is the article buffer. The function should leave the | |
1225 ;; result, if any, in this buffer. Most treatment functions will just | |
1226 ;; generate files... | |
1227 ;; | |
1228 ;; The second parameter is the state of the list of articles, and can | |
1229 ;; have four values: `first', `middle', `last' and `first-and-last'. | |
1230 ;; | |
1231 ;; The function should return a list. The list may contain the | |
1232 ;; following symbols: | |
1233 ;; `error' if an error occurred | |
1234 ;; `begin' if the beginning of an encoded file has been received | |
1235 ;; If the list returned contains a `begin', the first element of | |
1236 ;; the list *must* be a string with the file name of the decoded | |
1237 ;; file. | |
1238 ;; `end' if the end of an encoded file has been received | |
1239 ;; `middle' if the article was a body part of an encoded file | |
1240 ;; `wrong-type' if the article was not a part of an encoded file | |
1241 ;; `ok', which can be used everything is ok | |
1242 | |
1243 (defvar gnus-uu-has-been-grabbed nil) | |
1244 | |
1245 (defun gnus-uu-unmark-list-of-grabbed (&optional dont-unmark-last-article) | |
1246 (let (art) | |
1247 (if (not (and gnus-uu-has-been-grabbed | |
1248 gnus-uu-unmark-articles-not-decoded)) | |
1249 () | |
1250 (when dont-unmark-last-article | |
1251 (setq art (car gnus-uu-has-been-grabbed)) | |
1252 (setq gnus-uu-has-been-grabbed (cdr gnus-uu-has-been-grabbed))) | |
1253 (while gnus-uu-has-been-grabbed | |
1254 (gnus-summary-tick-article (car gnus-uu-has-been-grabbed) t) | |
1255 (setq gnus-uu-has-been-grabbed (cdr gnus-uu-has-been-grabbed))) | |
1256 (when dont-unmark-last-article | |
1257 (setq gnus-uu-has-been-grabbed (list art)))))) | |
1258 | |
1259 ;; This function takes a list of articles and a function to apply to | |
1260 ;; each article grabbed. | |
1261 ;; | |
1262 ;; This function returns a list of files decoded if the grabbing and | |
1263 ;; the process-function has been successful and nil otherwise. | |
1264 (defun gnus-uu-grab-articles (articles process-function | |
1265 &optional sloppy limit no-errors) | |
1266 (let ((state 'first) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1267 (gnus-asynchronous nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1268 (gnus-inhibit-treatment t) |
17493 | 1269 has-been-begin article result-file result-files process-state |
1270 gnus-summary-display-article-function | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1271 gnus-article-prepare-hook gnus-display-mime-function |
17493 | 1272 article-series files) |
1273 | |
1274 (while (and articles | |
1275 (not (memq 'error process-state)) | |
1276 (or sloppy | |
1277 (not (memq 'end process-state)))) | |
1278 | |
1279 (setq article (pop articles)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1280 (when (vectorp (gnus-summary-article-header article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1281 (push article article-series) |
17493 | 1282 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1283 (unless articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1284 (if (eq state 'first) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1285 (setq state 'first-and-last) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1286 (setq state 'last))) |
17493 | 1287 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1288 (let ((part (gnus-uu-part-number article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1289 (gnus-message 6 "Getting article %d%s..." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1290 article (if (string= part "") "" (concat ", " part)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1291 (gnus-summary-display-article article) |
17493 | 1292 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1293 ;; Push the article to the processing function. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1294 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1295 (set-buffer gnus-original-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1296 (let ((buffer-read-only nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1297 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1298 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1299 (setq process-state |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1300 (funcall process-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1301 gnus-original-article-buffer state))))) |
17493 | 1302 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1303 (gnus-summary-remove-process-mark article) |
17493 | 1304 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1305 ;; If this is the beginning of a decoded file, we push it |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1306 ;; on to a list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1307 (when (or (memq 'begin process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1308 (and (or (eq state 'first) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1309 (eq state 'first-and-last)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1310 (memq 'ok process-state))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1311 (when has-been-begin |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1312 ;; If there is a `result-file' here, that means that the |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1313 ;; file was unsuccessfully decoded, so we delete it. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1314 (when (and result-file |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1315 (file-exists-p result-file) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1316 (not gnus-uu-be-dangerous) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1317 (or (eq gnus-uu-be-dangerous t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1318 (gnus-y-or-n-p |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1319 (format "Delete unsuccessfully decoded file %s" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1320 result-file)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1321 (delete-file result-file))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1322 (when (memq 'begin process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1323 (setq result-file (car process-state))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1324 (setq has-been-begin t)) |
17493 | 1325 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1326 ;; Check whether we have decoded one complete file. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1327 (when (memq 'end process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1328 (setq article-series nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1329 (setq has-been-begin nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1330 (if (stringp result-file) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1331 (setq files (list result-file)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1332 (setq files result-file)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1333 (setq result-file (car files)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1334 (while files |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1335 (push (list (cons 'name (pop files)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1336 (cons 'article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1337 result-files)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1338 ;; Allow user-defined functions to be run on this file. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1339 (when gnus-uu-grabbed-file-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1340 (let ((funcs gnus-uu-grabbed-file-functions)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1341 (unless (listp funcs) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1342 (setq funcs (list funcs))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1343 (while funcs |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1344 (funcall (pop funcs) result-file)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1345 (setq result-file nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1346 ;; Check whether we have decoded enough articles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1347 (and limit (= (length result-files) limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1348 (setq articles nil))) |
17493 | 1349 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1350 ;; If this is the last article to be decoded, and |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1351 ;; we still haven't reached the end, then we delete |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1352 ;; the partially decoded file. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1353 (and (or (eq state 'last) (eq state 'first-and-last)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1354 (not (memq 'end process-state)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1355 result-file |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1356 (file-exists-p result-file) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1357 (not gnus-uu-be-dangerous) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1358 (or (eq gnus-uu-be-dangerous t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1359 (gnus-y-or-n-p |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1360 (format "Delete incomplete file %s? " result-file))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1361 (delete-file result-file)) |
17493 | 1362 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1363 ;; If this was a file of the wrong sort, then |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1364 (when (and (or (memq 'wrong-type process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1365 (memq 'error process-state)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1366 gnus-uu-unmark-articles-not-decoded) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1367 (gnus-summary-tick-article article t)) |
17493 | 1368 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1369 ;; Set the new series state. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1370 (if (and (not has-been-begin) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1371 (not sloppy) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1372 (or (memq 'end process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1373 (memq 'middle process-state))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1374 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1375 (setq process-state (list 'error)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1376 (gnus-message 2 "No begin part at the beginning") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1377 (sleep-for 2)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1378 (setq state 'middle))) |
17493 | 1379 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1380 ;; When there are no result-files, then something must be wrong. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1381 (if result-files |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1382 (message "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1383 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1384 ((not has-been-begin) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1385 (gnus-message 2 "Wrong type file")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1386 ((memq 'error process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1387 (gnus-message 2 "An error occurred during decoding")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1388 ((not (or (memq 'ok process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1389 (memq 'end process-state))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1390 (gnus-message 2 "End of articles reached before end of file"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1391 ;; Make unsuccessfully decoded articles unread. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1392 (when gnus-uu-unmark-articles-not-decoded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1393 (while article-series |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1394 (gnus-summary-tick-article (pop article-series) t))))) |
17493 | 1395 |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
1396 ;; The original article buffer is hosed, shoot it down. |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
1397 (gnus-kill-buffer gnus-original-article-buffer) |
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
1398 |
17493 | 1399 result-files)) |
1400 | |
1401 (defun gnus-uu-grab-view (file) | |
1402 "View FILE using the gnus-uu methods." | |
1403 (let ((action (gnus-uu-get-action file))) | |
1404 (gnus-execute-command | |
1405 (if (string-match "%" action) | |
1406 (format action file) | |
1407 (concat action " " file)) | |
1408 (eq gnus-view-pseudos 'not-confirm)))) | |
1409 | |
1410 (defun gnus-uu-grab-move (file) | |
1411 "Move FILE to somewhere." | |
1412 (when gnus-uu-default-dir | |
1413 (let ((to-file (concat (file-name-as-directory gnus-uu-default-dir) | |
1414 (file-name-nondirectory file)))) | |
1415 (rename-file file to-file) | |
1416 (unless (file-exists-p file) | |
1417 (make-symbolic-link to-file file))))) | |
1418 | |
1419 (defun gnus-uu-part-number (article) | |
1420 (let* ((header (gnus-summary-article-header article)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1421 (subject (and header (mail-header-subject header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1422 (part nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1423 (if subject |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1424 (while (string-match "[0-9]+/[0-9]+\\|[0-9]+[ \t]+of[ \t]+[0-9]+" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1425 subject) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1426 (setq part (match-string 0 subject)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1427 (setq subject (substring subject (match-end 0))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1428 (or part |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1429 (while (string-match "\\([0-9]+\\)[^0-9]+\\([0-9]+\\)" subject) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1430 (setq part (match-string 0 subject)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1431 (setq subject (substring subject (match-end 0))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1432 (or part ""))) |
17493 | 1433 |
1434 (defun gnus-uu-uudecode-sentinel (process event) | |
1435 (delete-process (get-process process))) | |
1436 | |
1437 (defun gnus-uu-uustrip-article (process-buffer in-state) | |
1438 ;; Uudecodes a file asynchronously. | |
1439 (save-excursion | |
1440 (set-buffer process-buffer) | |
1441 (let ((state (list 'wrong-type)) | |
1442 process-connection-type case-fold-search buffer-read-only | |
1443 files start-char) | |
1444 (goto-char (point-min)) | |
1445 | |
1446 ;; Deal with ^M at the end of the lines. | |
1447 (when gnus-uu-kill-carriage-return | |
1448 (save-excursion | |
1449 (while (search-forward "\r" nil t) | |
1450 (delete-backward-char 1)))) | |
1451 | |
1452 (while (or (re-search-forward gnus-uu-begin-string nil t) | |
1453 (re-search-forward gnus-uu-body-line nil t)) | |
1454 (setq state (list 'ok)) | |
1455 ;; Ok, we are at the first uucoded line. | |
1456 (beginning-of-line) | |
1457 (setq start-char (point)) | |
1458 | |
1459 (if (not (looking-at gnus-uu-begin-string)) | |
1460 (setq state (list 'middle)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
1461 ;; This is the beginning of a uuencoded article. |
17493 | 1462 ;; We replace certain characters that could make things messy. |
1463 (setq gnus-uu-file-name | |
1464 (let ((nnheader-file-name-translation-alist | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1465 '((?/ . ?,) (? . ?_) (?* . ?_) (?$ . ?_)))) |
17493 | 1466 (nnheader-translate-file-chars (match-string 1)))) |
1467 (replace-match (concat "begin 644 " gnus-uu-file-name) t t) | |
1468 | |
1469 ;; Remove any non gnus-uu-body-line right after start. | |
1470 (forward-line 1) | |
1471 (while (and (not (eobp)) | |
1472 (not (looking-at gnus-uu-body-line))) | |
1473 (gnus-delete-line)) | |
1474 | |
1475 ;; If a process is running, we kill it. | |
1476 (when (and gnus-uu-uudecode-process | |
1477 (memq (process-status gnus-uu-uudecode-process) | |
1478 '(run stop))) | |
1479 (delete-process gnus-uu-uudecode-process) | |
1480 (gnus-uu-unmark-list-of-grabbed t)) | |
1481 | |
1482 ;; Start a new uudecoding process. | |
1483 (let ((cdir default-directory)) | |
1484 (unwind-protect | |
1485 (progn | |
1486 (cd gnus-uu-work-dir) | |
1487 (setq gnus-uu-uudecode-process | |
1488 (start-process | |
1489 "*uudecode*" | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1490 (gnus-get-buffer-create gnus-uu-output-buffer-name) |
17493 | 1491 shell-file-name shell-command-switch |
1492 (format "cd %s %s uudecode" gnus-uu-work-dir | |
1493 gnus-shell-command-separator)))) | |
1494 (cd cdir))) | |
1495 (set-process-sentinel | |
1496 gnus-uu-uudecode-process 'gnus-uu-uudecode-sentinel) | |
1497 (setq state (list 'begin)) | |
1498 (push (concat gnus-uu-work-dir gnus-uu-file-name) files)) | |
1499 | |
1500 ;; We look for the end of the thing to be decoded. | |
1501 (if (re-search-forward gnus-uu-end-string nil t) | |
1502 (push 'end state) | |
1503 (goto-char (point-max)) | |
1504 (re-search-backward gnus-uu-body-line nil t)) | |
1505 | |
1506 (forward-line 1) | |
1507 | |
1508 (when gnus-uu-uudecode-process | |
1509 (when (memq (process-status gnus-uu-uudecode-process) '(run stop)) | |
1510 ;; Try to correct mishandled uucode. | |
1511 (when gnus-uu-correct-stripped-uucode | |
1512 (gnus-uu-check-correct-stripped-uucode start-char (point))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1513 (gnus-run-hooks 'gnus-uu-pre-uudecode-hook) |
17493 | 1514 |
1515 ;; Send the text to the process. | |
1516 (condition-case nil | |
1517 (process-send-region | |
1518 gnus-uu-uudecode-process start-char (point)) | |
1519 (error | |
1520 (progn | |
1521 (delete-process gnus-uu-uudecode-process) | |
1522 (gnus-message 2 "gnus-uu: Couldn't uudecode") | |
1523 (setq state (list 'wrong-type))))) | |
1524 | |
1525 (if (memq 'end state) | |
1526 (progn | |
1527 ;; Send an EOF, just in case. | |
1528 (ignore-errors | |
1529 (process-send-eof gnus-uu-uudecode-process)) | |
1530 (while (memq (process-status gnus-uu-uudecode-process) | |
1531 '(open run)) | |
1532 (accept-process-output gnus-uu-uudecode-process 1))) | |
1533 (when (or (not gnus-uu-uudecode-process) | |
1534 (not (memq (process-status gnus-uu-uudecode-process) | |
1535 '(run stop)))) | |
1536 (setq state (list 'wrong-type))))))) | |
1537 | |
1538 (if (memq 'begin state) | |
1539 (cons (if (= (length files) 1) (car files) files) state) | |
1540 state)))) | |
1541 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1542 (defvar gnus-uu-unshar-warning |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1543 "*** WARNING *** |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1544 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1545 Shell archives are an archaic method of bundling files for distribution |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1546 across computer networks. During the unpacking process, arbitrary commands |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1547 are executed on your system, and all kinds of nasty things can happen. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1548 Please examine the archive very carefully before you instruct Emacs to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1549 unpack it. You can browse the archive buffer using \\[scroll-other-window]. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1550 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1551 If you are unsure what to do, please answer \"no\"." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1552 "Text of warning message displayed by `gnus-uu-unshar-article'. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1553 Make sure that this text consists only of few text lines. Otherwise, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1554 Gnus might fail to display all of it.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1555 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1556 |
17493 | 1557 ;; This function is used by `gnus-uu-grab-articles' to treat |
1558 ;; a shared article. | |
1559 (defun gnus-uu-unshar-article (process-buffer in-state) | |
1560 (let ((state (list 'ok)) | |
1561 start-char) | |
1562 (save-excursion | |
1563 (set-buffer process-buffer) | |
1564 (goto-char (point-min)) | |
1565 (if (not (re-search-forward gnus-uu-shar-begin-string nil t)) | |
1566 (setq state (list 'wrong-type)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1567 (save-window-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1568 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1569 (switch-to-buffer (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1570 (delete-other-windows) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1571 (let ((buffer (get-buffer-create (generate-new-buffer-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1572 "*Warning*")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1573 (unless |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1574 (unwind-protect |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1575 (with-current-buffer buffer |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
1576 (insert (substitute-command-keys |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1577 gnus-uu-unshar-warning)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1578 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1579 (display-buffer buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1580 (yes-or-no-p "This is a shell archive, unshar it? ")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1581 (kill-buffer buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1582 (setq state (list 'error)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1583 (unless (memq 'error state) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1584 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1585 (setq start-char (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1586 (call-process-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1587 start-char (point-max) shell-file-name nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1588 (gnus-get-buffer-create gnus-uu-output-buffer-name) nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1589 shell-command-switch |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1590 (concat "cd " gnus-uu-work-dir " " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1591 gnus-shell-command-separator " sh"))))) |
17493 | 1592 state)) |
1593 | |
1594 ;; Returns the name of what the shar file is going to unpack. | |
1595 (defun gnus-uu-find-name-in-shar () | |
1596 (let ((oldpoint (point)) | |
1597 res) | |
1598 (goto-char (point-min)) | |
1599 (when (re-search-forward gnus-uu-shar-name-marker nil t) | |
1600 (setq res (buffer-substring (match-beginning 1) (match-end 1)))) | |
1601 (goto-char oldpoint) | |
1602 res)) | |
1603 | |
1604 ;; `gnus-uu-choose-action' chooses what action to perform given the name | |
1605 ;; and `gnus-uu-file-action-list'. Returns either nil if no action is | |
1606 ;; found, or the name of the command to run if such a rule is found. | |
1607 (defun gnus-uu-choose-action (file-name file-action-list &optional no-ignore) | |
1608 (let ((action-list (copy-sequence file-action-list)) | |
1609 (case-fold-search t) | |
1610 rule action) | |
1611 (and | |
1612 (unless no-ignore | |
1613 (and (not | |
1614 (and gnus-uu-ignore-files-by-name | |
1615 (string-match gnus-uu-ignore-files-by-name file-name))) | |
1616 (not | |
1617 (and gnus-uu-ignore-files-by-type | |
1618 (string-match gnus-uu-ignore-files-by-type | |
1619 (or (gnus-uu-choose-action | |
1620 file-name gnus-uu-ext-to-mime-list t) | |
1621 "")))))) | |
1622 (while (not (or (eq action-list ()) action)) | |
1623 (setq rule (car action-list)) | |
1624 (setq action-list (cdr action-list)) | |
1625 (when (string-match (car rule) file-name) | |
1626 (setq action (cadr rule))))) | |
1627 action)) | |
1628 | |
1629 (defun gnus-uu-treat-archive (file-path) | |
1630 ;; Unpacks an archive. Returns t if unpacking is successful. | |
1631 (let ((did-unpack t) | |
1632 action command dir) | |
1633 (setq action (gnus-uu-choose-action | |
1634 file-path (append gnus-uu-user-archive-rules | |
1635 (if gnus-uu-ignore-default-archive-rules | |
1636 nil | |
1637 gnus-uu-default-archive-rules)))) | |
1638 | |
1639 (when (not action) | |
1640 (error "No unpackers for the file %s" file-path)) | |
1641 | |
1642 (string-match "/[^/]*$" file-path) | |
1643 (setq dir (substring file-path 0 (match-beginning 0))) | |
1644 | |
1645 (when (member action gnus-uu-destructive-archivers) | |
1646 (copy-file file-path (concat file-path "~") t)) | |
1647 | |
1648 (setq command (format "cd %s ; %s" dir (gnus-uu-command action file-path))) | |
1649 | |
1650 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1651 (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name)) |
17493 | 1652 (erase-buffer)) |
1653 | |
1654 (gnus-message 5 "Unpacking: %s..." (gnus-uu-command action file-path)) | |
1655 | |
1656 (if (= 0 (call-process shell-file-name nil | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1657 (gnus-get-buffer-create gnus-uu-output-buffer-name) |
17493 | 1658 nil shell-command-switch command)) |
1659 (message "") | |
1660 (gnus-message 2 "Error during unpacking of archive") | |
1661 (setq did-unpack nil)) | |
1662 | |
1663 (when (member action gnus-uu-destructive-archivers) | |
1664 (rename-file (concat file-path "~") file-path t)) | |
1665 | |
1666 did-unpack)) | |
1667 | |
1668 (defun gnus-uu-dir-files (dir) | |
1669 (let ((dirs (directory-files dir t "[^/][^\\.][^\\.]?$")) | |
1670 files file) | |
1671 (while dirs | |
1672 (if (file-directory-p (setq file (car dirs))) | |
1673 (setq files (append files (gnus-uu-dir-files file))) | |
1674 (push file files)) | |
1675 (setq dirs (cdr dirs))) | |
1676 files)) | |
1677 | |
1678 (defun gnus-uu-unpack-files (files &optional ignore) | |
1679 ;; Go through FILES and look for files to unpack. | |
1680 (let* ((totfiles (gnus-uu-ls-r gnus-uu-work-dir)) | |
1681 (ofiles files) | |
1682 file did-unpack) | |
1683 (while files | |
1684 (setq file (cdr (assq 'name (car files)))) | |
1685 (when (and (not (member file ignore)) | |
1686 (equal (gnus-uu-get-action (file-name-nondirectory file)) | |
1687 "gnus-uu-archive")) | |
1688 (push file did-unpack) | |
1689 (unless (gnus-uu-treat-archive file) | |
1690 (gnus-message 2 "Error during unpacking of %s" file)) | |
1691 (let* ((newfiles (gnus-uu-ls-r gnus-uu-work-dir)) | |
1692 (nfiles newfiles)) | |
1693 (while nfiles | |
1694 (unless (member (car nfiles) totfiles) | |
1695 (push (list (cons 'name (car nfiles)) | |
1696 (cons 'original file)) | |
1697 ofiles)) | |
1698 (setq nfiles (cdr nfiles))) | |
1699 (setq totfiles newfiles))) | |
1700 (setq files (cdr files))) | |
1701 (if did-unpack | |
1702 (gnus-uu-unpack-files ofiles (append did-unpack ignore)) | |
1703 ofiles))) | |
1704 | |
1705 (defun gnus-uu-ls-r (dir) | |
1706 (let* ((files (gnus-uu-directory-files dir t)) | |
1707 (ofiles files)) | |
1708 (while files | |
1709 (when (file-directory-p (car files)) | |
1710 (setq ofiles (delete (car files) ofiles)) | |
1711 (setq ofiles (append ofiles (gnus-uu-ls-r (car files))))) | |
1712 (setq files (cdr files))) | |
1713 ofiles)) | |
1714 | |
1715 ;; Various stuff | |
1716 | |
1717 (defun gnus-uu-directory-files (dir &optional full) | |
1718 (let (files out file) | |
1719 (setq files (directory-files dir full)) | |
1720 (while files | |
1721 (setq file (car files)) | |
1722 (setq files (cdr files)) | |
1723 (unless (member (file-name-nondirectory file) '("." "..")) | |
1724 (push file out))) | |
1725 (setq out (nreverse out)) | |
1726 out)) | |
1727 | |
1728 (defun gnus-uu-check-correct-stripped-uucode (start end) | |
1729 (save-excursion | |
1730 (let (found beg length) | |
1731 (if (not gnus-uu-correct-stripped-uucode) | |
1732 () | |
1733 (goto-char start) | |
1734 | |
1735 (if (re-search-forward " \\|`" end t) | |
1736 (progn | |
1737 (goto-char start) | |
1738 (while (not (eobp)) | |
1739 (progn | |
1740 (when (looking-at "\n") | |
1741 (replace-match "")) | |
1742 (forward-line 1)))) | |
1743 | |
1744 (while (not (eobp)) | |
1745 (if (looking-at (concat gnus-uu-begin-string "\\|" | |
1746 gnus-uu-end-string)) | |
1747 () | |
1748 (when (not found) | |
1749 (beginning-of-line) | |
1750 (setq beg (point)) | |
1751 (end-of-line) | |
1752 (setq length (- (point) beg))) | |
1753 (setq found t) | |
1754 (beginning-of-line) | |
1755 (setq beg (point)) | |
1756 (end-of-line) | |
1757 (when (not (= length (- (point) beg))) | |
1758 (insert (make-string (- length (- (point) beg)) ? )))) | |
1759 (forward-line 1))))))) | |
1760 | |
1761 (defvar gnus-uu-tmp-alist nil) | |
1762 | |
1763 (defun gnus-uu-initialize (&optional scan) | |
1764 (let (entry) | |
1765 (if (and (not scan) | |
1766 (when (setq entry (assoc gnus-newsgroup-name gnus-uu-tmp-alist)) | |
1767 (if (file-exists-p (cdr entry)) | |
1768 (setq gnus-uu-work-dir (cdr entry)) | |
1769 (setq gnus-uu-tmp-alist (delq entry gnus-uu-tmp-alist)) | |
1770 nil))) | |
1771 t | |
1772 (setq gnus-uu-tmp-dir (file-name-as-directory | |
1773 (expand-file-name gnus-uu-tmp-dir))) | |
1774 (if (not (file-directory-p gnus-uu-tmp-dir)) | |
1775 (error "Temp directory %s doesn't exist" gnus-uu-tmp-dir) | |
1776 (when (not (file-writable-p gnus-uu-tmp-dir)) | |
1777 (error "Temp directory %s can't be written to" | |
1778 gnus-uu-tmp-dir))) | |
1779 | |
1780 (setq gnus-uu-work-dir | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1781 (make-temp-name (concat gnus-uu-tmp-dir "gnus"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1782 (gnus-make-directory gnus-uu-work-dir) |
17493 | 1783 (set-file-modes gnus-uu-work-dir 448) |
1784 (setq gnus-uu-work-dir (file-name-as-directory gnus-uu-work-dir)) | |
1785 (push (cons gnus-newsgroup-name gnus-uu-work-dir) | |
1786 gnus-uu-tmp-alist)))) | |
1787 | |
1788 | |
1789 ;; Kills the temporary uu buffers, kills any processes, etc. | |
1790 (defun gnus-uu-clean-up () | |
1791 (let (buf) | |
1792 (and gnus-uu-uudecode-process | |
1793 (memq (process-status (or gnus-uu-uudecode-process "nevair")) | |
1794 '(stop run)) | |
1795 (delete-process gnus-uu-uudecode-process)) | |
1796 (when (setq buf (get-buffer gnus-uu-output-buffer-name)) | |
1797 (kill-buffer buf)))) | |
1798 | |
1799 ;; Inputs an action and a filename and returns a full command, making sure | |
1800 ;; that the filename will be treated as a single argument when the shell | |
1801 ;; executes the command. | |
1802 (defun gnus-uu-command (action file) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1803 (let ((quoted-file (mm-quote-arg file))) |
17493 | 1804 (if (string-match "%s" action) |
1805 (format action quoted-file) | |
1806 (concat action " " quoted-file)))) | |
1807 | |
1808 (defun gnus-uu-delete-work-dir (&optional dir) | |
1809 "Delete recursively all files and directories under `gnus-uu-work-dir'." | |
1810 (if dir | |
1811 (gnus-message 7 "Deleting directory %s..." dir) | |
1812 (setq dir gnus-uu-work-dir)) | |
1813 (when (and dir | |
1814 (file-exists-p dir)) | |
1815 (let ((files (directory-files dir t nil t)) | |
1816 file) | |
1817 (while (setq file (pop files)) | |
1818 (unless (member (file-name-nondirectory file) '("." "..")) | |
1819 (if (file-directory-p file) | |
1820 (gnus-uu-delete-work-dir file) | |
1821 (gnus-message 9 "Deleting file %s..." file) | |
1822 (delete-file file)))) | |
1823 (delete-directory dir))) | |
1824 (gnus-message 7 "")) | |
1825 | |
1826 ;; Initializing | |
1827 | |
1828 (add-hook 'gnus-exit-group-hook 'gnus-uu-clean-up) | |
1829 (add-hook 'gnus-exit-group-hook 'gnus-uu-delete-work-dir) | |
1830 | |
1831 | |
1832 | |
1833 ;;; | |
1834 ;;; uuencoded posting | |
1835 ;;; | |
1836 | |
1837 ;; Any function that is to be used as and encoding method will take two | |
1838 ;; parameters: PATH-NAME and FILE-NAME. (E.g. "/home/gaga/spiral.jpg" | |
1839 ;; and "spiral.jpg", respectively.) The function should return nil if | |
1840 ;; the encoding wasn't successful. | |
1841 (defcustom gnus-uu-post-encode-method 'gnus-uu-post-encode-uuencode | |
1842 "Function used for encoding binary files. | |
1843 There are three functions supplied with gnus-uu for encoding files: | |
1844 `gnus-uu-post-encode-uuencode', which does straight uuencoding; | |
1845 `gnus-uu-post-encode-mime', which encodes with base64 and adds MIME | |
1846 headers; and `gnus-uu-post-encode-mime-uuencode', which encodes with | |
1847 uuencode and adds MIME headers." | |
1848 :group 'gnus-extract-post | |
1849 :type '(radio (function-item gnus-uu-post-encode-uuencode) | |
1850 (function-item gnus-uu-post-encode-mime) | |
1851 (function-item gnus-uu-post-encode-mime-uuencode) | |
1852 (function :tag "Other"))) | |
1853 | |
1854 (defcustom gnus-uu-post-include-before-composing nil | |
1855 "Non-nil means that gnus-uu will ask for a file to encode before you compose the article. | |
1856 If this variable is t, you can either include an encoded file with | |
1857 \\[gnus-uu-post-insert-binary-in-article] or have one included for you when you post the article." | |
1858 :group 'gnus-extract-post | |
1859 :type 'boolean) | |
1860 | |
1861 (defcustom gnus-uu-post-length 990 | |
1862 "Maximum length of an article. | |
1863 The encoded file will be split into how many articles it takes to | |
1864 post the entire file." | |
1865 :group 'gnus-extract-post | |
1866 :type 'integer) | |
1867 | |
1868 (defcustom gnus-uu-post-threaded nil | |
1869 "Non-nil means that gnus-uu will post the encoded file in a thread. | |
1870 This may not be smart, as no other decoder I have seen are able to | |
1871 follow threads when collecting uuencoded articles. (Well, I have seen | |
1872 one package that does that - gnus-uu, but somehow, I don't think that | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
1873 counts...) The default is nil." |
17493 | 1874 :group 'gnus-extract-post |
1875 :type 'boolean) | |
1876 | |
1877 (defcustom gnus-uu-post-separate-description t | |
1878 "Non-nil means that the description will be posted in a separate article. | |
1879 The first article will typically be numbered (0/x). If this variable | |
1880 is nil, the description the user enters will be included at the | |
1881 beginning of the first article, which will be numbered (1/x). Default | |
1882 is t." | |
1883 :group 'gnus-extract-post | |
1884 :type 'boolean) | |
1885 | |
1886 (defvar gnus-uu-post-binary-separator "--binary follows this line--") | |
1887 (defvar gnus-uu-post-message-id nil) | |
1888 (defvar gnus-uu-post-inserted-file-name nil) | |
1889 (defvar gnus-uu-winconf-post-news nil) | |
1890 | |
1891 (defun gnus-uu-post-news () | |
1892 "Compose an article and post an encoded file." | |
1893 (interactive) | |
1894 (setq gnus-uu-post-inserted-file-name nil) | |
1895 (setq gnus-uu-winconf-post-news (current-window-configuration)) | |
1896 | |
1897 (gnus-summary-post-news) | |
1898 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1899 (let ((map (make-sparse-keymap))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1900 (set-keymap-parent map (current-local-map)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1901 (use-local-map map)) |
17493 | 1902 (local-set-key "\C-c\C-c" 'gnus-summary-edit-article-done) |
1903 (local-set-key "\C-c\C-c" 'gnus-uu-post-news-inews) | |
1904 (local-set-key "\C-c\C-s" 'gnus-uu-post-news-inews) | |
1905 (local-set-key "\C-c\C-i" 'gnus-uu-post-insert-binary-in-article) | |
1906 | |
1907 (when gnus-uu-post-include-before-composing | |
1908 (save-excursion (setq gnus-uu-post-inserted-file-name | |
1909 (gnus-uu-post-insert-binary))))) | |
1910 | |
1911 (defun gnus-uu-post-insert-binary-in-article () | |
1912 "Inserts an encoded file in the buffer. | |
1913 The user will be asked for a file name." | |
1914 (interactive) | |
1915 (save-excursion | |
1916 (setq gnus-uu-post-inserted-file-name (gnus-uu-post-insert-binary)))) | |
1917 | |
1918 ;; Encodes with uuencode and substitutes all spaces with backticks. | |
1919 (defun gnus-uu-post-encode-uuencode (path file-name) | |
1920 (when (gnus-uu-post-encode-file "uuencode" path file-name) | |
1921 (goto-char (point-min)) | |
1922 (forward-line 1) | |
1923 (while (re-search-forward " " nil t) | |
1924 (replace-match "`")) | |
1925 t)) | |
1926 | |
1927 ;; Encodes with uuencode and adds MIME headers. | |
1928 (defun gnus-uu-post-encode-mime-uuencode (path file-name) | |
1929 (when (gnus-uu-post-encode-uuencode path file-name) | |
1930 (gnus-uu-post-make-mime file-name "x-uue") | |
1931 t)) | |
1932 | |
1933 ;; Encodes with base64 and adds MIME headers | |
1934 (defun gnus-uu-post-encode-mime (path file-name) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1935 (when (zerop (call-process shell-file-name nil t nil shell-command-switch |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1936 (format "%s %s -o %s" "mmencode" path file-name))) |
17493 | 1937 (gnus-uu-post-make-mime file-name "base64") |
1938 t)) | |
1939 | |
1940 ;; Adds MIME headers. | |
1941 (defun gnus-uu-post-make-mime (file-name encoding) | |
1942 (goto-char (point-min)) | |
1943 (insert (format "Content-Type: %s; name=\"%s\"\n" | |
1944 (gnus-uu-choose-action file-name gnus-uu-ext-to-mime-list) | |
1945 file-name)) | |
1946 (insert (format "Content-Transfer-Encoding: %s\n\n" encoding)) | |
1947 (save-restriction | |
1948 (set-buffer gnus-message-buffer) | |
1949 (goto-char (point-min)) | |
1950 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$")) | |
1951 (forward-line -1) | |
1952 (narrow-to-region 1 (point)) | |
1953 (unless (mail-fetch-field "mime-version") | |
1954 (widen) | |
1955 (insert "MIME-Version: 1.0\n")) | |
1956 (widen))) | |
1957 | |
1958 ;; Encodes a file PATH with COMMAND, leaving the result in the | |
1959 ;; current buffer. | |
1960 (defun gnus-uu-post-encode-file (command path file-name) | |
1961 (= 0 (call-process shell-file-name nil t nil shell-command-switch | |
1962 (format "%s %s %s" command path file-name)))) | |
1963 | |
1964 (defun gnus-uu-post-news-inews () | |
1965 "Posts the composed news article and encoded file. | |
1966 If no file has been included, the user will be asked for a file." | |
1967 (interactive) | |
1968 | |
1969 (let (file-name) | |
1970 | |
1971 (if gnus-uu-post-inserted-file-name | |
1972 (setq file-name gnus-uu-post-inserted-file-name) | |
1973 (setq file-name (gnus-uu-post-insert-binary))) | |
1974 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
1975 (gnus-uu-post-encoded file-name gnus-uu-post-threaded)) |
17493 | 1976 (setq gnus-uu-post-inserted-file-name nil) |
1977 (when gnus-uu-winconf-post-news | |
1978 (set-window-configuration gnus-uu-winconf-post-news))) | |
1979 | |
1980 ;; Asks for a file to encode, encodes it and inserts the result in | |
1981 ;; the current buffer. Returns the file name the user gave. | |
1982 (defun gnus-uu-post-insert-binary () | |
1983 (let ((uuencode-buffer-name "*uuencode buffer*") | |
1984 file-path uubuf file-name) | |
1985 | |
1986 (setq file-path (read-file-name | |
1987 "What file do you want to encode? ")) | |
1988 (when (not (file-exists-p file-path)) | |
1989 (error "%s: No such file" file-path)) | |
1990 | |
1991 (goto-char (point-max)) | |
1992 (insert (format "\n%s\n" gnus-uu-post-binary-separator)) | |
1993 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1994 ;; #### Unix-specific? |
17493 | 1995 (when (string-match "^~/" file-path) |
1996 (setq file-path (concat "$HOME" (substring file-path 1)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1997 ;; #### Unix-specific? |
17493 | 1998 (if (string-match "/[^/]*$" file-path) |
1999 (setq file-name (substring file-path (1+ (match-beginning 0)))) | |
2000 (setq file-name file-path)) | |
2001 | |
2002 (unwind-protect | |
2003 (if (save-excursion | |
2004 (set-buffer (setq uubuf | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
2005 (gnus-get-buffer-create uuencode-buffer-name))) |
17493 | 2006 (erase-buffer) |
2007 (funcall gnus-uu-post-encode-method file-path file-name)) | |
2008 (insert-buffer-substring uubuf) | |
2009 (error "Encoding unsuccessful")) | |
2010 (kill-buffer uubuf)) | |
2011 file-name)) | |
2012 | |
2013 ;; Posts the article and all of the encoded file. | |
2014 (defun gnus-uu-post-encoded (file-name &optional threaded) | |
2015 (let ((send-buffer-name "*uuencode send buffer*") | |
2016 (encoded-buffer-name "*encoded buffer*") | |
2017 (top-string "[ cut here %s (%s %d/%d) %s gnus-uu ]") | |
2018 (separator (concat mail-header-separator "\n\n")) | |
2019 uubuf length parts header i end beg | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
2020 beg-line minlen post-buf whole-len beg-binary end-binary) |
17493 | 2021 |
2022 (setq post-buf (current-buffer)) | |
2023 | |
2024 (goto-char (point-min)) | |
2025 (when (not (re-search-forward | |
2026 (if gnus-uu-post-separate-description | |
2027 (concat "^" (regexp-quote gnus-uu-post-binary-separator) | |
2028 "$") | |
2029 (concat "^" (regexp-quote mail-header-separator) "$")) | |
2030 nil t)) | |
2031 (error "Internal error: No binary/header separator")) | |
2032 (beginning-of-line) | |
2033 (forward-line 1) | |
2034 (setq beg-binary (point)) | |
2035 (setq end-binary (point-max)) | |
2036 | |
2037 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
2038 (set-buffer (setq uubuf (gnus-get-buffer-create encoded-buffer-name))) |
17493 | 2039 (erase-buffer) |
2040 (insert-buffer-substring post-buf beg-binary end-binary) | |
2041 (goto-char (point-min)) | |
2042 (setq length (count-lines 1 (point-max))) | |
2043 (setq parts (/ length gnus-uu-post-length)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2044 (unless (< (% length gnus-uu-post-length) 4) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2045 (incf parts))) |
17493 | 2046 |
2047 (when gnus-uu-post-separate-description | |
2048 (forward-line -1)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2049 (delete-region (point) (point-max)) |
17493 | 2050 |
2051 (goto-char (point-min)) | |
2052 (re-search-forward | |
2053 (concat "^" (regexp-quote mail-header-separator) "$") nil t) | |
2054 (beginning-of-line) | |
2055 (setq header (buffer-substring 1 (point))) | |
2056 | |
2057 (goto-char (point-min)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2058 (when gnus-uu-post-separate-description |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2059 (when (re-search-forward "^Subject: " nil t) |
17493 | 2060 (end-of-line) |
2061 (insert (format " (0/%d)" parts))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2062 (save-excursion |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2063 (message-send)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2064 (setq gnus-uu-post-message-id (message-fetch-field "message-id"))) |
17493 | 2065 |
2066 (save-excursion | |
2067 (setq i 1) | |
2068 (setq beg 1) | |
2069 (while (not (> i parts)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
2070 (set-buffer (gnus-get-buffer-create send-buffer-name)) |
17493 | 2071 (erase-buffer) |
2072 (insert header) | |
2073 (when (and threaded gnus-uu-post-message-id) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2074 (insert "References: " gnus-uu-post-message-id "\n")) |
17493 | 2075 (insert separator) |
2076 (setq whole-len | |
2077 (- 62 (length (format top-string "" file-name i parts "")))) | |
2078 (when (> 1 (setq minlen (/ whole-len 2))) | |
2079 (setq minlen 1)) | |
2080 (setq | |
2081 beg-line | |
2082 (format top-string | |
2083 (make-string minlen ?-) | |
2084 file-name i parts | |
2085 (make-string | |
2086 (if (= 0 (% whole-len 2)) (1- minlen) minlen) ?-))) | |
2087 | |
2088 (goto-char (point-min)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2089 (when (re-search-forward "^Subject: " nil t) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2090 (end-of-line) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2091 (insert (format " (%d/%d)" i parts))) |
17493 | 2092 |
2093 (goto-char (point-max)) | |
2094 (save-excursion | |
2095 (set-buffer uubuf) | |
2096 (goto-char beg) | |
2097 (if (= i parts) | |
2098 (goto-char (point-max)) | |
2099 (forward-line gnus-uu-post-length)) | |
2100 (when (and (= (1+ i) parts) (< (count-lines (point) (point-max)) 4)) | |
2101 (forward-line -4)) | |
2102 (setq end (point))) | |
2103 (insert-buffer-substring uubuf beg end) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2104 (insert beg-line "\n") |
17493 | 2105 (setq beg end) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2106 (incf i) |
17493 | 2107 (goto-char (point-min)) |
2108 (re-search-forward | |
2109 (concat "^" (regexp-quote mail-header-separator) "$") nil t) | |
2110 (beginning-of-line) | |
2111 (forward-line 2) | |
2112 (when (re-search-forward | |
2113 (concat "^" (regexp-quote gnus-uu-post-binary-separator) "$") | |
2114 nil t) | |
2115 (replace-match "") | |
2116 (forward-line 1)) | |
2117 (insert beg-line) | |
2118 (insert "\n") | |
2119 (let (message-sent-message-via) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2120 (save-excursion |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2121 (message-send)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2122 (setq gnus-uu-post-message-id |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2123 (concat (message-fetch-field "references") " " |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2124 (message-fetch-field "message-id")))))) |
17493 | 2125 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2126 (gnus-kill-buffer send-buffer-name) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2127 (gnus-kill-buffer encoded-buffer-name) |
17493 | 2128 |
2129 (when (not gnus-uu-post-separate-description) | |
2130 (set-buffer-modified-p nil) | |
2131 (when (fboundp 'bury-buffer) | |
2132 (bury-buffer))))) | |
2133 | |
2134 (provide 'gnus-uu) | |
2135 | |
2136 ;; gnus-uu.el ends here |