Re: notmuch-mutt: Use of uninitialized value.
authorKevin J. McCarthy <kevin@8t8.us>
Thu, 14 Feb 2013 23:06:51 +0000 (15:06 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:38 +0000 (09:53 -0800)
31/789b246b98efad699291f0bf1ddc88beff8960 [new file with mode: 0644]

diff --git a/31/789b246b98efad699291f0bf1ddc88beff8960 b/31/789b246b98efad699291f0bf1ddc88beff8960
new file mode 100644 (file)
index 0000000..a2157ab
--- /dev/null
@@ -0,0 +1,154 @@
+Return-Path: <keevan@fastmail.fm>\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 3C863431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 14 Feb 2013 15:06:55 -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 YXVmReWQUMgH for <notmuch@notmuchmail.org>;\r
+       Thu, 14 Feb 2013 15:06:54 -0800 (PST)\r
+Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com\r
+       [66.111.4.25])\r
+       (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 66FD2431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 14 Feb 2013 15:06:54 -0800 (PST)\r
+Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43])\r
+       by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id B2CFA205D6;\r
+       Thu, 14 Feb 2013 18:06:53 -0500 (EST)\r
+Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160])\r
+       by compute3.internal (MEProxy); Thu, 14 Feb 2013 18:06:53 -0500\r
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=8t8.us; h=date\r
+       :from:to:cc:subject:message-id:references:mime-version\r
+       :content-type:in-reply-to; s=mesmtp; bh=fK/w1l2br/XFxxp/5KwcewSO\r
+       sgE=; b=oxZYaew/KsV8rweNmYuNJUvMLfi+4uffeTKhLr+HgV+IhI7MuYY8Wg2y\r
+       pcCUMoTY+NgjmvQ0jk+Ou8BbJy33xnt2G513pJ5lLIY9Xoo1GpL0HmVGFG2Uy5Lk\r
+       62Thpij2Q/5Lg4ypM+AazFpDGoh6N/0K9t3w13UEfDAD7S9TN6A=\r
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=\r
+       messagingengine.com; h=date:from:to:cc:subject:message-id\r
+       :references:mime-version:content-type:in-reply-to; s=smtpout;\r
+       bh=fK/w1l2br/XFxxp/5KwcewSOsgE=; b=pb4IuMgBDIyAqlPNdwgoxwyUwKWo\r
+       86yXE5+ehJxzqHTHJXt5AdWo/8dXx/tBfijo33eOxHVICIddTqypNaYRg7vUDwnh\r
+       tHIJdEEIDs/DRkYg2PHNgZlwrUIrgPVyyLIGQY0MfRS4KVPM3TrN0tq1SVU1AWw2\r
+       IGY9AbFYV4zHTc8=\r
+X-Sasl-enc: 9Ck/4arjEPcRf6TAVgEKxlF6iYktbw3PD87gw5itfv5m 1360883213\r
+Received: from localhost (unknown [75.170.32.230])\r
+       by mail.messagingengine.com (Postfix) with ESMTPA id 2E95A8E03E9;\r
+       Thu, 14 Feb 2013 18:06:52 -0500 (EST)\r
+Date: Thu, 14 Feb 2013 15:06:51 -0800\r
+From: "Kevin J. McCarthy" <kevin@8t8.us>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: notmuch-mutt: Use of uninitialized value.\r
+Message-ID: <20130214230651.GA3247@zaogao.lan>\r
+Mail-Followup-To: notmuch@notmuchmail.org, Stefano Zacchiroli\r
+ <zack@upsilon.cc>\r
+References: <20130212005801.GA8419@soarin> <20130213223535.GA3258@zaogao.lan>\r
+       <20130213233657.GA4489@soarin> <20130214083713.GA4123@upsilon.cc>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; micalg=pgp-sha256;\r
+       protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l"\r
+Content-Disposition: inline\r
+In-Reply-To: <20130214083713.GA4123@upsilon.cc>\r
+OpenPGP: id=B6B1CD9613699FB8;\r
+       url=http://www.8t8.us/configs/13699FB8.asc.pubkey; preference=sign\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+Cc: Stefano Zacchiroli <zack@upsilon.cc>\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, 14 Feb 2013 23:06:55 -0000\r
+\r
+\r
+--XsQoSWH+UP9D9v3l\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Stefano Zacchiroli wrote:\r
+> Right, but still a more graceful failure model would be nice.\r
+>=20\r
+> Please find attached a patch that in such cases should 1) give a\r
+> supposedly nice error message explaining what's going on and 2) empty\r
+> the results dir to avoid showing you unrelated results. It works for me.\r
+> But extra checking never hurts, in particular for the tag action, which\r
+> I don't personally use.\r
+\r
+The patch works for me (for thread reconstruction - I don't use the\r
+tagging features either).\r
+\r
+> I guess it would also be nice to actually disable $pipe_decode in the\r
+> relevant Mutt macros, but I'm not sure about to do that without\r
+> interfering with user desired configuration. Kevin: do you know if there\r
+> is a common Mutt trick to store the value of a variable before changing\r
+> it, and restoring it a posteriori?  More isolation for this kind of\r
+> things in Mutt would definitely be welcome...\r
+\r
+It looks like this is possible, as Suvayu Ali mentioned too.  An\r
+improvement to his example is also mentioned in the manual at\r
+  http://www.mutt.org/doc/devel/manual.html#set-myvar\r
+You can defer evaluation of the variables until runtime by prefixing\r
+them with \$.\r
+\r
+Here are some proposed improved macros.  (I'll attach a patch file in\r
+another email.)  Despite my earlier warning about not line-breaking\r
+macros, these are getting a bit unreadable.  We may want to see\r
+if/where we can safely line-break them.\r
+\r
+macro index <F8> \\r
+      "<enter-command>set my_old_pipe_decode=3D\$pipe_decode my_old_wait_ke=\r
+y=3D\$wait_key nopipe_decode nowait_key<enter><shell-escape>notmuch-mutt -r=\r
+ --prompt search<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOM=\r
+E/.cache}/notmuch/mutt/results`<enter><enter-command>set pipe_decode=3D\$my=\r
+_old_pipe_decode wait_key=3D\$my_old_wait_key<enter>" \\r
+      "notmuch: search mail"\r
+macro index <F9> \\r
+      "<enter-command>set my_old_pipe_decode=3D\$pipe_decode my_old_wait_ke=\r
+y=3D\$wait_key nopipe_decode nowait_key<enter><pipe-message>notmuch-mutt -r=\r
+ thread<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}=\r
+/notmuch/mutt/results`<enter><enter-command>set pipe_decode=3D\$my_old_pipe=\r
+_decode wait_key=3D\$my_old_wait_key<enter>" \\r
+      "notmuch: reconstruct thread"\r
+macro index <F6> \\r
+      "<enter-command>set my_old_pipe_decode=3D\$pipe_decode my_old_wait_ke=\r
+y=3D\$wait_key nopipe_decode nowait_key<enter><pipe-message>notmuch-mutt ta=\r
+g -- -inbox<enter><enter-command>set pipe_decode=3D\$my_old_pipe_decode wai=\r
+t_key=3D\$my_old_wait_key<enter>" \\r
+      "notmuch: remove message from inbox"\r
+\r
+-Kevin\r
+\r
+\r
+--XsQoSWH+UP9D9v3l\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: Digital signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.12 (GNU/Linux)\r
+\r
+iQEcBAEBCAAGBQJRHW4FAAoJELaxzZYTaZ+4rbEH/0wBFq9Pe4xSuXJW+Ev1htOg\r
+uz+1w1uHO0yyM6lm/c7I3I1I0t9bZsqOv3eB0cdF2D1l1AzzwdjF6PmwXQXz4//5\r
+lqdhN/1T4Zci0ToHSPjb4RfZoGXKoN6AmHhpn6wdkQ+1XsCKG19hEaCtSgdAtn2u\r
+EvCuk3CsSUZ+trxj3ik9VlQlxzfjBkjDlMJ4NhhQm+6BAJegDWURI16Vo63rQPHU\r
+m9FeNTslcGnY4a5zCnW/DpgjTCPNyfw+bCHxuXNMY5nTlUUU/BAW0lOKi+Ii8AjZ\r
+IJwNVCRJQPN0Rx784ec8eCRNjAYEi3+tpVZAWMX5n47GJBoJphWu5LbEv9/uOBM=\r
+=M3bF\r
+-----END PGP SIGNATURE-----\r
+\r
+--XsQoSWH+UP9D9v3l--\r