From a6afa4ab395cfa19237f26b91deb2d60c24a54c1 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 7 May 2004 07:58:21 +0000 Subject: [PATCH] Synch to No Gnus 200405070736. --- lisp/ChangeLog | 9 +++++++++ lisp/lpath.el | 5 ++--- lisp/mm-view.el | 50 ++++++++++++++++++++++++-------------------------- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e758535..cc003e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2004-05-07 TSUCHIYA Masatoshi + + * mm-view.el (mm-inline-text-html-render-with-w3): Check META + tags, only when charsets are not specified in headers. + (mm-inline-text-html-render-with-w3m): Ditto. + + * lpath.el: Remove `w3m-meta-content-type-charset-regexp' and + `w3m-charset-to-coding-system'. Add `w3m-detect-meta-charset'. + 2004-05-06 TSUCHIYA Masatoshi * gnus-art.el (article-strip-banner): Use MIME-encoded from fields diff --git a/lisp/lpath.el b/lisp/lpath.el index 920e1e3..9c188ca 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -20,7 +20,7 @@ tool-bar-add-item-from-menu tool-bar-local-item-from-menu url-generic-parse-url url-http-file-exists-p url-insert-file-contents vcard-pretty-print w32-focus-frame - w3m-charset-to-coding-system w3m-region x-focus-frame)) + w3m-detect-meta-charset w3m-region x-focus-frame)) (maybe-bind '(eudc-protocol filladapt-mode mc-pgp-always-sign rmail-insert-mime-forwarded-message-function url-current-object @@ -28,8 +28,7 @@ w3-meta-charset-content-type-regexp w3-meta-content-type-charset-regexp w3m-cid-retrieve-function-alist w3m-current-buffer - w3m-display-inline-images w3m-meta-content-type-charset-regexp - w3m-minor-mode-map)) + w3m-display-inline-images w3m-minor-mode-map)) (if (featurep 'xemacs) (progn diff --git a/lisp/mm-view.el b/lisp/mm-view.el index 4bced35..bbc52c2 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -129,26 +129,26 @@ (charset (mail-content-type-get (mm-handle-type handle) 'charset))) (save-excursion - (insert text) + (insert (if charset (mm-decode-string text charset) text)) (save-restriction (narrow-to-region b (point)) - (goto-char (point-min)) - (if (or (and (boundp 'w3-meta-content-type-charset-regexp) - (re-search-forward - w3-meta-content-type-charset-regexp nil t)) - (and (boundp 'w3-meta-charset-content-type-regexp) - (re-search-forward - w3-meta-charset-content-type-regexp nil t))) + (unless charset + (goto-char (point-min)) + (when (or (and (boundp 'w3-meta-content-type-charset-regexp) + (re-search-forward + w3-meta-content-type-charset-regexp nil t)) + (and (boundp 'w3-meta-charset-content-type-regexp) + (re-search-forward + w3-meta-charset-content-type-regexp nil t))) (setq charset - (or (let ((bsubstr (buffer-substring-no-properties - (match-beginning 2) - (match-end 2)))) - (if (fboundp 'w3-coding-system-for-mime-charset) - (w3-coding-system-for-mime-charset bsubstr) - (mm-charset-to-coding-system bsubstr))) - charset))) - (delete-region (point-min) (point-max)) - (insert (mm-decode-string text charset)) + (let ((bsubstr (buffer-substring-no-properties + (match-beginning 2) + (match-end 2)))) + (if (fboundp 'w3-coding-system-for-mime-charset) + (w3-coding-system-for-mime-charset bsubstr) + (mm-charset-to-coding-system bsubstr)))) + (delete-region (point-min) (point-max)) + (insert (mm-decode-string text charset)))) (save-window-excursion (save-restriction (let ((w3-strict-width width) @@ -224,19 +224,17 @@ (b (point)) (charset (mail-content-type-get (mm-handle-type handle) 'charset))) (save-excursion - (insert text) + (insert (if charset (mm-decode-string text charset) text)) (save-restriction (narrow-to-region b (point)) - (goto-char (point-min)) - (when (re-search-forward w3m-meta-content-type-charset-regexp nil t) - (setq charset (or (w3m-charset-to-coding-system (match-string 2)) - charset))) - (when charset - (delete-region (point-min) (point-max)) - (insert (mm-decode-string text charset))) + (unless charset + (goto-char (point-min)) + (when (setq charset (w3m-detect-meta-charset)) + (delete-region (point-min) (point-max)) + (insert (mm-decode-string text charset)))) (let ((w3m-safe-url-regexp mm-w3m-safe-url-regexp) w3m-force-redisplay) - (w3m-region (point-min) (point-max))) + (w3m-region (point-min) (point-max) nil charset)) (when (and mm-inline-text-html-with-w3m-keymap (boundp 'w3m-minor-mode-map) w3m-minor-mode-map) -- 1.7.10.4