X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmm-uu.el;h=4f660130272a91a6c79eee1818b952c8079cf059;hb=b638b2c5fddce99a4eeaff6dafac0657ee51ba0d;hp=ba23c742c8405ade5d62d6c45a886167e121dcd3;hpb=0f4d4864936932e6e425d28a5b8b5e92c41942a2;p=elisp%2Fgnus.git- diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index ba23c74..4f66013 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -81,8 +81,8 @@ decoder, such as hexbin." ;;; Thanks to Edward J. Sabol and ;;; Peter von der Ah\'e -(defconst mm-uu-forward-begin-line "^-+ \\(?:Start of \\)?Forwarded message") -(defconst mm-uu-forward-end-line "^-+ End\\(?: of\\)? forwarded message") +(defconst mm-uu-forward-begin-line "^-+ \\(Start of \\)?Forwarded message") +(defconst mm-uu-forward-end-line "^-+ End \\(of \\)?forwarded message") (defvar mm-uu-begin-line nil) @@ -131,31 +131,19 @@ To disable dissecting shar codes, for instance, add (defun mm-uu-dissect () "Dissect the current buffer and return a list of uu handles." - (let (ct ctl cte charset text-start start-char end-char - type file-name end-line result text-plain-type - start-char-1 end-char-1 - (case-fold-search t)) + (let (text-start start-char end-char + type file-name end-line result text-plain-type + start-char-1 end-char-1 + (case-fold-search t)) (save-excursion (save-restriction (mail-narrow-to-head) - (when (and (mail-fetch-field "mime-version") - (setq ct (mail-fetch-field "content-type"))) - (setq cte (message-fetch-field "content-transfer-encoding" t) - ctl (ignore-errors (mail-header-parse-content-type ct)) - charset (and ctl (mail-content-type-get ctl 'charset))) - (if (stringp cte) - (setq cte (intern (downcase (mail-header-remove-whitespace - (mail-header-remove-comments - cte)))))) - (if (eq cte 'base64) - (setq charset 'gnus-encoded ;; a fake charset - cte nil))) (goto-char (point-max))) (forward-line) + ;;; gnus-decoded is a fake charset, which means no further + ;;; decoding. (setq text-start (point) - text-plain-type (cons "text/plain" - (if charset - (list (cons 'charset charset))))) + text-plain-type '("text/plain" (charset . gnus-decoded))) (while (re-search-forward mm-uu-begin-line nil t) (setq start-char (match-beginning 0)) (setq type (cdr (assq (aref (match-string 0) 0) @@ -173,9 +161,7 @@ To disable dissecting shar codes, for instance, add (intern (concat "mm-uu-" (symbol-name type) "-end-line")))) (when (and (re-search-forward end-line nil t) - (not (eq (match-beginning 0) (match-end 0))) - ;; Do not dissect base64 forward. - (not (and (eq charset 'gnus-encoded) (eq type 'forward)))) + (not (eq (match-beginning 0) (match-end 0)))) (setq end-char-1 (match-beginning 0)) (forward-line) (setq end-char (point)) @@ -186,7 +172,7 @@ To disable dissecting shar codes, for instance, add (if (> start-char text-start) (push (mm-make-handle (mm-uu-copy-to-buffer text-start start-char) - text-plain-type cte) + text-plain-type) result)) (push (cond @@ -195,7 +181,7 @@ To disable dissecting shar codes, for instance, add '("application/postscript"))) ((eq type 'forward) (mm-make-handle (mm-uu-copy-to-buffer start-char-1 end-char-1) - '("message/rfc822"))) + '("message/rfc822" (charset . gnus-decoded)))) ((eq type 'uu) (mm-make-handle (mm-uu-copy-to-buffer start-char end-char) (list (or (and file-name @@ -227,7 +213,7 @@ To disable dissecting shar codes, for instance, add (if (> (point-max) (1+ text-start)) (push (mm-make-handle (mm-uu-copy-to-buffer text-start (point-max)) - text-plain-type cte) + text-plain-type) result)) (setq result (cons "multipart/mixed" (nreverse result)))) result))) @@ -236,10 +222,7 @@ To disable dissecting shar codes, for instance, add (defun mm-uu-test () "Check whether the current buffer contains uu stuffs." (save-excursion - (save-restriction - (mail-narrow-to-head) - (goto-char (point-max))) - (forward-line) + (goto-char (point-min)) (let (type end-line result (case-fold-search t)) (while (and mm-uu-begin-line