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