unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: use 'gnus-decoded in notmuch-mm-display-part-inline ()
@ 2012-05-20 16:58 Tomi Ollila
  2012-05-23 10:20 ` Michal Sojka
  2012-05-24  1:52 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Tomi Ollila @ 2012-05-20 16:58 UTC (permalink / raw)
  To: notmuch; +Cc: Tomi Ollila

When mail message is read from emacs, the message structure
obtained may contain parts which have content included
(`text/plain` for example) and other parts where content is not
included (`text/html` for example).

In case content is included, the string is already available in
emacs' internal format and therefore mm-... functions should not
attempt to do further decoding for the data in temp buffer
provided for it.

Currently when reply buffer is created,
notmuch-mm-display-part-inline () is used to provided quoted reply
content. This change makes the mm-... functions called by it use
'gnus-decoded as charset whenever the content is already available.

File .../emacs-23.3/lisp/gnus/mm-uu.el mentions:
"`gnus-decoded' is a fake charset, which means no further decoding."
---

I propose this patch is taken into 0.13.1.

Please note that I'm not entirely sure my description above
is right. So those who knows more of these issues please check
my "facts".

Note that before this change the only reference to word 'gnus' in
the whole notmuch repository is:
./emacs/notmuch-wash.el:223:  ;; `gnus-art.el'.

if anybody thinks this matters...

 emacs/notmuch-lib.el |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 7fa441a..e99b48d 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -244,7 +244,12 @@ the given type."
 current buffer, if possible."
   (let ((display-buffer (current-buffer)))
     (with-temp-buffer
-      (let* ((charset (plist-get part :content-charset))
+      ;; In case there is :content, the content string is already converted
+      ;; into emacs internal format. `gnus-decoded' is a fake charset,
+      ;; which means no further decoding (to be done by mm- functions).
+      (let* ((charset (if (plist-member part :content)
+			  'gnus-decoded
+			(plist-get part :content-charset)))
 	     (handle (mm-make-handle (current-buffer) `(,content-type (charset . ,charset)))))
 	;; If the user wants the part inlined, insert the content and
 	;; test whether we are able to inline it (which includes both
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-24  1:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-20 16:58 [PATCH] emacs: use 'gnus-decoded in notmuch-mm-display-part-inline () Tomi Ollila
2012-05-23 10:20 ` Michal Sojka
2012-05-24  1:52 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).