Mercurial > emacs
annotate lisp/gnus/gnus-uu.el @ 95329:3bf215f97a31
(vc-string-prefix-p): New function.
(vc-dir-parent-marked-p): Use it.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 27 May 2008 01:13:25 +0000 |
parents | f42ef85caf91 |
children | a9dc0e7c3f2b |
rev | line source |
---|---|
17493 | 1 ;;; gnus-uu.el --- extract (uu)encoded files in Gnus |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64712
diff
changeset
|
2 |
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64712
diff
changeset
|
3 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, |
79708 | 4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 7 ;; Created: 2 Oct 1993 |
8 ;; Keyword: news | |
9 | |
10 ;; This file is part of GNU Emacs. | |
11 | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
12 ;; GNU Emacs is free software: you can redistribute it and/or modify |
17493 | 13 ;; it under the terms of the GNU General Public License as published by |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; the Free Software Foundation, either version 3 of the License, or |
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
15 ;; (at your option) any later version. |
17493 | 16 |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
17493 | 24 |
25 ;;; Commentary: | |
26 | |
27 ;;; Code: | |
28 | |
19634
118761d47324
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
29 (eval-when-compile (require 'cl)) |
118761d47324
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 |
17493 | 31 (require 'gnus) |
32 (require 'gnus-art) | |
33 (require 'message) | |
34 (require 'gnus-msg) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
35 (require 'mm-decode) |
87097 | 36 (require 'yenc) |
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. |
79416
3741d4f6b713
(gnus-uu-default-view-rules): Fix typos in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
78224
diff
changeset
|
77 To change the behavior, you can either edit this variable or set |
17493 | 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 | |
79416
3741d4f6b713
(gnus-uu-default-view-rules): Fix typos in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
78224
diff
changeset
|
97 There are several user variables to tailor the behavior of gnus-uu to |
17493 | 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. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
302 The headers will be included in the sequence they are matched. If nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
303 include all headers." |
17493 | 304 :group 'gnus-extract |
305 :type '(repeat regexp)) | |
306 | |
307 (defcustom gnus-uu-save-separate-articles nil | |
308 "*Non-nil means that gnus-uu will save articles in separate files." | |
309 :group 'gnus-extract | |
310 :type 'boolean) | |
311 | |
312 (defcustom gnus-uu-be-dangerous 'ask | |
313 "*Specifies what to do if unusual situations arise during decoding. | |
314 If nil, be as conservative as possible. If t, ignore things that | |
315 didn't work, and overwrite existing files. Otherwise, ask each time." | |
316 :group 'gnus-extract | |
317 :type '(choice (const :tag "conservative" nil) | |
318 (const :tag "ask" ask) | |
319 (const :tag "liberal" t))) | |
320 | |
321 ;; Internal variables | |
322 | |
323 (defvar gnus-uu-saved-article-name nil) | |
324 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
325 (defvar gnus-uu-begin-string "^begin[ \t]+0?[0-7][0-7][0-7][ \t]+\\(.*\\)$") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
326 (defvar gnus-uu-end-string "^end[ \t]*$") |
17493 | 327 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
328 (defvar gnus-uu-body-line "^M") |
17493 | 329 (let ((i 61)) |
330 (while (> (setq i (1- i)) 0) | |
331 (setq gnus-uu-body-line (concat gnus-uu-body-line "[^a-z]"))) | |
332 (setq gnus-uu-body-line (concat gnus-uu-body-line ".?$"))) | |
333 | |
334 ;"^M.............................................................?$" | |
335 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
336 (defvar gnus-uu-shar-begin-string "^#! */bin/sh") |
17493 | 337 |
338 (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
|
339 (defvar gnus-uu-shar-name-marker |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
340 "begin 0?[0-7][0-7][0-7][ \t]+\\(\\(\\w\\|[.\\:]\\)*\\b\\)") |
17493 | 341 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
342 (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
|
343 (defvar gnus-uu-postscript-end-string "^%%EOF$") |
17493 | 344 |
345 (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
|
346 (defvar gnus-uu-uudecode-process nil) |
17493 | 347 (defvar gnus-uu-binhex-article-name nil) |
87097 | 348 (defvar gnus-uu-yenc-article-name nil) |
17493 | 349 |
350 (defvar gnus-uu-work-dir nil) | |
351 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
352 (defvar gnus-uu-output-buffer-name " *Gnus UU Output*") |
17493 | 353 |
354 (defvar gnus-uu-default-dir gnus-article-save-directory) | |
355 (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
|
356 (defvar gnus-uu-digest-buffer nil) |
17493 | 357 |
358 ;; Commands. | |
359 | |
360 (defun gnus-uu-decode-uu (&optional n) | |
361 "Uudecodes the current article." | |
362 (interactive "P") | |
363 (gnus-uu-decode-with-method 'gnus-uu-uustrip-article n)) | |
364 | |
365 (defun gnus-uu-decode-uu-and-save (n dir) | |
366 "Decodes and saves the resulting file." | |
367 (interactive | |
368 (list current-prefix-arg | |
369 (file-name-as-directory | |
370 (read-file-name "Uudecode and save in dir: " | |
371 gnus-uu-default-dir | |
372 gnus-uu-default-dir t)))) | |
373 (gnus-uu-decode-with-method 'gnus-uu-uustrip-article n dir nil nil t)) | |
374 | |
375 (defun gnus-uu-decode-unshar (&optional n) | |
376 "Unshars the current article." | |
377 (interactive "P") | |
378 (gnus-uu-decode-with-method 'gnus-uu-unshar-article n nil nil 'scan t)) | |
379 | |
380 (defun gnus-uu-decode-unshar-and-save (n dir) | |
381 "Unshars and saves the current article." | |
382 (interactive | |
383 (list current-prefix-arg | |
384 (file-name-as-directory | |
385 (read-file-name "Unshar and save in dir: " | |
386 gnus-uu-default-dir | |
387 gnus-uu-default-dir t)))) | |
388 (gnus-uu-decode-with-method 'gnus-uu-unshar-article n dir nil 'scan t)) | |
389 | |
390 (defun gnus-uu-decode-save (n file) | |
391 "Saves the current article." | |
392 (interactive | |
393 (list current-prefix-arg | |
394 (read-file-name | |
395 (if gnus-uu-save-separate-articles | |
79416
3741d4f6b713
(gnus-uu-default-view-rules): Fix typos in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
78224
diff
changeset
|
396 "Save articles in dir: " |
17493 | 397 "Save articles in file: ") |
398 gnus-uu-default-dir | |
399 gnus-uu-default-dir))) | |
400 (setq gnus-uu-saved-article-name file) | |
401 (gnus-uu-decode-with-method 'gnus-uu-save-article n nil t)) | |
402 | |
403 (defun gnus-uu-decode-binhex (n dir) | |
404 "Unbinhexes the current article." | |
405 (interactive | |
406 (list current-prefix-arg | |
407 (file-name-as-directory | |
408 (read-file-name "Unbinhex and save in dir: " | |
409 gnus-uu-default-dir | |
410 gnus-uu-default-dir)))) | |
411 (setq gnus-uu-binhex-article-name | |
44075
7782e54757bb
* mail-source.el (make-source-make-complex-temp-name): Use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38413
diff
changeset
|
412 (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) |
17493 | 413 (gnus-uu-decode-with-method 'gnus-uu-binhex-article n dir)) |
414 | |
87097 | 415 (defun gnus-uu-decode-yenc (n dir) |
416 "Decode the yEnc-encoded current article." | |
417 (interactive | |
418 (list current-prefix-arg | |
419 (file-name-as-directory | |
420 (read-file-name "yEnc decode and save in dir: " | |
421 gnus-uu-default-dir | |
422 gnus-uu-default-dir)))) | |
423 (setq gnus-uu-yenc-article-name nil) | |
424 (gnus-uu-decode-with-method 'gnus-uu-yenc-article n dir nil t)) | |
425 | |
17493 | 426 (defun gnus-uu-decode-uu-view (&optional n) |
427 "Uudecodes and views the current article." | |
428 (interactive "P") | |
429 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
430 (gnus-uu-decode-uu n))) | |
431 | |
432 (defun gnus-uu-decode-uu-and-save-view (n dir) | |
433 "Decodes, views and saves the resulting file." | |
434 (interactive | |
435 (list current-prefix-arg | |
436 (read-file-name "Uudecode, view and save in dir: " | |
437 gnus-uu-default-dir | |
438 gnus-uu-default-dir t))) | |
439 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
440 (gnus-uu-decode-uu-and-save n dir))) | |
441 | |
442 (defun gnus-uu-decode-unshar-view (&optional n) | |
443 "Unshars and views the current article." | |
444 (interactive "P") | |
445 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
446 (gnus-uu-decode-unshar n))) | |
447 | |
448 (defun gnus-uu-decode-unshar-and-save-view (n dir) | |
449 "Unshars and saves the current article." | |
450 (interactive | |
451 (list current-prefix-arg | |
452 (read-file-name "Unshar, view and save in dir: " | |
453 gnus-uu-default-dir | |
454 gnus-uu-default-dir t))) | |
455 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
456 (gnus-uu-decode-unshar-and-save n dir))) | |
457 | |
458 (defun gnus-uu-decode-save-view (n file) | |
459 "Saves and views the current article." | |
460 (interactive | |
461 (list current-prefix-arg | |
462 (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
|
463 "Save articles is dir: " |
17493 | 464 "Save articles in file: ") |
465 gnus-uu-default-dir gnus-uu-default-dir))) | |
466 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
467 (gnus-uu-decode-save n file))) | |
468 | |
469 (defun gnus-uu-decode-binhex-view (n file) | |
470 "Unbinhexes and views the current article." | |
471 (interactive | |
472 (list current-prefix-arg | |
473 (read-file-name "Unbinhex, view and save in dir: " | |
474 gnus-uu-default-dir gnus-uu-default-dir))) | |
475 (setq gnus-uu-binhex-article-name | |
44075
7782e54757bb
* mail-source.el (make-source-make-complex-temp-name): Use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38413
diff
changeset
|
476 (mm-make-temp-file (expand-file-name "binhex" gnus-uu-work-dir))) |
17493 | 477 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) |
478 (gnus-uu-decode-binhex n file))) | |
479 | |
480 | |
481 ;; Digest and forward articles | |
482 | |
483 (defun gnus-uu-digest-mail-forward (&optional n post) | |
484 "Digests and forwards all articles in this series." | |
485 (interactive "P") | |
486 (let ((gnus-uu-save-in-digest t) | |
44075
7782e54757bb
* mail-source.el (make-source-make-complex-temp-name): Use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38413
diff
changeset
|
487 (file (mm-make-temp-file (nnheader-concat gnus-uu-tmp-dir "forward"))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
488 (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
|
489 (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
|
490 (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
|
491 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
|
492 (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
|
493 (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
|
494 n nil)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
495 (let ((gnus-article-reply (gnus-summary-work-articles n))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
496 (when (and (not n) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
497 (= (length gnus-article-reply) 1)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
498 ;; The case where neither a number of articles nor a region is |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
499 ;; specified. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
500 (gnus-summary-top-thread) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
501 (setq gnus-article-reply (nreverse (gnus-uu-find-articles-matching)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
502 (gnus-setup-message 'forward |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
503 (setq gnus-uu-digest-from-subject nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
504 (setq gnus-uu-digest-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
505 (gnus-get-buffer-create " *gnus-uu-forward*")) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
506 ;; Specify articles to be forwarded. Note that they should be |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
507 ;; reversed; see `gnus-uu-get-list-of-articles'. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
508 (let ((gnus-newsgroup-processable (reverse gnus-article-reply))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
509 (gnus-uu-decode-save n file) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
510 (setq gnus-article-reply gnus-newsgroup-processable)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
511 ;; Restore the value of `gnus-newsgroup-processable' to which |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
512 ;; it should be set when it is not `let'-bound. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
513 (setq gnus-newsgroup-processable (reverse gnus-article-reply)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
514 (switch-to-buffer gnus-uu-digest-buffer) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
515 (let ((fs gnus-uu-digest-from-subject)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
516 (when fs |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
517 (setq from (caar fs) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
518 subject (gnus-simplify-subject-fuzzy (cdar fs)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
519 fs (cdr fs)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
520 (while (and fs (or from subject)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
521 (when from |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
522 (unless (string= from (caar fs)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
523 (setq from nil))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
524 (when subject |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
525 (unless (string= (gnus-simplify-subject-fuzzy (cdar fs)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
526 subject) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
527 (setq subject nil))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
528 (setq fs (cdr fs)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
529 (unless subject |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
530 (setq subject "Digested Articles")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
531 (unless from |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
532 (setq from |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
533 (if (gnus-news-group-p gnus-newsgroup-name) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
534 gnus-newsgroup-name |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
535 "Various")))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
536 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
537 (when (re-search-forward "^Subject: ") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
538 (delete-region (point) (point-at-eol)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
539 (insert subject)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
540 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
541 (when (re-search-forward "^From:") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
542 (delete-region (point) (point-at-eol)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
543 (insert " " from)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
544 (let ((message-forward-decoded-p t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
545 (message-forward post t)))) |
17493 | 546 (setq gnus-uu-digest-from-subject nil))) |
547 | |
548 (defun gnus-uu-digest-post-forward (&optional n) | |
549 "Digest and forward to a newsgroup." | |
550 (interactive "P") | |
551 (gnus-uu-digest-mail-forward n t)) | |
552 | |
553 ;; Process marking. | |
554 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
555 (defun gnus-message-process-mark (unmarkp new-marked) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
556 (let ((old (- (length gnus-newsgroup-processable) (length new-marked)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
557 (gnus-message 6 "%d mark%s %s%s" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
558 (length new-marked) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
559 (if (= (length new-marked) 1) "" "s") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
560 (if unmarkp "removed" "added") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
561 (cond |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
562 ((and (zerop old) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
563 (not unmarkp)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
564 "") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
565 (unmarkp |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
566 (format ", %d remain marked" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
567 (length gnus-newsgroup-processable))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
568 (t |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
569 (format ", %d already marked" old)))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
570 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
571 (defun gnus-new-processable (unmarkp articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
572 (if unmarkp |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
573 (gnus-intersection gnus-newsgroup-processable articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
574 (gnus-set-difference articles gnus-newsgroup-processable))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
575 |
17493 | 576 (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
|
577 "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
|
578 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
|
579 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
|
580 (interactive "sMark (regexp): \nP") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
581 (save-excursion |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
582 (let* ((articles (gnus-uu-find-articles-matching regexp)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
583 (new-marked (gnus-new-processable unmark articles))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
584 (while articles |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
585 (if unmark |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
586 (gnus-summary-remove-process-mark (pop articles)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
587 (gnus-summary-set-process-mark (pop articles)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
588 (gnus-message-process-mark unmark new-marked))) |
17493 | 589 (gnus-summary-position-point)) |
590 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
591 (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
|
592 "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
|
593 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
|
594 (interactive "sUnmark (regexp): ") |
17493 | 595 (gnus-uu-mark-by-regexp regexp t)) |
596 | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
597 (defun gnus-uu-mark-series (&optional silent) |
17493 | 598 "Mark the current series with the process mark." |
599 (interactive) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
600 (let* ((articles (gnus-uu-find-articles-matching)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
601 (l (length articles))) |
17493 | 602 (while articles |
603 (gnus-summary-set-process-mark (car articles)) | |
604 (setq articles (cdr articles))) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
605 (unless silent |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
606 (gnus-message 6 "Marked %d articles" l)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
607 (gnus-summary-position-point) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
608 l)) |
17493 | 609 |
610 (defun gnus-uu-mark-region (beg end &optional unmark) | |
611 "Set the process mark on all articles between point and mark." | |
612 (interactive "r") | |
613 (save-excursion | |
614 (goto-char beg) | |
615 (while (< (point) end) | |
616 (if unmark | |
617 (gnus-summary-remove-process-mark (gnus-summary-article-number)) | |
618 (gnus-summary-set-process-mark (gnus-summary-article-number))) | |
619 (forward-line 1))) | |
620 (gnus-summary-position-point)) | |
621 | |
622 (defun gnus-uu-unmark-region (beg end) | |
623 "Remove the process mark from all articles between point and mark." | |
624 (interactive "r") | |
625 (gnus-uu-mark-region beg end t)) | |
626 | |
627 (defun gnus-uu-mark-buffer () | |
628 "Set the process mark on all articles in the buffer." | |
629 (interactive) | |
630 (gnus-uu-mark-region (point-min) (point-max))) | |
631 | |
632 (defun gnus-uu-unmark-buffer () | |
633 "Remove the process mark on all articles in the buffer." | |
634 (interactive) | |
635 (gnus-uu-mark-region (point-min) (point-max) t)) | |
636 | |
637 (defun gnus-uu-mark-thread () | |
638 "Marks all articles downwards in this thread." | |
639 (interactive) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
640 (gnus-save-hidden-threads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
641 (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
|
642 (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
|
643 (gnus-summary-article-number)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
644 (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
|
645 (> (gnus-summary-thread-level) level))))) |
17493 | 646 (gnus-summary-position-point)) |
647 | |
648 (defun gnus-uu-unmark-thread () | |
649 "Unmarks all articles downwards in this thread." | |
650 (interactive) | |
651 (let ((level (gnus-summary-thread-level))) | |
652 (while (and (gnus-summary-remove-process-mark | |
653 (gnus-summary-article-number)) | |
654 (zerop (gnus-summary-next-subject 1)) | |
655 (> (gnus-summary-thread-level) level)))) | |
656 (gnus-summary-position-point)) | |
657 | |
658 (defun gnus-uu-invert-processable () | |
659 "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
|
660 (interactive) |
17493 | 661 (let ((data gnus-newsgroup-data) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
662 number) |
17493 | 663 (save-excursion |
664 (while data | |
665 (if (memq (setq number (gnus-data-number (pop data))) | |
666 gnus-newsgroup-processable) | |
667 (gnus-summary-remove-process-mark number) | |
668 (gnus-summary-set-process-mark number))))) | |
669 (gnus-summary-position-point)) | |
670 | |
671 (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
|
672 "Mark all articles with a score over SCORE (the prefix)." |
17493 | 673 (interactive "P") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
674 (let ((score (or score gnus-summary-default-score 0)) |
17493 | 675 (data gnus-newsgroup-data)) |
676 (save-excursion | |
677 (while data | |
678 (when (> (or (cdr (assq (gnus-data-number (car data)) | |
679 gnus-newsgroup-scored)) | |
680 gnus-summary-default-score 0) | |
681 score) | |
682 (gnus-summary-set-process-mark (caar data))) | |
683 (setq data (cdr data)))) | |
684 (gnus-summary-position-point))) | |
685 | |
686 (defun gnus-uu-mark-sparse () | |
687 "Mark all series that have some articles marked." | |
688 (interactive) | |
689 (let ((marked (nreverse gnus-newsgroup-processable)) | |
690 subject articles total headers) | |
691 (unless marked | |
692 (error "No articles marked with the process mark")) | |
693 (setq gnus-newsgroup-processable nil) | |
694 (save-excursion | |
695 (while marked | |
696 (and (vectorp (setq headers | |
697 (gnus-summary-article-header (car marked)))) | |
698 (setq subject (mail-header-subject headers) | |
699 articles (gnus-uu-find-articles-matching | |
700 (gnus-uu-reginize-string subject)) | |
701 total (nconc total articles))) | |
702 (while articles | |
703 (gnus-summary-set-process-mark (car articles)) | |
704 (setcdr marked (delq (car articles) (cdr marked))) | |
705 (setq articles (cdr articles))) | |
706 (setq marked (cdr marked))) | |
707 (setq gnus-newsgroup-processable (nreverse total))) | |
708 (gnus-summary-position-point))) | |
709 | |
710 (defun gnus-uu-mark-all () | |
711 "Mark all articles in \"series\" order." | |
712 (interactive) | |
713 (setq gnus-newsgroup-processable nil) | |
714 (save-excursion | |
715 (let ((data gnus-newsgroup-data) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
716 (count 0) |
17493 | 717 number) |
718 (while data | |
719 (when (and (not (memq (setq number (gnus-data-number (car data))) | |
720 gnus-newsgroup-processable)) | |
721 (vectorp (gnus-data-header (car data)))) | |
722 (gnus-summary-goto-subject number) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
723 (setq count (+ count (gnus-uu-mark-series t)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
724 (setq data (cdr data))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
725 (gnus-message 6 "Marked %d articles" count))) |
17493 | 726 (gnus-summary-position-point)) |
727 | |
728 ;; All PostScript functions written by Erik Selberg <speed@cs.washington.edu>. | |
729 | |
730 (defun gnus-uu-decode-postscript (&optional n) | |
731 "Gets postscript of the current article." | |
732 (interactive "P") | |
733 (gnus-uu-decode-with-method 'gnus-uu-decode-postscript-article n)) | |
734 | |
735 (defun gnus-uu-decode-postscript-view (&optional n) | |
736 "Gets and views the current article." | |
737 (interactive "P") | |
738 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
739 (gnus-uu-decode-postscript n))) | |
740 | |
741 (defun gnus-uu-decode-postscript-and-save (n dir) | |
742 "Extracts postscript and saves the current article." | |
743 (interactive | |
744 (list current-prefix-arg | |
745 (file-name-as-directory | |
746 (read-file-name "Save in dir: " | |
747 gnus-uu-default-dir | |
748 gnus-uu-default-dir t)))) | |
749 (gnus-uu-decode-with-method 'gnus-uu-decode-postscript-article | |
750 n dir nil nil t)) | |
751 | |
752 (defun gnus-uu-decode-postscript-and-save-view (n dir) | |
753 "Decodes, views and saves the resulting file." | |
754 (interactive | |
755 (list current-prefix-arg | |
756 (read-file-name "Where do you want to save the file(s)? " | |
757 gnus-uu-default-dir | |
758 gnus-uu-default-dir t))) | |
759 (let ((gnus-view-pseudos (or gnus-view-pseudos 'automatic))) | |
760 (gnus-uu-decode-postscript-and-save n dir))) | |
761 | |
762 | |
763 ;; Internal functions. | |
764 | |
765 (defun gnus-uu-decode-with-method (method n &optional save not-insert | |
766 scan cdir) | |
767 (gnus-uu-initialize scan) | |
768 (when save | |
769 (setq gnus-uu-default-dir save)) | |
770 ;; Create the directory we save to. | |
771 (when (and scan cdir save | |
772 (not (file-exists-p save))) | |
773 (make-directory save t)) | |
774 (let ((articles (gnus-uu-get-list-of-articles n)) | |
775 files) | |
776 (setq files (gnus-uu-grab-articles articles method t)) | |
777 (let ((gnus-current-article (car articles))) | |
778 (when scan | |
779 (setq files (gnus-uu-scan-directory gnus-uu-work-dir)))) | |
780 (when save | |
781 (gnus-uu-save-files files save)) | |
782 (when (eq gnus-uu-do-not-unpack-archives nil) | |
783 (setq files (gnus-uu-unpack-files files))) | |
784 (setq files (nreverse (gnus-uu-get-actions files))) | |
785 (or not-insert (not gnus-insert-pseudo-articles) | |
786 (gnus-summary-insert-pseudos files save)))) | |
787 | |
788 (defun gnus-uu-scan-directory (dir &optional rec) | |
789 "Return a list of all files under DIR." | |
790 (let ((files (directory-files dir t)) | |
791 out file) | |
792 (while (setq file (pop files)) | |
793 (unless (member (file-name-nondirectory file) '("." "..")) | |
794 (push (list (cons 'name file) | |
795 (cons 'article gnus-current-article)) | |
796 out) | |
797 (when (file-directory-p file) | |
798 (setq out (nconc (gnus-uu-scan-directory file t) out))))) | |
799 (if rec | |
800 out | |
801 (nreverse out)))) | |
802 | |
803 (defun gnus-uu-save-files (files dir) | |
804 "Save FILES in DIR." | |
805 (let ((len (length files)) | |
806 (reg (concat "^" (regexp-quote gnus-uu-work-dir))) | |
807 to-file file fromdir) | |
808 (while (setq file (cdr (assq 'name (pop files)))) | |
809 (when (file-exists-p file) | |
810 (string-match reg file) | |
811 (setq fromdir (substring file (match-end 0))) | |
812 (if (file-directory-p file) | |
813 (gnus-make-directory (concat dir fromdir)) | |
814 (setq to-file (concat dir fromdir)) | |
815 (when (or (not (file-exists-p to-file)) | |
816 (eq gnus-uu-be-dangerous t) | |
817 (and gnus-uu-be-dangerous | |
818 (gnus-y-or-n-p (format "%s exists; overwrite? " | |
819 to-file)))) | |
820 (copy-file file to-file t t))))) | |
821 (gnus-message 5 "Saved %d file%s" len (if (= len 1) "" "s")))) | |
822 | |
823 ;; Functions for saving and possibly digesting articles without | |
824 ;; any decoding. | |
825 | |
826 ;; Function called by gnus-uu-grab-articles to treat each article. | |
827 (defun gnus-uu-save-article (buffer in-state) | |
828 (cond | |
829 (gnus-uu-save-separate-articles | |
830 (save-excursion | |
831 (set-buffer buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
832 (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
|
833 (gnus-write-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
834 (concat gnus-uu-saved-article-name gnus-current-article))) |
17493 | 835 (cond ((eq in-state 'first) (list gnus-uu-saved-article-name 'begin)) |
836 ((eq in-state 'first-and-last) (list gnus-uu-saved-article-name | |
837 'begin 'end)) | |
838 ((eq in-state 'last) (list 'end)) | |
839 (t (list 'middle))))) | |
840 ((not gnus-uu-save-in-digest) | |
841 (save-excursion | |
842 (set-buffer buffer) | |
843 (write-region (point-min) (point-max) gnus-uu-saved-article-name t) | |
844 (cond ((eq in-state 'first) (list gnus-uu-saved-article-name 'begin)) | |
845 ((eq in-state 'first-and-last) (list gnus-uu-saved-article-name | |
846 'begin 'end)) | |
847 ((eq in-state 'last) (list 'end)) | |
848 (t (list 'middle))))) | |
849 (t | |
850 (let ((header (gnus-summary-article-header))) | |
851 (push (cons (mail-header-from header) | |
852 (mail-header-subject header)) | |
853 gnus-uu-digest-from-subject)) | |
854 (let ((name (file-name-nondirectory gnus-uu-saved-article-name)) | |
855 beg subj headers headline sorthead body end-string state) | |
856 (if (or (eq in-state 'first) | |
857 (eq in-state 'first-and-last)) | |
858 (progn | |
859 (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
|
860 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
861 (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
|
862 (erase-buffer)) |
17493 | 863 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
864 (set-buffer (gnus-get-buffer-create "*gnus-uu-pre*")) |
17493 | 865 (erase-buffer) |
866 (insert (format | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
867 "Date: %s\nFrom: %s\nSubject: %s Digest\n\n" |
64780
4def766e2c3f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-515
Miles Bader <miles@gnu.org>
parents:
64754
diff
changeset
|
868 (message-make-date) name name)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
869 (when (and message-forward-as-mime gnus-uu-digest-buffer) |
69949
d0312c3f2374
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-214
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
870 (insert |
d0312c3f2374
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-214
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
871 "<#mml type=message/rfc822>\nSubject: Topics\n\n<#/mml>\n") |
d0312c3f2374
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-214
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
872 (forward-line -1)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
873 (insert "Topics:\n"))) |
17493 | 874 (when (not (eq in-state 'end)) |
875 (setq state (list 'middle)))) | |
876 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
877 (set-buffer "*gnus-uu-body*") |
17493 | 878 (goto-char (setq beg (point-max))) |
879 (save-excursion | |
880 (save-restriction | |
881 (set-buffer buffer) | |
882 (let (buffer-read-only) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
883 (set-text-properties (point-min) (point-max) nil) |
17493 | 884 ;; These two are necessary for XEmacs 19.12 fascism. |
885 (put-text-property (point-min) (point-max) 'invisible nil) | |
886 (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
|
887 (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
|
888 message-forward-show-mml |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
889 gnus-uu-digest-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
890 (mm-enable-multibyte) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
891 (mime-to-mml)) |
17493 | 892 (goto-char (point-min)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
893 (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
|
894 (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
|
895 ;; 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
|
896 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
897 (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
|
898 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
899 (delete-char 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
900 (insert "- ")))) |
17493 | 901 (setq body (buffer-substring (1- (point)) (point-max))) |
902 (narrow-to-region (point-min) (point)) | |
903 (if (not (setq headers gnus-uu-digest-headers)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
904 (setq sorthead (buffer-string)) |
17493 | 905 (while headers |
906 (setq headline (car headers)) | |
907 (setq headers (cdr headers)) | |
908 (goto-char (point-min)) | |
909 (while (re-search-forward headline nil t) | |
910 (setq sorthead | |
911 (concat sorthead | |
912 (buffer-substring | |
913 (match-beginning 0) | |
914 (or (and (re-search-forward "^[^ \t]" nil t) | |
915 (1- (point))) | |
916 (progn (forward-line 1) (point))))))))) | |
917 (widen))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
918 (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
|
919 (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
|
920 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
921 (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
|
922 (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
|
923 (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
|
924 (insert "\n<#/mml>\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
925 (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
|
926 (with-current-buffer buf |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
927 (insert sorthead) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
928 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
929 (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
|
930 (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
|
931 (match-end 1)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
932 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
933 (insert body)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
934 (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
|
935 " 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
|
936 (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
|
937 (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
|
938 (insert (concat "\n" (make-string 30 ?-) "\n\n"))) |
17493 | 939 (goto-char beg) |
940 (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
|
941 (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
|
942 (when subj |
17493 | 943 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
944 (set-buffer "*gnus-uu-pre*") |
17493 | 945 (insert (format " %s\n" subj))))) |
946 (when (or (eq in-state 'last) | |
947 (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
|
948 (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
|
949 (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
|
950 (erase-buffer) |
64712
4db92b217e85
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-507
Miles Bader <miles@gnu.org>
parents:
64085
diff
changeset
|
951 (insert-buffer-substring "*gnus-uu-pre*") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
952 (goto-char (point-max)) |
64712
4db92b217e85
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-507
Miles Bader <miles@gnu.org>
parents:
64085
diff
changeset
|
953 (insert-buffer-substring "*gnus-uu-body*")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
954 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
955 (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
|
956 (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
|
957 (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
|
958 (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
|
959 (erase-buffer) |
64712
4db92b217e85
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-507
Miles Bader <miles@gnu.org>
parents:
64085
diff
changeset
|
960 (insert-buffer-substring "*gnus-uu-pre*")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
961 (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
|
962 (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
|
963 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
964 (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
|
965 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
966 (insert |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
967 (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
|
968 "\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
969 (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
|
970 (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
|
971 (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
|
972 (goto-char (point-max)) |
64712
4db92b217e85
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-507
Miles Bader <miles@gnu.org>
parents:
64085
diff
changeset
|
973 (insert-buffer-substring "*gnus-uu-body*")) |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
974 (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
|
975 (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
|
976 (write-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
977 (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
|
978 (gnus-kill-buffer "*gnus-uu-pre*") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
979 (gnus-kill-buffer "*gnus-uu-body*") |
17493 | 980 (push 'end state)) |
981 (if (memq 'begin state) | |
982 (cons gnus-uu-saved-article-name state) | |
983 state))))) | |
984 | |
985 ;; Binhex treatment - not very advanced. | |
986 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
987 (defvar gnus-uu-binhex-body-line |
17493 | 988 "^[^:]...............................................................$") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
989 (defvar gnus-uu-binhex-begin-line |
17493 | 990 "^:...............................................................$") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
991 (defvar gnus-uu-binhex-end-line |
17493 | 992 ":$") |
993 | |
994 (defun gnus-uu-binhex-article (buffer in-state) | |
995 (let (state start-char) | |
996 (save-excursion | |
997 (set-buffer buffer) | |
998 (widen) | |
999 (goto-char (point-min)) | |
1000 (when (not (re-search-forward gnus-uu-binhex-begin-line nil t)) | |
1001 (when (not (re-search-forward gnus-uu-binhex-body-line nil t)) | |
1002 (setq state (list 'wrong-type)))) | |
1003 | |
1004 (if (memq 'wrong-type state) | |
1005 () | |
1006 (beginning-of-line) | |
1007 (setq start-char (point)) | |
1008 (if (looking-at gnus-uu-binhex-begin-line) | |
1009 (progn | |
1010 (setq state (list 'begin)) | |
44514
8bfbcb957964
(gnus-uu-binhex-article, gnus-uu-reginize-string, gnus-uu-expand-numbers)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44075
diff
changeset
|
1011 (write-region (point-min) (point-min) |
8bfbcb957964
(gnus-uu-binhex-article, gnus-uu-reginize-string, gnus-uu-expand-numbers)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44075
diff
changeset
|
1012 gnus-uu-binhex-article-name)) |
17493 | 1013 (setq state (list 'middle))) |
1014 (goto-char (point-max)) | |
1015 (re-search-backward (concat gnus-uu-binhex-body-line "\\|" | |
1016 gnus-uu-binhex-end-line) | |
1017 nil t) | |
1018 (when (looking-at gnus-uu-binhex-end-line) | |
1019 (setq state (if (memq 'begin state) | |
1020 (cons 'end state) | |
1021 (list 'end)))) | |
1022 (beginning-of-line) | |
1023 (forward-line 1) | |
1024 (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
|
1025 (mm-append-to-file start-char (point) gnus-uu-binhex-article-name)))) |
17493 | 1026 (if (memq 'begin state) |
1027 (cons gnus-uu-binhex-article-name state) | |
1028 state))) | |
1029 | |
87097 | 1030 ;; yEnc |
1031 | |
1032 (defun gnus-uu-yenc-article (buffer in-state) | |
1033 (save-excursion | |
1034 (set-buffer gnus-original-article-buffer) | |
1035 (widen) | |
1036 (let ((file-name (yenc-extract-filename)) | |
1037 state start-char) | |
1038 (when (not file-name) | |
1039 (setq state (list 'wrong-type))) | |
1040 | |
1041 (if (memq 'wrong-type state) | |
1042 () | |
1043 (when (yenc-first-part-p) | |
1044 (setq gnus-uu-yenc-article-name | |
1045 (expand-file-name file-name gnus-uu-work-dir)) | |
1046 (push 'begin state)) | |
1047 (when (yenc-last-part-p) | |
1048 (push 'end state)) | |
1049 (unless state | |
1050 (push 'middle state)) | |
1051 (mm-with-unibyte-buffer | |
87193
b40a0f01cf1e
(gnus-uu-yenc-article): Use insert-buffer-substring.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
1052 (insert-buffer-substring gnus-original-article-buffer) |
87097 | 1053 (yenc-decode-region (point-min) (point-max)) |
1054 (when (and (member 'begin state) | |
1055 (file-exists-p gnus-uu-yenc-article-name)) | |
1056 (delete-file gnus-uu-yenc-article-name)) | |
1057 (mm-append-to-file (point-min) (point-max) | |
1058 gnus-uu-yenc-article-name))) | |
1059 (if (memq 'begin state) | |
1060 (cons file-name state) | |
1061 state)))) | |
1062 | |
17493 | 1063 ;; PostScript |
1064 | |
1065 (defun gnus-uu-decode-postscript-article (process-buffer in-state) | |
1066 (let ((state (list 'ok)) | |
1067 start-char end-char file-name) | |
1068 (save-excursion | |
1069 (set-buffer process-buffer) | |
1070 (goto-char (point-min)) | |
1071 (if (not (re-search-forward gnus-uu-postscript-begin-string nil t)) | |
1072 (setq state (list 'wrong-type)) | |
1073 (beginning-of-line) | |
1074 (setq start-char (point)) | |
1075 (if (not (re-search-forward gnus-uu-postscript-end-string nil t)) | |
1076 (setq state (list 'wrong-type)) | |
1077 (setq end-char (point)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1078 (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name)) |
17493 | 1079 (insert-buffer-substring process-buffer start-char end-char) |
1080 (setq file-name (concat gnus-uu-work-dir | |
1081 (cdr gnus-article-current) ".ps")) | |
1082 (write-region (point-min) (point-max) file-name) | |
1083 (setq state (list file-name 'begin 'end))))) | |
1084 state)) | |
1085 | |
1086 | |
1087 ;; Find actions. | |
1088 | |
1089 (defun gnus-uu-get-actions (files) | |
1090 (let ((ofiles files) | |
1091 action name) | |
1092 (while files | |
1093 (setq name (cdr (assq 'name (car files)))) | |
1094 (and | |
1095 (setq action (gnus-uu-get-action name)) | |
1096 (setcar files (nconc (list (if (string= action "gnus-uu-archive") | |
1097 (cons 'action "file") | |
1098 (cons 'action action)) | |
1099 (cons 'execute (gnus-uu-command | |
1100 action name))) | |
1101 (car files)))) | |
1102 (setq files (cdr files))) | |
1103 ofiles)) | |
1104 | |
1105 (defun gnus-uu-get-action (file-name) | |
1106 (let (action) | |
1107 (setq action | |
1108 (gnus-uu-choose-action | |
1109 file-name | |
1110 (append | |
1111 gnus-uu-user-view-rules | |
1112 (if gnus-uu-ignore-default-view-rules | |
1113 nil | |
1114 gnus-uu-default-view-rules) | |
1115 gnus-uu-user-view-rules-end))) | |
1116 (when (and (not (string= (or action "") "gnus-uu-archive")) | |
1117 gnus-uu-view-with-metamail) | |
1118 (when (setq action | |
1119 (gnus-uu-choose-action file-name gnus-uu-ext-to-mime-list)) | |
1120 (setq action (format "metamail -d -b -c \"%s\"" action)))) | |
1121 action)) | |
1122 | |
1123 | |
1124 ;; Functions for treating subjects and collecting series. | |
1125 | |
1126 (defun gnus-uu-reginize-string (string) | |
1127 ;; 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
|
1128 ;; 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
|
1129 ;; 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
|
1130 ;; 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
|
1131 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1132 (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
|
1133 (buffer-disable-undo) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1134 (erase-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1135 (insert (regexp-quote string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1136 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1137 (setq case-fold-search nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1138 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1139 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1140 (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
|
1141 (replace-match "\\1[0-9]+/\\2") |
17493 | 1142 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1143 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1144 (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
|
1145 nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1146 (replace-match "\\1[0-9]+ of \\2") |
17493 | 1147 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1148 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1149 (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
|
1150 nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1151 (replace-match "\\1[0-9]+\\2[0-9]+" t nil nil nil)))) |
17493 | 1152 |
85008
ff46392e7e97
(gnus-uu-reginize-string, gnus-uu-expand-numbers): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
1153 (goto-char (point-min)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1154 (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
|
1155 (replace-match "[ \t]+" t t)) |
17493 | 1156 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1157 (buffer-string))) |
17493 | 1158 |
1159 (defun gnus-uu-get-list-of-articles (n) | |
1160 ;; If N is non-nil, the article numbers of the N next articles | |
1161 ;; will be returned. | |
1162 ;; If any articles have been marked as processable, they will be | |
1163 ;; returned. | |
1164 ;; Failing that, articles that have subjects that are part of the | |
1165 ;; same "series" as the current will be returned. | |
1166 (let (articles) | |
1167 (cond | |
1168 (n | |
1169 (setq n (prefix-numeric-value n)) | |
1170 (let ((backward (< n 0)) | |
1171 (n (abs n))) | |
1172 (save-excursion | |
1173 (while (and (> n 0) | |
1174 (push (gnus-summary-article-number) | |
1175 articles) | |
1176 (gnus-summary-search-forward nil nil backward)) | |
1177 (setq n (1- n)))) | |
1178 (nreverse articles))) | |
1179 (gnus-newsgroup-processable | |
1180 (reverse gnus-newsgroup-processable)) | |
1181 (t | |
1182 (gnus-uu-find-articles-matching))))) | |
1183 | |
1184 (defun gnus-uu-string< (l1 l2) | |
1185 (string< (car l1) (car l2))) | |
1186 | |
1187 (defun gnus-uu-find-articles-matching | |
1188 (&optional subject only-unread do-not-translate) | |
1189 ;; Finds all articles that matches the regexp SUBJECT. If it is | |
1190 ;; nil, the current article name will be used. If ONLY-UNREAD is | |
1191 ;; non-nil, only unread articles are chosen. If DO-NOT-TRANSLATE is | |
1192 ;; non-nil, article names are not equalized before sorting. | |
1193 (let ((subject (or subject | |
1194 (gnus-uu-reginize-string (gnus-summary-article-subject)))) | |
1195 list-of-subjects) | |
1196 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1197 (when subject |
17493 | 1198 ;; Collect all subjects matching subject. |
1199 (let ((case-fold-search t) | |
1200 (data gnus-newsgroup-data) | |
1201 subj mark d) | |
1202 (while data | |
1203 (setq d (pop data)) | |
1204 (and (not (gnus-data-pseudo-p d)) | |
1205 (or (not only-unread) | |
1206 (= (setq mark (gnus-data-mark d)) | |
1207 gnus-unread-mark) | |
1208 (= mark gnus-ticked-mark) | |
1209 (= mark gnus-dormant-mark)) | |
1210 (setq subj (mail-header-subject (gnus-data-header d))) | |
1211 (string-match subject subj) | |
1212 (push (cons subj (gnus-data-number d)) | |
1213 list-of-subjects)))) | |
1214 | |
1215 ;; Expand numbers, sort, and return the list of article | |
1216 ;; numbers. | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1217 (mapcar 'cdr |
17493 | 1218 (sort (gnus-uu-expand-numbers |
1219 list-of-subjects | |
1220 (not do-not-translate)) | |
1221 'gnus-uu-string<)))))) | |
1222 | |
1223 (defun gnus-uu-expand-numbers (string-list &optional translate) | |
1224 ;; Takes a list of strings and "expands" all numbers in all the | |
1225 ;; strings. That is, this function makes all numbers equal length by | |
1226 ;; prepending lots of zeroes before each number. This is to ease later | |
1227 ;; sorting to find out what sequence the articles are supposed to be | |
1228 ;; decoded in. Returns the list of expanded strings. | |
1229 (let ((out-list string-list) | |
1230 string) | |
1231 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1232 (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
|
1233 (buffer-disable-undo) |
17493 | 1234 (while string-list |
1235 (erase-buffer) | |
1236 (insert (caar string-list)) | |
1237 ;; Translate multiple spaces to one space. | |
1238 (goto-char (point-min)) | |
1239 (while (re-search-forward "[ \t]+" nil t) | |
1240 (replace-match " ")) | |
1241 ;; Translate all characters to "a". | |
1242 (goto-char (point-min)) | |
1243 (when translate | |
1244 (while (re-search-forward "[A-Za-z]" nil t) | |
1245 (replace-match "a" t t))) | |
1246 ;; Expand numbers. | |
1247 (goto-char (point-min)) | |
1248 (while (re-search-forward "[0-9]+" nil t) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1249 (ignore-errors |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1250 (replace-match |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1251 (format "%06d" |
62907
88db2adda4b7
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
1252 (string-to-number (buffer-substring |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1253 (match-beginning 0) (match-end 0))))))) |
85008
ff46392e7e97
(gnus-uu-reginize-string, gnus-uu-expand-numbers): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
78224
diff
changeset
|
1254 (setq string (buffer-substring (point-min) (point-max))) |
17493 | 1255 (setcar (car string-list) string) |
1256 (setq string-list (cdr string-list)))) | |
1257 out-list)) | |
1258 | |
1259 | |
1260 ;; `gnus-uu-grab-articles' is the general multi-article treatment | |
1261 ;; function. It takes a list of articles to be grabbed and a function | |
1262 ;; to apply to each article. | |
1263 ;; | |
1264 ;; The function to be called should take two parameters. The first | |
1265 ;; parameter is the article buffer. The function should leave the | |
1266 ;; result, if any, in this buffer. Most treatment functions will just | |
1267 ;; generate files... | |
1268 ;; | |
1269 ;; The second parameter is the state of the list of articles, and can | |
1270 ;; have four values: `first', `middle', `last' and `first-and-last'. | |
1271 ;; | |
1272 ;; The function should return a list. The list may contain the | |
1273 ;; following symbols: | |
1274 ;; `error' if an error occurred | |
1275 ;; `begin' if the beginning of an encoded file has been received | |
1276 ;; If the list returned contains a `begin', the first element of | |
1277 ;; the list *must* be a string with the file name of the decoded | |
1278 ;; file. | |
1279 ;; `end' if the end of an encoded file has been received | |
1280 ;; `middle' if the article was a body part of an encoded file | |
1281 ;; `wrong-type' if the article was not a part of an encoded file | |
1282 ;; `ok', which can be used everything is ok | |
1283 | |
1284 (defvar gnus-uu-has-been-grabbed nil) | |
1285 | |
1286 (defun gnus-uu-unmark-list-of-grabbed (&optional dont-unmark-last-article) | |
1287 (let (art) | |
1288 (if (not (and gnus-uu-has-been-grabbed | |
1289 gnus-uu-unmark-articles-not-decoded)) | |
1290 () | |
1291 (when dont-unmark-last-article | |
1292 (setq art (car gnus-uu-has-been-grabbed)) | |
1293 (setq gnus-uu-has-been-grabbed (cdr gnus-uu-has-been-grabbed))) | |
1294 (while gnus-uu-has-been-grabbed | |
1295 (gnus-summary-tick-article (car gnus-uu-has-been-grabbed) t) | |
1296 (setq gnus-uu-has-been-grabbed (cdr gnus-uu-has-been-grabbed))) | |
1297 (when dont-unmark-last-article | |
1298 (setq gnus-uu-has-been-grabbed (list art)))))) | |
1299 | |
1300 ;; This function takes a list of articles and a function to apply to | |
1301 ;; each article grabbed. | |
1302 ;; | |
1303 ;; This function returns a list of files decoded if the grabbing and | |
1304 ;; the process-function has been successful and nil otherwise. | |
1305 (defun gnus-uu-grab-articles (articles process-function | |
1306 &optional sloppy limit no-errors) | |
1307 (let ((state 'first) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1308 (gnus-asynchronous nil) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1309 (gnus-inhibit-treatment t) |
17493 | 1310 has-been-begin article result-file result-files process-state |
1311 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
|
1312 gnus-article-prepare-hook gnus-display-mime-function |
17493 | 1313 article-series files) |
1314 | |
1315 (while (and articles | |
1316 (not (memq 'error process-state)) | |
1317 (or sloppy | |
1318 (not (memq 'end process-state)))) | |
1319 | |
1320 (setq article (pop articles)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1321 (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
|
1322 (push article article-series) |
17493 | 1323 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1324 (unless articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1325 (if (eq state 'first) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1326 (setq state 'first-and-last) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1327 (setq state 'last))) |
17493 | 1328 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1329 (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
|
1330 (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
|
1331 article (if (string= part "") "" (concat ", " part)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1332 (gnus-summary-display-article article) |
17493 | 1333 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1334 ;; 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
|
1335 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1336 (set-buffer gnus-original-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1337 (let ((buffer-read-only nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1338 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1339 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1340 (setq process-state |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1341 (funcall process-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1342 gnus-original-article-buffer state))))) |
17493 | 1343 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1344 (gnus-summary-remove-process-mark article) |
17493 | 1345 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1346 ;; 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
|
1347 ;; on to a list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1348 (when (or (memq 'begin process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1349 (and (or (eq state 'first) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1350 (eq state 'first-and-last)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1351 (memq 'ok process-state))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1352 (when has-been-begin |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1353 ;; 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
|
1354 ;; 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
|
1355 (when (and 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 |
65688
41260182da5b
2005-09-25 Romain Francoise <romain@orebokech.com>
Romain Francoise <romain@orebokech.com>
parents:
64780
diff
changeset
|
1360 (format "Delete unsuccessfully decoded file %s? " |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1361 result-file)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1362 (delete-file result-file))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1363 (when (memq 'begin process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1364 (setq result-file (car process-state))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1365 (setq has-been-begin t)) |
17493 | 1366 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1367 ;; 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
|
1368 (when (memq 'end process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1369 (setq article-series nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1370 (setq has-been-begin nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1371 (if (stringp result-file) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1372 (setq files (list result-file)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1373 (setq files result-file)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1374 (setq result-file (car files)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1375 (while files |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1376 (push (list (cons 'name (pop files)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1377 (cons 'article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1378 result-files)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1379 ;; 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
|
1380 (when gnus-uu-grabbed-file-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1381 (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
|
1382 (unless (listp funcs) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1383 (setq funcs (list funcs))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1384 (while funcs |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1385 (funcall (pop funcs) result-file)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1386 (setq result-file nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1387 ;; 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
|
1388 (and limit (= (length result-files) limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1389 (setq articles nil))) |
17493 | 1390 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1391 ;; 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
|
1392 ;; 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
|
1393 ;; the partially decoded file. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1394 (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
|
1395 (not (memq 'end process-state)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1396 result-file |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1397 (file-exists-p result-file) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1398 (not gnus-uu-be-dangerous) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1399 (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
|
1400 (gnus-y-or-n-p |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1401 (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
|
1402 (delete-file result-file)) |
17493 | 1403 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1404 ;; 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
|
1405 (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
|
1406 (memq 'error process-state)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1407 gnus-uu-unmark-articles-not-decoded) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1408 (gnus-summary-tick-article article t)) |
17493 | 1409 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1410 ;; Set the new series state. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1411 (if (and (not has-been-begin) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1412 (not sloppy) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1413 (or (memq 'end process-state) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1414 (memq 'middle process-state))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1415 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1416 (setq process-state (list 'error)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1417 (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
|
1418 (sleep-for 2)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1419 (setq state 'middle)))) |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64712
diff
changeset
|
1420 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1421 ;; When there are no result-files, then something must be wrong. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1422 (if result-files |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1423 (message "") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1424 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1425 ((not has-been-begin) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1426 (gnus-message 2 "Wrong type file")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1427 ((memq 'error process-state) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1428 (gnus-message 2 "An error occurred during decoding")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1429 ((not (or (memq 'ok process-state) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1430 (memq 'end process-state))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1431 (gnus-message 2 "End of articles reached before end of file"))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1432 ;; Make unsuccessfully decoded articles unread. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1433 (when gnus-uu-unmark-articles-not-decoded |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1434 (while article-series |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1435 (gnus-summary-tick-article (pop article-series) t)))) |
17493 | 1436 |
35957
a35d9c07d074
2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33765
diff
changeset
|
1437 ;; 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
|
1438 (gnus-kill-buffer gnus-original-article-buffer) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1439 (setq gnus-current-article nil) |
17493 | 1440 result-files)) |
1441 | |
1442 (defun gnus-uu-grab-view (file) | |
1443 "View FILE using the gnus-uu methods." | |
1444 (let ((action (gnus-uu-get-action file))) | |
1445 (gnus-execute-command | |
1446 (if (string-match "%" action) | |
1447 (format action file) | |
1448 (concat action " " file)) | |
1449 (eq gnus-view-pseudos 'not-confirm)))) | |
1450 | |
1451 (defun gnus-uu-grab-move (file) | |
1452 "Move FILE to somewhere." | |
1453 (when gnus-uu-default-dir | |
1454 (let ((to-file (concat (file-name-as-directory gnus-uu-default-dir) | |
1455 (file-name-nondirectory file)))) | |
1456 (rename-file file to-file) | |
1457 (unless (file-exists-p file) | |
1458 (make-symbolic-link to-file file))))) | |
1459 | |
1460 (defun gnus-uu-part-number (article) | |
1461 (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
|
1462 (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
|
1463 (part nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1464 (if subject |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1465 (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
|
1466 subject) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1467 (setq part (match-string 0 subject)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1468 (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
|
1469 (or part |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1470 (while (string-match "[0-9]+[^0-9]+[0-9]+" subject) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1471 (setq part (match-string 0 subject)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1472 (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
|
1473 (or part ""))) |
17493 | 1474 |
1475 (defun gnus-uu-uudecode-sentinel (process event) | |
1476 (delete-process (get-process process))) | |
1477 | |
1478 (defun gnus-uu-uustrip-article (process-buffer in-state) | |
1479 ;; Uudecodes a file asynchronously. | |
1480 (save-excursion | |
1481 (set-buffer process-buffer) | |
1482 (let ((state (list 'wrong-type)) | |
1483 process-connection-type case-fold-search buffer-read-only | |
1484 files start-char) | |
1485 (goto-char (point-min)) | |
1486 | |
1487 ;; Deal with ^M at the end of the lines. | |
1488 (when gnus-uu-kill-carriage-return | |
1489 (save-excursion | |
1490 (while (search-forward "\r" nil t) | |
1491 (delete-backward-char 1)))) | |
1492 | |
1493 (while (or (re-search-forward gnus-uu-begin-string nil t) | |
1494 (re-search-forward gnus-uu-body-line nil t)) | |
1495 (setq state (list 'ok)) | |
1496 ;; Ok, we are at the first uucoded line. | |
1497 (beginning-of-line) | |
1498 (setq start-char (point)) | |
1499 | |
1500 (if (not (looking-at gnus-uu-begin-string)) | |
1501 (setq state (list 'middle)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
1502 ;; This is the beginning of a uuencoded article. |
17493 | 1503 ;; We replace certain characters that could make things messy. |
1504 (setq gnus-uu-file-name | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1505 (gnus-map-function |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64712
diff
changeset
|
1506 mm-file-name-rewrite-functions |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1507 (file-name-nondirectory (match-string 1)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1508 (replace-match (concat "begin 644 " gnus-uu-file-name) t t) |
17493 | 1509 |
1510 ;; Remove any non gnus-uu-body-line right after start. | |
1511 (forward-line 1) | |
1512 (while (and (not (eobp)) | |
1513 (not (looking-at gnus-uu-body-line))) | |
1514 (gnus-delete-line)) | |
1515 | |
1516 ;; If a process is running, we kill it. | |
1517 (when (and gnus-uu-uudecode-process | |
1518 (memq (process-status gnus-uu-uudecode-process) | |
1519 '(run stop))) | |
1520 (delete-process gnus-uu-uudecode-process) | |
1521 (gnus-uu-unmark-list-of-grabbed t)) | |
1522 | |
1523 ;; Start a new uudecoding process. | |
1524 (let ((cdir default-directory)) | |
1525 (unwind-protect | |
1526 (progn | |
1527 (cd gnus-uu-work-dir) | |
1528 (setq gnus-uu-uudecode-process | |
1529 (start-process | |
1530 "*uudecode*" | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1531 (gnus-get-buffer-create gnus-uu-output-buffer-name) |
17493 | 1532 shell-file-name shell-command-switch |
1533 (format "cd %s %s uudecode" gnus-uu-work-dir | |
1534 gnus-shell-command-separator)))) | |
1535 (cd cdir))) | |
1536 (set-process-sentinel | |
1537 gnus-uu-uudecode-process 'gnus-uu-uudecode-sentinel) | |
1538 (setq state (list 'begin)) | |
1539 (push (concat gnus-uu-work-dir gnus-uu-file-name) files)) | |
1540 | |
1541 ;; We look for the end of the thing to be decoded. | |
1542 (if (re-search-forward gnus-uu-end-string nil t) | |
1543 (push 'end state) | |
1544 (goto-char (point-max)) | |
1545 (re-search-backward gnus-uu-body-line nil t)) | |
1546 | |
1547 (forward-line 1) | |
1548 | |
1549 (when gnus-uu-uudecode-process | |
1550 (when (memq (process-status gnus-uu-uudecode-process) '(run stop)) | |
1551 ;; Try to correct mishandled uucode. | |
1552 (when gnus-uu-correct-stripped-uucode | |
1553 (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
|
1554 (gnus-run-hooks 'gnus-uu-pre-uudecode-hook) |
17493 | 1555 |
1556 ;; Send the text to the process. | |
1557 (condition-case nil | |
1558 (process-send-region | |
1559 gnus-uu-uudecode-process start-char (point)) | |
1560 (error | |
1561 (progn | |
1562 (delete-process gnus-uu-uudecode-process) | |
1563 (gnus-message 2 "gnus-uu: Couldn't uudecode") | |
1564 (setq state (list 'wrong-type))))) | |
1565 | |
1566 (if (memq 'end state) | |
1567 (progn | |
1568 ;; Send an EOF, just in case. | |
1569 (ignore-errors | |
1570 (process-send-eof gnus-uu-uudecode-process)) | |
1571 (while (memq (process-status gnus-uu-uudecode-process) | |
1572 '(open run)) | |
1573 (accept-process-output gnus-uu-uudecode-process 1))) | |
1574 (when (or (not gnus-uu-uudecode-process) | |
1575 (not (memq (process-status gnus-uu-uudecode-process) | |
1576 '(run stop)))) | |
1577 (setq state (list 'wrong-type))))))) | |
1578 | |
1579 (if (memq 'begin state) | |
1580 (cons (if (= (length files) 1) (car files) files) state) | |
1581 state)))) | |
1582 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1583 (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
|
1584 "*** WARNING *** |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1585 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1586 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
|
1587 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
|
1588 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
|
1589 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
|
1590 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
|
1591 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1592 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
|
1593 "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
|
1594 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
|
1595 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
|
1596 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1597 |
17493 | 1598 ;; This function is used by `gnus-uu-grab-articles' to treat |
1599 ;; a shared article. | |
1600 (defun gnus-uu-unshar-article (process-buffer in-state) | |
1601 (let ((state (list 'ok)) | |
1602 start-char) | |
1603 (save-excursion | |
1604 (set-buffer process-buffer) | |
1605 (goto-char (point-min)) | |
1606 (if (not (re-search-forward gnus-uu-shar-begin-string nil t)) | |
1607 (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
|
1608 (save-window-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1609 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1610 (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
|
1611 (delete-other-windows) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1612 (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
|
1613 "*Warning*")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1614 (unless |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1615 (unwind-protect |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1616 (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
|
1617 (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
|
1618 gnus-uu-unshar-warning)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1619 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1620 (display-buffer buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1621 (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
|
1622 (kill-buffer buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1623 (setq state (list 'error)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1624 (unless (memq 'error state) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1625 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1626 (setq start-char (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1627 (call-process-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1628 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
|
1629 (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
|
1630 shell-command-switch |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1631 (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
|
1632 gnus-shell-command-separator " sh"))))) |
17493 | 1633 state)) |
1634 | |
1635 ;; Returns the name of what the shar file is going to unpack. | |
1636 (defun gnus-uu-find-name-in-shar () | |
1637 (let ((oldpoint (point)) | |
1638 res) | |
1639 (goto-char (point-min)) | |
1640 (when (re-search-forward gnus-uu-shar-name-marker nil t) | |
1641 (setq res (buffer-substring (match-beginning 1) (match-end 1)))) | |
1642 (goto-char oldpoint) | |
1643 res)) | |
1644 | |
1645 ;; `gnus-uu-choose-action' chooses what action to perform given the name | |
1646 ;; and `gnus-uu-file-action-list'. Returns either nil if no action is | |
1647 ;; found, or the name of the command to run if such a rule is found. | |
1648 (defun gnus-uu-choose-action (file-name file-action-list &optional no-ignore) | |
1649 (let ((action-list (copy-sequence file-action-list)) | |
1650 (case-fold-search t) | |
1651 rule action) | |
1652 (and | |
1653 (unless no-ignore | |
1654 (and (not | |
1655 (and gnus-uu-ignore-files-by-name | |
1656 (string-match gnus-uu-ignore-files-by-name file-name))) | |
1657 (not | |
1658 (and gnus-uu-ignore-files-by-type | |
1659 (string-match gnus-uu-ignore-files-by-type | |
1660 (or (gnus-uu-choose-action | |
1661 file-name gnus-uu-ext-to-mime-list t) | |
1662 "")))))) | |
1663 (while (not (or (eq action-list ()) action)) | |
1664 (setq rule (car action-list)) | |
1665 (setq action-list (cdr action-list)) | |
1666 (when (string-match (car rule) file-name) | |
1667 (setq action (cadr rule))))) | |
1668 action)) | |
1669 | |
1670 (defun gnus-uu-treat-archive (file-path) | |
1671 ;; Unpacks an archive. Returns t if unpacking is successful. | |
1672 (let ((did-unpack t) | |
1673 action command dir) | |
1674 (setq action (gnus-uu-choose-action | |
1675 file-path (append gnus-uu-user-archive-rules | |
1676 (if gnus-uu-ignore-default-archive-rules | |
1677 nil | |
1678 gnus-uu-default-archive-rules)))) | |
1679 | |
1680 (when (not action) | |
1681 (error "No unpackers for the file %s" file-path)) | |
1682 | |
1683 (string-match "/[^/]*$" file-path) | |
1684 (setq dir (substring file-path 0 (match-beginning 0))) | |
1685 | |
1686 (when (member action gnus-uu-destructive-archivers) | |
1687 (copy-file file-path (concat file-path "~") t)) | |
1688 | |
1689 (setq command (format "cd %s ; %s" dir (gnus-uu-command action file-path))) | |
1690 | |
1691 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1692 (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name)) |
17493 | 1693 (erase-buffer)) |
1694 | |
1695 (gnus-message 5 "Unpacking: %s..." (gnus-uu-command action file-path)) | |
1696 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1697 (if (eq 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
|
1698 (gnus-get-buffer-create gnus-uu-output-buffer-name) |
17493 | 1699 nil shell-command-switch command)) |
1700 (message "") | |
1701 (gnus-message 2 "Error during unpacking of archive") | |
1702 (setq did-unpack nil)) | |
1703 | |
1704 (when (member action gnus-uu-destructive-archivers) | |
1705 (rename-file (concat file-path "~") file-path t)) | |
1706 | |
1707 did-unpack)) | |
1708 | |
1709 (defun gnus-uu-dir-files (dir) | |
1710 (let ((dirs (directory-files dir t "[^/][^\\.][^\\.]?$")) | |
1711 files file) | |
1712 (while dirs | |
1713 (if (file-directory-p (setq file (car dirs))) | |
1714 (setq files (append files (gnus-uu-dir-files file))) | |
1715 (push file files)) | |
1716 (setq dirs (cdr dirs))) | |
1717 files)) | |
1718 | |
1719 (defun gnus-uu-unpack-files (files &optional ignore) | |
1720 ;; Go through FILES and look for files to unpack. | |
1721 (let* ((totfiles (gnus-uu-ls-r gnus-uu-work-dir)) | |
1722 (ofiles files) | |
1723 file did-unpack) | |
1724 (while files | |
1725 (setq file (cdr (assq 'name (car files)))) | |
1726 (when (and (not (member file ignore)) | |
1727 (equal (gnus-uu-get-action (file-name-nondirectory file)) | |
1728 "gnus-uu-archive")) | |
1729 (push file did-unpack) | |
1730 (unless (gnus-uu-treat-archive file) | |
1731 (gnus-message 2 "Error during unpacking of %s" file)) | |
1732 (let* ((newfiles (gnus-uu-ls-r gnus-uu-work-dir)) | |
1733 (nfiles newfiles)) | |
1734 (while nfiles | |
1735 (unless (member (car nfiles) totfiles) | |
1736 (push (list (cons 'name (car nfiles)) | |
1737 (cons 'original file)) | |
1738 ofiles)) | |
1739 (setq nfiles (cdr nfiles))) | |
1740 (setq totfiles newfiles))) | |
1741 (setq files (cdr files))) | |
1742 (if did-unpack | |
1743 (gnus-uu-unpack-files ofiles (append did-unpack ignore)) | |
1744 ofiles))) | |
1745 | |
1746 (defun gnus-uu-ls-r (dir) | |
1747 (let* ((files (gnus-uu-directory-files dir t)) | |
1748 (ofiles files)) | |
1749 (while files | |
1750 (when (file-directory-p (car files)) | |
1751 (setq ofiles (delete (car files) ofiles)) | |
1752 (setq ofiles (append ofiles (gnus-uu-ls-r (car files))))) | |
1753 (setq files (cdr files))) | |
1754 ofiles)) | |
1755 | |
1756 ;; Various stuff | |
1757 | |
1758 (defun gnus-uu-directory-files (dir &optional full) | |
1759 (let (files out file) | |
1760 (setq files (directory-files dir full)) | |
1761 (while files | |
1762 (setq file (car files)) | |
1763 (setq files (cdr files)) | |
1764 (unless (member (file-name-nondirectory file) '("." "..")) | |
1765 (push file out))) | |
1766 (setq out (nreverse out)) | |
1767 out)) | |
1768 | |
1769 (defun gnus-uu-check-correct-stripped-uucode (start end) | |
1770 (save-excursion | |
1771 (let (found beg length) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1772 (unless gnus-uu-correct-stripped-uucode |
17493 | 1773 (goto-char start) |
1774 | |
1775 (if (re-search-forward " \\|`" end t) | |
1776 (progn | |
1777 (goto-char start) | |
1778 (while (not (eobp)) | |
1779 (progn | |
1780 (when (looking-at "\n") | |
1781 (replace-match "")) | |
1782 (forward-line 1)))) | |
1783 | |
1784 (while (not (eobp)) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1785 (unless (looking-at (concat gnus-uu-begin-string "\\|" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1786 gnus-uu-end-string)) |
17493 | 1787 (when (not found) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1788 (setq length (- (point-at-eol) (point-at-bol)))) |
17493 | 1789 (setq found t) |
1790 (beginning-of-line) | |
1791 (setq beg (point)) | |
1792 (end-of-line) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1793 (unless (= length (- (point) beg)) |
17493 | 1794 (insert (make-string (- length (- (point) beg)) ? )))) |
1795 (forward-line 1))))))) | |
1796 | |
1797 (defvar gnus-uu-tmp-alist nil) | |
1798 | |
1799 (defun gnus-uu-initialize (&optional scan) | |
1800 (let (entry) | |
1801 (if (and (not scan) | |
1802 (when (setq entry (assoc gnus-newsgroup-name gnus-uu-tmp-alist)) | |
1803 (if (file-exists-p (cdr entry)) | |
1804 (setq gnus-uu-work-dir (cdr entry)) | |
1805 (setq gnus-uu-tmp-alist (delq entry gnus-uu-tmp-alist)) | |
1806 nil))) | |
1807 t | |
1808 (setq gnus-uu-tmp-dir (file-name-as-directory | |
1809 (expand-file-name gnus-uu-tmp-dir))) | |
1810 (if (not (file-directory-p gnus-uu-tmp-dir)) | |
1811 (error "Temp directory %s doesn't exist" gnus-uu-tmp-dir) | |
1812 (when (not (file-writable-p gnus-uu-tmp-dir)) | |
1813 (error "Temp directory %s can't be written to" | |
1814 gnus-uu-tmp-dir))) | |
1815 | |
1816 (setq gnus-uu-work-dir | |
44075
7782e54757bb
* mail-source.el (make-source-make-complex-temp-name): Use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
38413
diff
changeset
|
1817 (mm-make-temp-file (concat gnus-uu-tmp-dir "gnus") 'dir)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1818 (gnus-set-file-modes gnus-uu-work-dir 448) |
17493 | 1819 (setq gnus-uu-work-dir (file-name-as-directory gnus-uu-work-dir)) |
1820 (push (cons gnus-newsgroup-name gnus-uu-work-dir) | |
1821 gnus-uu-tmp-alist)))) | |
1822 | |
1823 | |
1824 ;; Kills the temporary uu buffers, kills any processes, etc. | |
1825 (defun gnus-uu-clean-up () | |
1826 (let (buf) | |
1827 (and gnus-uu-uudecode-process | |
1828 (memq (process-status (or gnus-uu-uudecode-process "nevair")) | |
1829 '(stop run)) | |
1830 (delete-process gnus-uu-uudecode-process)) | |
1831 (when (setq buf (get-buffer gnus-uu-output-buffer-name)) | |
1832 (kill-buffer buf)))) | |
1833 | |
1834 ;; Inputs an action and a filename and returns a full command, making sure | |
1835 ;; that the filename will be treated as a single argument when the shell | |
1836 ;; executes the command. | |
1837 (defun gnus-uu-command (action file) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1838 (let ((quoted-file (shell-quote-argument file))) |
17493 | 1839 (if (string-match "%s" action) |
1840 (format action quoted-file) | |
1841 (concat action " " quoted-file)))) | |
1842 | |
1843 (defun gnus-uu-delete-work-dir (&optional dir) | |
1844 "Delete recursively all files and directories under `gnus-uu-work-dir'." | |
1845 (if dir | |
1846 (gnus-message 7 "Deleting directory %s..." dir) | |
1847 (setq dir gnus-uu-work-dir)) | |
1848 (when (and dir | |
1849 (file-exists-p dir)) | |
1850 (let ((files (directory-files dir t nil t)) | |
1851 file) | |
1852 (while (setq file (pop files)) | |
1853 (unless (member (file-name-nondirectory file) '("." "..")) | |
1854 (if (file-directory-p file) | |
1855 (gnus-uu-delete-work-dir file) | |
1856 (gnus-message 9 "Deleting file %s..." file) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1857 (condition-case err |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1858 (delete-file file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1859 (error (gnus-message 3 "Deleting file %s failed... %s" file err)))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1860 (condition-case err |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1861 (delete-directory dir) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1862 (error (gnus-message 3 "Deleting directory %s failed... %s" file err)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1863 (gnus-message 7 ""))) |
17493 | 1864 |
1865 ;; Initializing | |
1866 | |
1867 (add-hook 'gnus-exit-group-hook 'gnus-uu-clean-up) | |
1868 (add-hook 'gnus-exit-group-hook 'gnus-uu-delete-work-dir) | |
1869 | |
1870 | |
1871 | |
1872 ;;; | |
1873 ;;; uuencoded posting | |
1874 ;;; | |
1875 | |
1876 ;; Any function that is to be used as and encoding method will take two | |
1877 ;; parameters: PATH-NAME and FILE-NAME. (E.g. "/home/gaga/spiral.jpg" | |
1878 ;; and "spiral.jpg", respectively.) The function should return nil if | |
1879 ;; the encoding wasn't successful. | |
1880 (defcustom gnus-uu-post-encode-method 'gnus-uu-post-encode-uuencode | |
1881 "Function used for encoding binary files. | |
1882 There are three functions supplied with gnus-uu for encoding files: | |
1883 `gnus-uu-post-encode-uuencode', which does straight uuencoding; | |
1884 `gnus-uu-post-encode-mime', which encodes with base64 and adds MIME | |
1885 headers; and `gnus-uu-post-encode-mime-uuencode', which encodes with | |
1886 uuencode and adds MIME headers." | |
1887 :group 'gnus-extract-post | |
1888 :type '(radio (function-item gnus-uu-post-encode-uuencode) | |
1889 (function-item gnus-uu-post-encode-mime) | |
1890 (function-item gnus-uu-post-encode-mime-uuencode) | |
1891 (function :tag "Other"))) | |
1892 | |
1893 (defcustom gnus-uu-post-include-before-composing nil | |
1894 "Non-nil means that gnus-uu will ask for a file to encode before you compose the article. | |
1895 If this variable is t, you can either include an encoded file with | |
1896 \\[gnus-uu-post-insert-binary-in-article] or have one included for you when you post the article." | |
1897 :group 'gnus-extract-post | |
1898 :type 'boolean) | |
1899 | |
1900 (defcustom gnus-uu-post-length 990 | |
1901 "Maximum length of an article. | |
1902 The encoded file will be split into how many articles it takes to | |
1903 post the entire file." | |
1904 :group 'gnus-extract-post | |
1905 :type 'integer) | |
1906 | |
1907 (defcustom gnus-uu-post-threaded nil | |
1908 "Non-nil means that gnus-uu will post the encoded file in a thread. | |
1909 This may not be smart, as no other decoder I have seen are able to | |
1910 follow threads when collecting uuencoded articles. (Well, I have seen | |
1911 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
|
1912 counts...) The default is nil." |
17493 | 1913 :group 'gnus-extract-post |
1914 :type 'boolean) | |
1915 | |
1916 (defcustom gnus-uu-post-separate-description t | |
1917 "Non-nil means that the description will be posted in a separate article. | |
1918 The first article will typically be numbered (0/x). If this variable | |
1919 is nil, the description the user enters will be included at the | |
1920 beginning of the first article, which will be numbered (1/x). Default | |
1921 is t." | |
1922 :group 'gnus-extract-post | |
1923 :type 'boolean) | |
1924 | |
1925 (defvar gnus-uu-post-binary-separator "--binary follows this line--") | |
1926 (defvar gnus-uu-post-message-id nil) | |
1927 (defvar gnus-uu-post-inserted-file-name nil) | |
1928 (defvar gnus-uu-winconf-post-news nil) | |
1929 | |
1930 (defun gnus-uu-post-news () | |
1931 "Compose an article and post an encoded file." | |
1932 (interactive) | |
1933 (setq gnus-uu-post-inserted-file-name nil) | |
1934 (setq gnus-uu-winconf-post-news (current-window-configuration)) | |
1935 | |
1936 (gnus-summary-post-news) | |
1937 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
29734
diff
changeset
|
1938 (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
|
1939 (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
|
1940 (use-local-map map)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1941 ;;(local-set-key "\C-c\C-c" 'gnus-summary-edit-article-done) |
17493 | 1942 (local-set-key "\C-c\C-c" 'gnus-uu-post-news-inews) |
1943 (local-set-key "\C-c\C-s" 'gnus-uu-post-news-inews) | |
1944 (local-set-key "\C-c\C-i" 'gnus-uu-post-insert-binary-in-article) | |
1945 | |
1946 (when gnus-uu-post-include-before-composing | |
1947 (save-excursion (setq gnus-uu-post-inserted-file-name | |
1948 (gnus-uu-post-insert-binary))))) | |
1949 | |
1950 (defun gnus-uu-post-insert-binary-in-article () | |
1951 "Inserts an encoded file in the buffer. | |
1952 The user will be asked for a file name." | |
1953 (interactive) | |
1954 (save-excursion | |
1955 (setq gnus-uu-post-inserted-file-name (gnus-uu-post-insert-binary)))) | |
1956 | |
1957 ;; Encodes with uuencode and substitutes all spaces with backticks. | |
1958 (defun gnus-uu-post-encode-uuencode (path file-name) | |
1959 (when (gnus-uu-post-encode-file "uuencode" path file-name) | |
1960 (goto-char (point-min)) | |
1961 (forward-line 1) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
1962 (while (search-forward " " nil t) |
17493 | 1963 (replace-match "`")) |
1964 t)) | |
1965 | |
1966 ;; Encodes with uuencode and adds MIME headers. | |
1967 (defun gnus-uu-post-encode-mime-uuencode (path file-name) | |
1968 (when (gnus-uu-post-encode-uuencode path file-name) | |
1969 (gnus-uu-post-make-mime file-name "x-uue") | |
1970 t)) | |
1971 | |
1972 ;; Encodes with base64 and adds MIME headers | |
1973 (defun gnus-uu-post-encode-mime (path file-name) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1974 (when (eq 0 (call-process shell-file-name nil t nil shell-command-switch |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1975 (format "%s %s -o %s" "mmencode" path file-name))) |
17493 | 1976 (gnus-uu-post-make-mime file-name "base64") |
1977 t)) | |
1978 | |
1979 ;; Adds MIME headers. | |
1980 (defun gnus-uu-post-make-mime (file-name encoding) | |
1981 (goto-char (point-min)) | |
1982 (insert (format "Content-Type: %s; name=\"%s\"\n" | |
1983 (gnus-uu-choose-action file-name gnus-uu-ext-to-mime-list) | |
1984 file-name)) | |
1985 (insert (format "Content-Transfer-Encoding: %s\n\n" encoding)) | |
1986 (save-restriction | |
1987 (set-buffer gnus-message-buffer) | |
1988 (goto-char (point-min)) | |
1989 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$")) | |
1990 (forward-line -1) | |
44514
8bfbcb957964
(gnus-uu-binhex-article, gnus-uu-reginize-string, gnus-uu-expand-numbers)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44075
diff
changeset
|
1991 (narrow-to-region (point-min) (point)) |
17493 | 1992 (unless (mail-fetch-field "mime-version") |
1993 (widen) | |
1994 (insert "MIME-Version: 1.0\n")) | |
1995 (widen))) | |
1996 | |
1997 ;; Encodes a file PATH with COMMAND, leaving the result in the | |
1998 ;; current buffer. | |
1999 (defun gnus-uu-post-encode-file (command path file-name) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2000 (eq 0 (call-process shell-file-name nil t nil shell-command-switch |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2001 (format "%s %s %s" command path file-name)))) |
17493 | 2002 |
2003 (defun gnus-uu-post-news-inews () | |
2004 "Posts the composed news article and encoded file. | |
2005 If no file has been included, the user will be asked for a file." | |
2006 (interactive) | |
2007 | |
2008 (let (file-name) | |
2009 | |
2010 (if gnus-uu-post-inserted-file-name | |
2011 (setq file-name gnus-uu-post-inserted-file-name) | |
2012 (setq file-name (gnus-uu-post-insert-binary))) | |
2013 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2014 (gnus-uu-post-encoded file-name gnus-uu-post-threaded)) |
17493 | 2015 (setq gnus-uu-post-inserted-file-name nil) |
2016 (when gnus-uu-winconf-post-news | |
2017 (set-window-configuration gnus-uu-winconf-post-news))) | |
2018 | |
2019 ;; Asks for a file to encode, encodes it and inserts the result in | |
2020 ;; the current buffer. Returns the file name the user gave. | |
2021 (defun gnus-uu-post-insert-binary () | |
2022 (let ((uuencode-buffer-name "*uuencode buffer*") | |
2023 file-path uubuf file-name) | |
2024 | |
2025 (setq file-path (read-file-name | |
2026 "What file do you want to encode? ")) | |
2027 (when (not (file-exists-p file-path)) | |
2028 (error "%s: No such file" file-path)) | |
2029 | |
2030 (goto-char (point-max)) | |
2031 (insert (format "\n%s\n" gnus-uu-post-binary-separator)) | |
2032 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
2033 ;; #### Unix-specific? |
17493 | 2034 (when (string-match "^~/" file-path) |
2035 (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
|
2036 ;; #### Unix-specific? |
17493 | 2037 (if (string-match "/[^/]*$" file-path) |
2038 (setq file-name (substring file-path (1+ (match-beginning 0)))) | |
2039 (setq file-name file-path)) | |
2040 | |
2041 (unwind-protect | |
2042 (if (save-excursion | |
2043 (set-buffer (setq uubuf | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
2044 (gnus-get-buffer-create uuencode-buffer-name))) |
17493 | 2045 (erase-buffer) |
2046 (funcall gnus-uu-post-encode-method file-path file-name)) | |
2047 (insert-buffer-substring uubuf) | |
2048 (error "Encoding unsuccessful")) | |
2049 (kill-buffer uubuf)) | |
2050 file-name)) | |
2051 | |
2052 ;; Posts the article and all of the encoded file. | |
2053 (defun gnus-uu-post-encoded (file-name &optional threaded) | |
2054 (let ((send-buffer-name "*uuencode send buffer*") | |
2055 (encoded-buffer-name "*encoded buffer*") | |
2056 (top-string "[ cut here %s (%s %d/%d) %s gnus-uu ]") | |
2057 (separator (concat mail-header-separator "\n\n")) | |
2058 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
|
2059 beg-line minlen post-buf whole-len beg-binary end-binary) |
17493 | 2060 |
2061 (setq post-buf (current-buffer)) | |
2062 | |
2063 (goto-char (point-min)) | |
2064 (when (not (re-search-forward | |
2065 (if gnus-uu-post-separate-description | |
2066 (concat "^" (regexp-quote gnus-uu-post-binary-separator) | |
2067 "$") | |
2068 (concat "^" (regexp-quote mail-header-separator) "$")) | |
2069 nil t)) | |
2070 (error "Internal error: No binary/header separator")) | |
2071 (beginning-of-line) | |
2072 (forward-line 1) | |
2073 (setq beg-binary (point)) | |
2074 (setq end-binary (point-max)) | |
2075 | |
2076 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
2077 (set-buffer (setq uubuf (gnus-get-buffer-create encoded-buffer-name))) |
17493 | 2078 (erase-buffer) |
2079 (insert-buffer-substring post-buf beg-binary end-binary) | |
2080 (goto-char (point-min)) | |
44514
8bfbcb957964
(gnus-uu-binhex-article, gnus-uu-reginize-string, gnus-uu-expand-numbers)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
44075
diff
changeset
|
2081 (setq length (count-lines (point-min) (point-max))) |
17493 | 2082 (setq parts (/ length gnus-uu-post-length)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2083 (unless (< (% length gnus-uu-post-length) 4) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2084 (incf parts))) |
17493 | 2085 |
2086 (when gnus-uu-post-separate-description | |
2087 (forward-line -1)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2088 (delete-region (point) (point-max)) |
17493 | 2089 |
2090 (goto-char (point-min)) | |
2091 (re-search-forward | |
2092 (concat "^" (regexp-quote mail-header-separator) "$") nil t) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
2093 (setq header (buffer-substring (point-min) (point-at-bol))) |
17493 | 2094 |
2095 (goto-char (point-min)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2096 (when gnus-uu-post-separate-description |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2097 (when (re-search-forward "^Subject: " nil t) |
17493 | 2098 (end-of-line) |
2099 (insert (format " (0/%d)" parts))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2100 (save-excursion |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2101 (message-send)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2102 (setq gnus-uu-post-message-id (message-fetch-field "message-id"))) |
17493 | 2103 |
2104 (save-excursion | |
2105 (setq i 1) | |
2106 (setq beg 1) | |
2107 (while (not (> i parts)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
2108 (set-buffer (gnus-get-buffer-create send-buffer-name)) |
17493 | 2109 (erase-buffer) |
2110 (insert header) | |
2111 (when (and threaded gnus-uu-post-message-id) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2112 (insert "References: " gnus-uu-post-message-id "\n")) |
17493 | 2113 (insert separator) |
2114 (setq whole-len | |
2115 (- 62 (length (format top-string "" file-name i parts "")))) | |
2116 (when (> 1 (setq minlen (/ whole-len 2))) | |
2117 (setq minlen 1)) | |
2118 (setq | |
2119 beg-line | |
2120 (format top-string | |
2121 (make-string minlen ?-) | |
2122 file-name i parts | |
2123 (make-string | |
2124 (if (= 0 (% whole-len 2)) (1- minlen) minlen) ?-))) | |
2125 | |
2126 (goto-char (point-min)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2127 (when (re-search-forward "^Subject: " nil t) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2128 (end-of-line) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2129 (insert (format " (%d/%d)" i parts))) |
17493 | 2130 |
2131 (goto-char (point-max)) | |
2132 (save-excursion | |
2133 (set-buffer uubuf) | |
2134 (goto-char beg) | |
2135 (if (= i parts) | |
2136 (goto-char (point-max)) | |
2137 (forward-line gnus-uu-post-length)) | |
2138 (when (and (= (1+ i) parts) (< (count-lines (point) (point-max)) 4)) | |
2139 (forward-line -4)) | |
2140 (setq end (point))) | |
2141 (insert-buffer-substring uubuf beg end) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2142 (insert beg-line "\n") |
17493 | 2143 (setq beg end) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2144 (incf i) |
17493 | 2145 (goto-char (point-min)) |
2146 (re-search-forward | |
2147 (concat "^" (regexp-quote mail-header-separator) "$") nil t) | |
2148 (beginning-of-line) | |
2149 (forward-line 2) | |
2150 (when (re-search-forward | |
2151 (concat "^" (regexp-quote gnus-uu-post-binary-separator) "$") | |
2152 nil t) | |
2153 (replace-match "") | |
2154 (forward-line 1)) | |
2155 (insert beg-line) | |
2156 (insert "\n") | |
2157 (let (message-sent-message-via) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2158 (save-excursion |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2159 (message-send)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2160 (setq gnus-uu-post-message-id |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2161 (concat (message-fetch-field "references") " " |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2162 (message-fetch-field "message-id")))))) |
17493 | 2163 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2164 (gnus-kill-buffer send-buffer-name) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
2165 (gnus-kill-buffer encoded-buffer-name) |
17493 | 2166 |
2167 (when (not gnus-uu-post-separate-description) | |
2168 (set-buffer-modified-p nil) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
85008
diff
changeset
|
2169 (bury-buffer)))) |
17493 | 2170 |
2171 (provide 'gnus-uu) | |
2172 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87649
diff
changeset
|
2173 ;; arch-tag: 05312384-0a83-4720-9a58-b3160b888853 |
38413
a26d9b55abb6
Some fixes to follow coding conventions in files from Gnus.
Pavel Janík <Pavel@Janik.cz>
parents:
36856
diff
changeset
|
2174 ;;; gnus-uu.el ends here |