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