Gnus development mailing list
 help / color / mirror / Atom feed
From: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
Subject: decode text/* parts before displaying them
Date: Thu, 07 Oct 2004 14:41:41 +0000	[thread overview]
Message-ID: <87ekkavbdm.fsf@namazu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]

Hi,

The following attached part is not displayed with current Gnus.


[-- Attachment #2: eucjp.tex --]
[-- Type: text/x-tex, Size: 122 bytes --]

\documentclass{jarticle}
\begin{document}
Can you read these characters?
\end{document}

[-- Attachment #3: Type: text/plain, Size: 552 bytes --]


In order to avoid this problem, I have just installed the following
change:

    2004-10-07  TSUCHIYA Masatoshi  <tsuchiya@namazu.org>

        * gnus-art.el (gnus-mime-display-single): Call `mm-display-inline'
        instead of calling `mm-insert-inline', to decode text/* parts
        before displaying them.

I, however, worry whether this change is appropriate or not, because
there are several choices to fix this problem.  The first choice is my
proposal.  The second choice is to call `mm-inline-text' instead of
calling `mm-insert-inline'.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: Type: text/x-patch, Size: 360 bytes --]

--- gnus-art.el	6 Oct 2004 07:48:57 -0000	7.55
+++ gnus-art.el	7 Oct 2004 14:05:35 -0000
@@ -4709,7 +4709,7 @@
 	      (forward-line -1)
 	      (setq beg (point)))
 	    (gnus-article-insert-newline)
-	    (mm-insert-inline handle (mm-get-part handle))
+	    (mm-inline-text handle)
 	    (goto-char (point-max))))
 	  ;; Do highlighting.
 	  (save-excursion

[-- Attachment #5: Type: text/plain, Size: 81 bytes --]


The last choice is to decode a part content before calling
`mm-insert-inline'.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: Type: text/x-patch, Size: 602 bytes --]

--- gnus-art.el	6 Oct 2004 07:48:57 -0000	7.55
+++ gnus-art.el	7 Oct 2004 14:07:34 -0000
@@ -4709,7 +4709,14 @@
 	      (forward-line -1)
 	      (setq beg (point)))
 	    (gnus-article-insert-newline)
-	    (mm-insert-inline handle (mm-get-part handle))
+	    (mm-insert-inline handle
+			      (let ((charset
+				     (mail-content-type-get
+				      (mm-handle-type handle) 'charset)))
+				(if (eq charset 'gnus-decoded)
+				    (mm-get-part handle)
+				  (mm-decode-string (mm-get-part handle)
+						    charset))))
 	    (goto-char (point-max))))
 	  ;; Do highlighting.
 	  (save-excursion

[-- Attachment #7: Type: text/plain, Size: 65 bytes --]


Could you tell me which choice is best?

-- 
TSUCHIYA Masatoshi

                 reply	other threads:[~2004-10-07 14:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ekkavbdm.fsf@namazu.org \
    --to=tsuchiya@namazu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).