From cd975210f464c01faf93ae5d7f53d157482422c9 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Sun, 20 May 2012 19:58:14 +0300 Subject: [PATCH] [PATCH] emacs: use 'gnus-decoded in notmuch-mm-display-part-inline () --- 48/6de0950d907026b4c1d24c24a870db2d0862b1 | 97 +++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 48/6de0950d907026b4c1d24c24a870db2d0862b1 diff --git a/48/6de0950d907026b4c1d24c24a870db2d0862b1 b/48/6de0950d907026b4c1d24c24a870db2d0862b1 new file mode 100644 index 000000000..4eed9dbe7 --- /dev/null +++ b/48/6de0950d907026b4c1d24c24a870db2d0862b1 @@ -0,0 +1,97 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 56609431FB6 + for ; Sun, 20 May 2012 09:58:07 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id YJ5d1CvO+SXW for ; + Sun, 20 May 2012 09:58:06 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 25B5A431FAE + for ; Sun, 20 May 2012 09:58:05 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 77F9710064B; Sun, 20 May 2012 19:58:16 +0300 (EEST) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: use 'gnus-decoded in notmuch-mm-display-part-inline () +Date: Sun, 20 May 2012 19:58:14 +0300 +Message-Id: <1337533094-5467-1-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 1.7.1 +Cc: Tomi Ollila +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 20 May 2012 16:58:07 -0000 + +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 + -- 2.26.2