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

diff --git a/68/176e663411af797de19bf12328eab9c93fff3b b/68/176e663411af797de19bf12328eab9c93fff3b
new file mode 100644 (file)
index 0000000..cbe971a
--- /dev/null
@@ -0,0 +1,136 @@
+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 DE210429E25\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 06:54:38 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 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, RCVD_IN_DNSWL_LOW=-0.7] 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 YWl2oFtV5Qi1 for <notmuch@notmuchmail.org>;\r
+       Thu, 12 Jan 2012 06:54:38 -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 09886431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 06:54:37 -0800 (PST)\r
+Received: by eaah10 with SMTP id h10so915298eaa.26\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 06:54: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=3wqTYL7Yy3Fe3pFtEi5D9l0FCdpxBXmJJaZNFoICtsc=;\r
+       b=M8cRppF19WkpN04gLSSG6hcSD85pjbEVS2dxRu16P9YuESlOrAAh14AeQZ3sy4aV3X\r
+       y/1jRiLGio7/OMXHhH5eekhKrlHVgamPoaN7JHdVoL7oVmdHxFx2p5CRcJZag4LZOfrn\r
+       DPGcRnRt8oi4cEhbSZltfWb/hNHw4ACvNFkg4=\r
+Received: by 10.204.153.199 with SMTP id l7mr1267642bkw.88.1326380076704;\r
+       Thu, 12 Jan 2012 06:54:36 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id b9sm11206888bks.6.2012.01.12.06.54.35\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 12 Jan 2012 06:54:36 -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: <cunr4z5kmmu.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
+       <878vldgg3b.fsf@gmail.com>\r
+       <cunr4z5kmmu.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:53:45 +0400\r
+Message-ID: <8762ghgefa.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:54:39 -0000\r
+\r
+On Thu, 12 Jan 2012 14:42:49 +0000, David Edmondson <dme@dme.org> wrote:\r
+> On Thu, 12 Jan 2012 18:17:44 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\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 agree that this has happened. I think that it's a failure of the\r
+> project that it has become common, necessary and generally accepted.\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
+> Your patch modifies the output of 'notmuch show' such that it included\r
+> the full value of the content-type header, which means that it is\r
+> necessary to parse it more carefully in emacs to discover and (as\r
+> necessary) remove the parameters. The patch I posted doesn't do this,\r
+> preferring to pass the charset (if any) as a supplementary parameter and\r
+> leave the content-type as-is. This distinction means that the patch I\r
+> posted isn't broken in the way that you describe.\r
+> \r
+\r
+Sorry, I should have better look at the code.\r
+\r
+> > * Add charset parameter for text/html parts only.\r
+> \r
+> Version 2 of the patch does this.\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
+> That's not required, see above.\r
+> \r
+> > * Add a proper XXX comment to notmuch-show code.\r
+> \r
+> I'm happy to do that.\r
+> \r
+> > I cannot say I would be happy about this patch after these changes.\r
+> \r
+> Can you say why? I agree that it is not a solution to all problems, but\r
+> it is a workable solution to a specific problem.\r
+> \r
+\r
+At the very least, because I did not really review the code, as you\r
+probably understood from my poor comments :)\r
+\r
+I do not have a strong preference here.  If others do, I prefer to leave\r
+it for them to decide.\r
+\r
+> > It would be a temporary hack anyway.\r
+> \r
+> Agreed. Do you have any idea when you might be able to spend time on the\r
+> better approach?\r
+\r
+I hope to work on this once Austin's notmuch show rewrite is done.  It\r
+is progressing, but I do not have any estimations.\r
+\r
+Regards,\r
+  Dmitry\r