X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgnus-uu.el;h=a90aba3b20f2f8a9963a6cd6c484e377f50d3415;hb=93fd3c5fd9f215515162b7016beb25d30d10104b;hp=19929f358989c7e3cac72de75725809e6f0fd60d;hpb=7bd51e7e85c1b314c2f2d00ebb26678762820d73;p=elisp%2Fgnus.git- diff --git a/lisp/gnus-uu.el b/lisp/gnus-uu.el index 19929f3..a90aba3 100644 --- a/lisp/gnus-uu.el +++ b/lisp/gnus-uu.el @@ -32,6 +32,7 @@ (require 'gnus-art) (require 'message) (require 'gnus-msg) +(require 'mm-decode) (defgroup gnus-extract nil "Extracting encoded files." @@ -833,8 +834,9 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (eq in-state 'first-and-last)) (progn (setq state (list 'begin)) - (save-excursion (set-buffer (gnus-get-buffer-create "*gnus-uu-body*")) - (erase-buffer)) + (save-excursion + (set-buffer (gnus-get-buffer-create "*gnus-uu-body*")) + (erase-buffer)) (save-excursion (set-buffer (gnus-get-buffer-create "*gnus-uu-pre*")) (erase-buffer) @@ -1024,7 +1026,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." ;; finally just replaces the next to last number with "[0-9]+". (save-excursion (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name)) - (buffer-disable-undo (current-buffer)) + (buffer-disable-undo) (erase-buffer) (insert (regexp-quote string)) @@ -1124,7 +1126,7 @@ didn't work, and overwrite existing files. Otherwise, ask each time." string) (save-excursion (set-buffer (gnus-get-buffer-create gnus-uu-output-buffer-name)) - (buffer-disable-undo (current-buffer)) + (buffer-disable-undo) (while string-list (erase-buffer) (insert (caar string-list)) @@ -1694,23 +1696,11 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (when (setq buf (get-buffer gnus-uu-output-buffer-name)) (kill-buffer buf)))) -(defun gnus-quote-arg-for-sh-or-csh (arg) - (let ((pos 0) new-pos accum) - ;; *** bug: we don't handle newline characters properly - (while (setq new-pos (string-match "[!`\"$\\& \t{}]" arg pos)) - (push (substring arg pos new-pos) accum) - (push "\\" accum) - (push (list (aref arg new-pos)) accum) - (setq pos (1+ new-pos))) - (if (= pos 0) - arg - (apply 'concat (nconc (nreverse accum) (list (substring arg pos))))))) - ;; Inputs an action and a filename and returns a full command, making sure ;; that the filename will be treated as a single argument when the shell ;; executes the command. (defun gnus-uu-command (action file) - (let ((quoted-file (gnus-quote-arg-for-sh-or-csh file))) + (let ((quoted-file (mm-quote-arg file))) (if (string-match "%s" action) (format action quoted-file) (concat action " " quoted-file))))