X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mime-w3.el;h=32558c0f39a8482a7d0cb94ab530eedb0818461d;hb=1e28d7c2ec749121b7f9434232b7a936a8de3fe6;hp=6ce9927fbdb8cb8d8552c97f1c4193a7106cf6f6;hpb=d1f3df186339f3d2b91050fb1f079590c8fc30d3;p=elisp%2Fsemi.git diff --git a/mime-w3.el b/mime-w3.el index 6ce9927..32558c0 100644 --- a/mime-w3.el +++ b/mime-w3.el @@ -1,8 +1,8 @@ ;;; mime-w3.el --- mime-view content filter for text -;; Copyright (C) 1994,1995,1996,1997,1998,1999 Free Software Foundation, Inc. +;; Copyright (C) 1994,95,96,97,98,99,2000 Free Software Foundation, Inc. -;; Author: MORIOKA Tomohiko +;; Author: MORIOKA Tomohiko ;; Keywords: HTML, MIME, multimedia, mail, news ;; This file is part of SEMI (Suite of Emacs MIME Interfaces). @@ -24,7 +24,9 @@ ;;; Code: -(require 'w3) +(condition-case nil + (require 'w3) + (error nil)) (require 'mime) (defmacro mime-put-keymap-region (start end keymap) @@ -46,9 +48,7 @@ (defvar mime-w3-message-structure nil) (defun mime-preview-text/html (entity situation) - (setq mime-w3-message-structure - (with-current-buffer (mime-entity-buffer entity) - mime-message-structure)) + (setq mime-w3-message-structure (mime-find-root-entity entity)) (goto-char (point-max)) (let ((p (point))) (insert "\n") @@ -60,22 +60,29 @@ (run-hooks 'mime-text-decode-hook) (condition-case err (w3-region p (point-max)) - (error (message (format "%s" err)))) + (error (message "%s" err))) (mime-put-keymap-region p (point-max) w3-mode-map) )))) (defun url-cid (url &optional proxy-info) (let ((entity (mime-find-entity-from-content-id (mime-uri-parse-cid url) - mime-w3-message-structure))) + mime-w3-message-structure)) + buffer) (when entity - (mime-insert-entity-content entity) - (setq url-current-mime-type (mime-entity-type/subtype entity)) - ))) - -(url-register-protocol "cid" - 'url-cid - 'url-identity-expander) + (setq buffer (generate-new-buffer (format " *cid %s" url))) + (save-excursion + (set-buffer buffer) + (mime-insert-entity-content entity) + (if (boundp 'url-current-mime-type) + (setq url-current-mime-type (mime-entity-type/subtype entity))))) + buffer)) + +(if (fboundp 'url-register-protocol) + (url-register-protocol "cid" + 'url-cid + 'url-identity-expander) + (provide 'url-cid)) ;;; @ end