From 2f8a4dde7d00c91452db90e411c4bd8d9c457d3d Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 28 Jan 2002 02:06:04 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 26 +++++++++++++++++++++----- lisp/gnus-art.el | 3 ++- lisp/lpath.el | 1 + lisp/mm-view.el | 17 ++++++++++++++++- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dcca939..9d41240 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,10 +1,26 @@ +2002-01-28 Katsumi Yamaoka + + * lpath.el: Bind `w3m-cid-retrieve-function-alist' and + `w3m-current-buffer'. + +2002-01-27 TSUCHIYA Masatoshi + + * gnus-art.el (gnus-article-wash-html-with-w3m): Handle cid: URLs. + + * mm-view.el (mm-setup-w3m): Add `mm-w3m-cid-retrieve' to + `w3m-cid-retrieve-function-alist' for `gnus-article-mode'. + (mm-w3m-cid-retrieve): New function. + (mm-inline-text-html-render-with-w3m): Handle cid: URLs. + + * lpath.el: Bind `w3m-cid-retrieve-function-alist'. + 2002-01-27 ShengHuo ZHU * gnus-agent.el (gnus-agent-fetch-articles): Don't save empty articles. 2002-01-27 Lars Magne Ingebrigtsen - * gnus-util.el (gnus-cache-file-contents): Don't use equalp. + * gnus-util.el (gnus-cache-file-contents): Don't use equalp. 2002-01-26 Lars Magne Ingebrigtsen @@ -41,24 +57,24 @@ 2002-01-26 Lars Magne Ingebrigtsen * gnus-agent.el (gnus-agent-load-alist): Use new caching - function. + function. * gnus-util.el (gnus-cache-file-contents): New function. * gnus-agent.el (gnus-agent-file-loading-cache): New variable. (gnus-agent-load-alist): Use it. - * nnagent.el (nnagent-retrieve-headers): Use optimized function. + * nnagent.el (nnagent-retrieve-headers): Use optimized function. * nnheader.el (nnheader-insert-nov-file): New function. - * gnus-util.el (gnus-parse-without-error): Correct the loop. + * gnus-util.el (gnus-parse-without-error): Correct the loop. * gnus-sum.el (gnus-dependencies-add-header): Use in-reply-to if there are no references. (gnus-extract-message-id-from-in-reply-to): New function. (gnus-nov-parse-line): Use in-reply-to if there are no - references. + references. 2002-01-25 Lars Magne Ingebrigtsen diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index d162fa4..a1ae05c 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2292,7 +2292,8 @@ If READ-CHARSET, ask for a coding system." (defun gnus-article-wash-html-with-w3m () "Wash the current buffer with w3m." (mm-setup-w3m) - (w3m-region (point) (point-max)) + (let ((w3m-safe-url-regexp "\\`cid:")) + (w3m-region (point) (point-max))) (setq mm-w3m-minor-mode t)) (defun article-hide-list-identifiers () diff --git a/lisp/lpath.el b/lisp/lpath.el index 42622d0..ea9333e 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -58,6 +58,7 @@ rmail-enable-mime-composing rmail-insert-mime-forwarded-message-function w3-meta-content-type-charset-regexp + w3m-cid-retrieve-function-alist w3m-current-buffer w3m-meta-content-type-charset-regexp w3m-mode-map)) (if (featurep 'xemacs) diff --git a/lisp/mm-view.el b/lisp/mm-view.el index ac94e4a..cfc55ff 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -159,9 +159,23 @@ (defun mm-setup-w3m () (unless mm-w3m-setup (require 'w3m) + (unless (assq 'gnus-article-mode w3m-cid-retrieve-function-alist) + (push (cons 'gnus-article-mode 'mm-w3m-cid-retrieve) + w3m-cid-retrieve-function-alist)) (gnus-add-minor-mode 'mm-w3m-minor-mode " w3m" w3m-mode-map) (setq mm-w3m-setup t))) +(defun mm-w3m-cid-retrieve (url &rest args) + (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))))))) + (defun mm-inline-text-html-render-with-w3m (handle) (mm-setup-w3m) (let ((text (mm-get-part handle)) @@ -178,7 +192,8 @@ (when charset (delete-region (point-min) (point-max)) (insert (mm-decode-string text charset))) - (w3m-region (point-min) (point-max)) + (let ((w3m-safe-url-regexp "\\`cid:")) + (w3m-region (point-min) (point-max))) (setq mm-w3m-minor-mode t)) (mm-handle-set-undisplayer handle -- 1.7.10.4