From 7953f8910433eed3622911e622da2fbd96c4969d Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 23 Jan 2006 09:48:15 +0000 Subject: [PATCH] Synch to No Gnus 200601230947. --- lisp/ChangeLog | 8 ++++++++ lisp/mm-decode.el | 4 ++++ lisp/mm-uu.el | 26 +++++++++++++++++++++----- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fae2be9..6f391a8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,13 @@ 2006-01-23 Katsumi Yamaoka + * mm-uu.el (mm-uu-buttonize-original-text-parts): New variable. + (mm-uu-dissect-text-parts): Buttonize original text parts. + + * mm-decode.el (mm-handle-set-disposition): New macro. + (mm-handle-set-description): New macro. + +2006-01-23 Katsumi Yamaoka + * mm-uu.el (mm-uu-dissect-text-parts): Decode content transfer encoding. diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 96352a2..455c14d 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -78,8 +78,12 @@ `(setcar (nthcdr 3 ,handle) ,function)) (defmacro mm-handle-disposition (handle) `(nth 4 ,handle)) +(defmacro mm-handle-set-disposition (handle disposition) + `(setcar (nthcdr 4 ,handle) ,disposition)) (defmacro mm-handle-description (handle) `(nth 5 ,handle)) +(defmacro mm-handle-set-description (handle description) + `(setcar (nthcdr 5 ,handle) ,description)) (defmacro mm-handle-cache (handle) `(nth 6 ,handle)) (defmacro mm-handle-set-cache (handle contents) diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index e518993..717d118 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -618,8 +618,17 @@ value of `mm-uu-text-plain-type'." (setq result (cons "multipart/mixed" (nreverse result)))) result))) +(defcustom mm-uu-buttonize-original-text-parts nil + "Non-nil means that the originals of dissected parts get buttons. +This variable is overridden by `gnus-inhibit-mime-unbuttonizing'." + :type 'boolean + :version "23.0" + :group 'gnus-article-mime) + (defun mm-uu-dissect-text-parts (handle) - "Dissect text parts and put uu handles into HANDLE." + "Dissect text parts and put uu handles into HANDLE. +If `mm-uu-buttonize-original-text-parts' is non-nil, the part that HANDLE +points will always get a button." (let ((buffer (mm-handle-buffer handle))) (cond ((stringp buffer) (mapc 'mm-uu-dissect-text-parts (cdr handle))) @@ -642,10 +651,17 @@ value of `mm-uu-text-plain-type'." encoding type) (mm-uu-dissect t (mm-handle-type handle))) (mm-uu-dissect t (mm-handle-type handle)))))) - (kill-buffer buffer) - (setcar handle (car children)) - (setcdr handle (cdr children)) - (mm-uu-dissect-text-parts handle)))) + (if (or mm-uu-buttonize-original-text-parts + (and (boundp 'gnus-inhibit-mime-unbuttonizing) + (symbol-value 'gnus-inhibit-mime-unbuttonizing))) + (let ((parent (copy-sequence handle))) + (mm-handle-set-disposition parent '("attachment")) + (mm-handle-set-description parent "The original part of") + (setcdr handle (cons parent (cdr children)))) + (kill-buffer buffer) + (setcdr handle (cdr children))) + (setcar handle (car children)) ;; "multipart/mixed" + (mapc 'mm-uu-dissect-text-parts (cdr children))))) (t (mapc 'mm-uu-dissect-text-parts handle))))) -- 1.7.10.4