X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fmm-view.el;h=f6e4a66d7de6e55344c8c293dbc142415cfe7c83;hb=d277eb0192aa1cab699c5804335fe843acb49704;hp=7ed1685164653e20c4c3aeda525022c018a27dd9;hpb=ba69bcbd078640c777abdcb533bb1619808e7444;p=gnus diff --git a/lisp/mm-view.el b/lisp/mm-view.el index 7ed168516..f6e4a66d7 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -1,5 +1,5 @@ ;;; mm-view.el --- functions for viewing MIME objects -;; Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; This file is part of GNU Emacs. @@ -54,7 +54,7 @@ (defvar mm-text-html-washer-alist '((w3 . gnus-article-wash-html-with-w3) (w3m . gnus-article-wash-html-with-w3m) - (w3m-standalone mm-inline-render-with-stdin nil + (w3m-standalone mm-inline-wash-with-stdin nil "w3m" "-dump" "-T" "text/html") (links mm-inline-wash-with-file mm-links-remove-leading-blank @@ -197,27 +197,33 @@ (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) (>= emacs-major-version 21)) (defvar mm-w3m-mode-map nil - "Keymap for text/html part rendered by `mm-w3m-preview-text/html'. -This map is overwritten by `mm-w3m-local-map-property' based on the -value of `w3m-minor-mode-map'. Therefore, in order to add some -commands to this map, add them to `w3m-minor-mode-map' instead of this -map."))) + "Keymap for text/html parts rendered by emacs-w3m. +This keymap will be bound only when Emacs 20 is running and overwritten +by the value of `w3m-minor-mode-map'. In order to add some commands to +this keymap, add them to `w3m-minor-mode-map' instead of this keymap."))) (defun mm-w3m-local-map-property () (when (and (boundp 'w3m-minor-mode-map) w3m-minor-mode-map) @@ -255,6 +261,7 @@ map."))) (add-text-properties (point-min) (point-max) (nconc (mm-w3m-local-map-property) + ;; Put the mark meaning this part was rendered by emacs-w3m. '(mm-inline-text-html-with-w3m t))))) (mm-handle-set-undisplayer handle @@ -439,7 +446,8 @@ map."))) gnus-article-prepare-hook (gnus-newsgroup-charset (or charset gnus-newsgroup-charset))) - (run-hooks 'gnus-article-decode-hook) + (let ((gnus-original-article-buffer (mm-handle-buffer handle))) + (run-hooks 'gnus-article-decode-hook)) (gnus-article-prepare-display) (setq handles gnus-article-mime-handles)) (goto-char (point-min))