changeset 87099:90b29ef76212

Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-944
author Miles Bader <miles@gnu.org>
date Thu, 06 Dec 2007 00:46:32 +0000
parents ec0ef12211d9
children 188e26a999b0
files lisp/gnus/ChangeLog lisp/gnus/gnus-art.el
diffstat 2 files changed, 62 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Thu Dec 06 00:46:18 2007 +0000
+++ b/lisp/gnus/ChangeLog	Thu Dec 06 00:46:32 2007 +0000
@@ -1,3 +1,34 @@
+2007-12-05  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (gnus-use-idna)
+	* gnus-start.el (gnus-site-init-file)
+	* message.el (message-use-idna)
+	* mm-uu.el (mm-uu-hide-markers)
+	* smiley.el (smiley-style): Revert changes that suppress warnings.
+
+2007-12-05  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (gnus-article-browse-html-parts): Add meta html tag to
+	specify charset to html source.  Reported by Christoph Conrad
+	<christoph.conrad@gmx.de>.
+
+2007-12-05  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (gnus-use-idna): Don't directly refer to the value of
+	idna-program in order to suppress byte compile warning issued by XEmacs
+	that came to byte compile the default value section of defcustom forms
+	recently.
+
+	* gnus-start.el (gnus-site-init-file): Don't directly refer to the
+	value of installation-directory.
+
+	* message.el (message-use-idna): Don't directly refer to the value of
+	idna-program.
+
+	* mm-uu.el (mm-uu-hide-markers): Don't directly call defined-colors.
+
+	* smiley.el (smiley-style): Don't directly call face-attribute.
+
 2007-12-04  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* gnus-group.el (gnus-group-highlight-line): Add FIXME.
--- a/lisp/gnus/gnus-art.el	Thu Dec 06 00:46:18 2007 +0000
+++ b/lisp/gnus/gnus-art.el	Thu Dec 06 00:46:32 2007 +0000
@@ -2802,8 +2802,37 @@
 		    (string-match "text/html" (car (mm-handle-type handle))))
 	       (let ((tmp-file (mm-make-temp-file
 				;; Do we need to care for 8.3 filenames?
-				"mm-" nil ".html")))
-		 (mm-save-part-to-file handle tmp-file)
+				"mm-" nil ".html"))
+		     (charset (mail-content-type-get (mm-handle-type handle)
+						     'charset)))
+		 (if charset
+		     ;; Add a meta html tag to specify charset.
+		     (mm-with-unibyte-buffer
+		       (insert (with-current-buffer (mm-handle-buffer handle)
+				 (if (eq charset 'gnus-decoded)
+				     (mm-encode-coding-string
+				      (buffer-string)
+				      (setq charset 'utf-8))
+				   (buffer-string))))
+		       (setq charset (format "\
+<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">"
+					     charset))
+		       (goto-char (point-min))
+		       (let ((case-fold-search t))
+			 (cond (;; Don't modify existing meta tag.
+				(re-search-forward "\
+<meta[\t\n\r ]+http-equiv=\"content-type\"[^>]+>"
+						   nil t))
+			       ((re-search-forward "<head>[\t\n\r ]*" nil t)
+				(insert charset "\n"))
+			       (t
+				(re-search-forward "\
+<html\\(?:[\t\n\r ]+[^>]+\\|[\t\n\r ]*\\)>[\t\n\r ]*"
+						   nil t)
+				(insert "<head>\n" charset "\n</head>\n"))))
+		       (mm-write-region (point-min) (point-max)
+					tmp-file nil nil nil 'binary t))
+		   (mm-save-part-to-file handle tmp-file))
 		 (add-to-list 'gnus-article-browse-html-temp-list tmp-file)
 		 (add-hook 'gnus-summary-prepare-exit-hook
 			   'gnus-article-browse-delete-temp-files)