Re: [PATCH] notmuch/emacs: Observe the charset of encoded parts, where known.
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Thu, 12 Jan 2012 14:17:44 +0000 (18:17 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:57 +0000 (09:41 -0800)
88/e7301a9d37f88b45b587d459c04c228dd1947b [new file with mode: 0644]

diff --git a/88/e7301a9d37f88b45b587d459c04c228dd1947b b/88/e7301a9d37f88b45b587d459c04c228dd1947b
new file mode 100644 (file)
index 0000000..a846b65
--- /dev/null
@@ -0,0 +1,137 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 31D9F429E25\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 06:18:40 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.7\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.7 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id yPXqemVr53vO for <notmuch@notmuchmail.org>;\r
+       Thu, 12 Jan 2012 06:18:39 -0800 (PST)\r
+Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com\r
+       [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 5F78E431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 06:18:39 -0800 (PST)\r
+Received: by eaah10 with SMTP id h10so897202eaa.26\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 06:18:36 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=YRQK9yAiu4M9ghPjdStmf04+nTu7CZ3LML8qQk5Pj60=;\r
+       b=qzAXDwkP/1idbQHt4y2EoQ6MmB1r7yx8BU578J8jRx7gwLqt8tRQCxbRF/k+tbcos1\r
+       IxbgDyCrulNkQlfylocTbi8hFtlotrlSaSVKFbxmb+rnbf5XfDdITuN8l9DPRbTcfkEY\r
+       aqSM8Y5qJpUBULATuwIsjNZYxdhs9XXxMc1NY=\r
+Received: by 10.205.127.14 with SMTP id gy14mr1138058bkc.103.1326377916481;\r
+       Thu, 12 Jan 2012 06:18:36 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id t23sm10993060bkv.10.2012.01.12.06.18.35\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 12 Jan 2012 06:18:35 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] notmuch/emacs: Observe the charset of encoded parts,\r
+       where known.\r
+In-Reply-To: <cun8vldm8q9.fsf@hotblack-desiato.hh.sledj.net>\r
+References: <1326279001-28427-1-git-send-email-dme@dme.org>\r
+       <87k44ym6ka.fsf@gmail.com>\r
+       <cun8vldm8q9.fsf@hotblack-desiato.hh.sledj.net>\r
+User-Agent: Notmuch/0.10.2+135~gb811a3c (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Thu, 12 Jan 2012 18:17:44 +0400\r
+Message-ID: <878vldgg3b.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 12 Jan 2012 14:18:40 -0000\r
+\r
+Hi David.\r
+\r
+On Thu, 12 Jan 2012 12:00:14 +0000, David Edmondson <dme@dme.org> wrote:\r
+> On Wed, 11 Jan 2012 22:34:45 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
+> > -1\r
+> \r
+> Which puts me back to 0 :-(\r
+> \r
+> > One particular issue with your patch is that it adds (incorrect) charset\r
+> > parameter to plain/text parts which are converted to UTF-8 in JSON\r
+> > output.\r
+> \r
+> Patches that break things should obviously not be accepted...\r
+> \r
+> > I already tried to solve the above problem using a more general approach\r
+> > (output all content-type parameters, not just charset) [1].  There was a\r
+> > lengthy discussion on IRC about it and it was rejected.  The consensus\r
+> > was that we need to make some more substantial changes to JSON and raw\r
+> > output formats to properly fix the issue (and the issue is more general\r
+> > than what this patch fixes, other content-type parameters are useful for\r
+> > renderers as well and should be included in the output).\r
+> \r
+> ...but a useful point fix should not be blocked by theoretical future\r
+> work.\r
+> \r
+\r
+I think there is a record of useful features and fixes that were not\r
+accepted to notmuch because of some implementation issues.  And\r
+interested people were using them in private repos for years.  (I do not\r
+say that it is always the right thing to do, or that it is the right\r
+thing in this particular case.)\r
+\r
+> > I am planning to work on a proper fix for this issue, but decided to\r
+> > postpone it until Austin's rewrite of notmuch show is complete.\r
+> \r
+> If the UTF8 text/plain part issue can be resolved, would you be happier\r
+> to accept this as an interim fix whilst we wait for the more complete\r
+> solution?\r
+> \r
+\r
+I would like to see the following changes:\r
+\r
+* Properly handle charset with parameters in Emacs UI.  Currently it is\r
+  broken by your patch in one place at least:\r
+  `notmuch-show-handlers-for' would produce incorrect results for\r
+  content-type string with parameters.  In my patch [1] I did parse the\r
+  charset at top level and then changed all usages of it accordingly.\r
+  Making `notmuch-show-handlers-for' smarter about parameters may be\r
+  sufficient, but I would like to see some more details on why adding\r
+  parameters to content-type string does not break Emacs UI code in\r
+  other places.\r
+\r
+* Add charset parameter for text/html parts only.\r
+\r
+* Use `mail-header-parse-content-type' to parse content-type instead of\r
+  contructing the list for `mm-make-handle' manually.\r
+\r
+* Add a proper XXX comment to notmuch-show code.\r
+\r
+I cannot say I would be happy about this patch after these changes.  It\r
+would be a temporary hack anyway.  But I would withdraw my -1 and let\r
+others decide.  I would like to see Jameson and Austin input on this\r
+one.\r
+\r
+Regards,\r
+  Dmitry\r
+\r
+[1] id:"1321659905-24367-1-git-send-email-dmitry.kurochkin@gmail.com"\r
+\r
+> Nothing in the patch (so far) should make your proposed changes any\r
+> harder, so I'm not sure what the problem would be.\r