X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mime-w3.el;h=168870e1e2dfaa7758c8ceaa18f4f3d3c5d841c6;hb=93452613f785fcbf39de30c806711d718b284d41;hp=6d311762912b7dc2d9eb46df1340eb1b0718e2fd;hpb=223eadfd8bc22c1351a6a9fe8a5b281bd8f61616;p=elisp%2Fsemi.git diff --git a/mime-w3.el b/mime-w3.el index 6d31176..168870e 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). @@ -19,12 +19,14 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: -(require 'w3) +(condition-case nil + (require 'w3) + (error nil)) (require 'mime) (defmacro mime-put-keymap-region (start end keymap) @@ -39,8 +41,7 @@ `(let ((color (color-name (face-background 'default)))) (prog1 (progn ,@body) - (font-set-face-background 'default color (current-buffer)) - )) + (font-set-face-background 'default color (current-buffer)))) (cons 'progn body))) (defvar mime-w3-message-structure nil) @@ -58,22 +59,28 @@ (run-hooks 'mime-text-decode-hook) (condition-case err (w3-region p (point-max)) - (error (message (format "%s" err)))) - (mime-put-keymap-region p (point-max) w3-mode-map) - )))) + (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