From: yamaoka Date: Thu, 13 Nov 2003 08:44:07 +0000 (+0000) Subject: Synch to Gnus 200311130835. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a1e9c8327d6466b8627120fbfb0bd1de51afbef7;p=elisp%2Fgnus.git- Synch to Gnus 200311130835. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ceca12f..4b26e66 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2003-11-13 Katsumi Yamaoka + + * mm-decode.el (mm-dissect-buffer): Save start="" value + contained in Content-Type header of multipart/related messages. + + * mm-view.el (mm-w3m-cid-retrieve-1): New function. + (mm-w3m-cid-retrieve): Use it. + + * mml.el (mml-generate-mime-1): Add start="" to Content-Type. + (mml-insert-mime-headers): Insert Content-ID header. + (mml-insert-mml-markup): Insert start="" value. + 2003-11-12 Teodor Zlatanov * nnml.el (nnml-request-accept-article): pass sender to diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 0261dea..d87ec5b 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -528,7 +528,8 @@ Postpone undisplaying of viewers for types in ((equal type "multipart") (let ((mm-dissect-default-type (if (equal subtype "digest") "message/rfc822" - "text/plain"))) + "text/plain")) + (start (cdr (assq 'start (cdr ctl))))) (add-text-properties 0 (length (car ctl)) (mm-alist-to-plist (cdr ctl)) (car ctl)) @@ -538,10 +539,9 @@ Postpone undisplaying of viewers for types in ;; the mm-handle API so we simply store the multipart buffert ;; name as a text property of the "multipart/whatever" string. (add-text-properties 0 (length (car ctl)) - (list 'buffer (mm-copy-to-buffer)) - (car ctl)) - (add-text-properties 0 (length (car ctl)) - (list 'from from) + (list 'buffer (mm-copy-to-buffer) + 'from from + 'start start) (car ctl)) (cons (car ctl) (mm-dissect-multipart ctl)))) (t diff --git a/lisp/mm-view.el b/lisp/mm-view.el index ec59348..372c936 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -197,17 +197,24 @@ (setq mm-w3m-setup t)) (setq w3m-display-inline-images mm-inline-text-html-with-images)) +(defun mm-w3m-cid-retrieve-1 (url handle) + (dolist (elem handle) + (when (and (listp elem) + (equal url (mm-handle-id elem))) + (mm-insert-part elem) + (throw 'found-handle (mm-handle-media-type elem))))) + (defun mm-w3m-cid-retrieve (url &rest args) "Insert a content pointed by URL if it has the cid: scheme." (when (string-match "\\`cid:" url) (setq url (concat "<" (substring url (match-end 0)) ">")) (catch 'found-handle - (dolist (handle (with-current-buffer w3m-current-buffer - gnus-article-mime-handles)) - (when (and (listp handle) - (equal url (mm-handle-id handle))) - (mm-insert-part handle) - (throw 'found-handle (mm-handle-media-type handle))))))) + (let ((handles (with-current-buffer w3m-current-buffer + gnus-article-mime-handles))) + (if (mm-multiple-handles handles) + (dolist (handle handles) + (mm-w3m-cid-retrieve-1 url handle)) + (mm-w3m-cid-retrieve-1 url handles)))))) (eval-and-compile (unless (or (featurep 'xemacs) diff --git a/lisp/mml.el b/lisp/mml.el index aec7b0c..a2a487a 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -530,8 +530,11 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." (funcall (cdr handler) cont) ;; No specific handler. Use default one. (let ((mml-boundary (mml-compute-boundary cont))) - (insert (format "Content-Type: multipart/%s; boundary=\"%s\"\n" - type mml-boundary)) + (insert (format "Content-Type: multipart/%s; boundary=\"%s\"" + type mml-boundary) + (if (cdr (assq 'start cont)) + (format "; start=\"%s\"\n" (cdr (assq 'start cont))) + "\n")) (let ((cont cont) part) (while (setq part (pop cont)) ;; Skip `multipart' and attributes. @@ -607,7 +610,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." mml-base-boundary)) (defun mml-insert-mime-headers (cont type charset encoding flowed) - (let (parameters disposition description) + (let (parameters id disposition description) (setq parameters (mml-parameter-string cont mml-content-type-parameters)) @@ -629,6 +632,8 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." (mml-insert-parameter-string cont mml-content-type-parameters)) (insert "\n")) + (when (setq id (cdr (assq 'id cont))) + (insert "Content-ID: " id "\n")) (setq parameters (mml-parameter-string cont mml-content-disposition-parameters)) @@ -768,8 +773,12 @@ If HANDLES is non-nil, use it instead reparsing the buffer." (defun mml-insert-mml-markup (handle &optional buffer nofile mmlp) "Take a MIME handle and insert an MML tag." (if (stringp (car handle)) - (insert "<#multipart type=" (mm-handle-media-subtype handle) - ">\n") + (progn + (insert "<#multipart type=" (mm-handle-media-subtype handle)) + (let ((start (mm-handle-multipart-ctl-parameter handle 'start))) + (when start + (insert " start=\"" start "\""))) + (insert ">\n")) (if mmlp (insert "<#mml type=" (mm-handle-media-type handle)) (insert "<#part type=" (mm-handle-media-type handle))) @@ -777,6 +786,8 @@ If HANDLES is non-nil, use it instead reparsing the buffer." (cdr (mm-handle-disposition handle)))) (unless (symbolp (cdr elem)) (insert " " (symbol-name (car elem)) "=\"" (cdr elem) "\""))) + (when (mm-handle-id handle) + (insert " id=\"" (mm-handle-id handle) "\"")) (when (mm-handle-disposition handle) (insert " disposition=" (car (mm-handle-disposition handle)))) (when buffer