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 2F860431FB6 for ; Thu, 14 Feb 2013 16:12:51 -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 BFro18UKLlLg for ; Thu, 14 Feb 2013 16:12:50 -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 5EC0C431FAF for ; Thu, 14 Feb 2013 16:12:50 -0800 (PST) Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id A68FE20753; Thu, 14 Feb 2013 19:12:49 -0500 (EST) Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 14 Feb 2013 19:12:49 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=8t8.us; h=date :from:to:cc:subject:message-id:mime-version:content-type; s= mesmtp; bh=z4krmFngub0z2y+RfJYc019metg=; b=R+jA9aL/o0LrAI2kAGfAo h6hG7+7j/RK8jHpMZyPHctiL2muV9IO9OlSAmgP3FlvxrXgDvhvTnjMkdMBLpfBv 7iIGoek9V9+pZ5SeU5TchNdKP1MfFMT0q6KM022CzR5iPVRHcesZi93weNHG/HZU mY3FFWlpr5RyLXECPLLh3M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :mime-version:content-type; s=smtpout; bh=z4krmFngub0z2y+RfJYc01 9metg=; b=ES3wnLrmUitIOB+5Tp0N5Q1HP0Qy45HcR1qMXnBj46qxf9kiTo33lF QM11ywvinNl4vt7JD2g/AwNkzf8uDmWqZ39gr0SHXHwQLOHexBtbpCq8wA6BRj0x d7V6aTnWuge5eD1gmBiBbEcOhPX3SRWMbssUBB6uHW5ltRv6gBthI= X-Sasl-enc: qleg49sPxbSfUNkAPA+G5rw74ZNzhGrJmC41oGWJ683y 1360887169 Received: from localhost (unknown [75.170.32.230]) by mail.messagingengine.com (Postfix) with ESMTPA id 0282E8E01F3; Thu, 14 Feb 2013 19:12:48 -0500 (EST) Date: Thu, 14 Feb 2013 16:12:47 -0800 From: "Kevin J. McCarthy" To: notmuch@notmuchmail.org Subject: [PATCH] notmuch-mutt: improve robustness of mutt macros Message-ID: <20130215001247.GB3247@zaogao.lan> Mail-Followup-To: notmuch@notmuchmail.org, Stefano Zacchiroli MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NMuMz9nt05w80d4+" Content-Disposition: inline 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: Fri, 15 Feb 2013 00:12:51 -0000 --NMuMz9nt05w80d4+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Details: - $pipe_decode is turned off, to prevent message-id from being filtered out by "ignore" settings in the muttrc. - Original values for $pipe_decode and $wait_key are saved and restored. - The macros, being much longer now, are line wrapped for improved readability. --- This patch would be in addition to the one sent by Stefano in id:20130214083713.GA4123@upsilon.cc His patch improves notmuch-mutt itself. This patch improves the macros to invoke notmuch-mutt. contrib/notmuch-mutt/notmuch-mutt | 16 +++++++++++++--- contrib/notmuch-mutt/notmuch-mutt.rc | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmu= ch-mutt index bc97908..00c5ef8 100755 --- a/contrib/notmuch-mutt/notmuch-mutt +++ b/contrib/notmuch-mutt/notmuch-mutt @@ -270,13 +270,23 @@ the following in your Mutt configuration (usually one= of: F<~/.muttrc>, F, or a configuration snippet under F): =20 macro index \ - "unset wait_keynotmuch-mutt = -r --prompt search~/.cache/notmuch/mutt/resu= lts" \ + "set my_old_pipe_decode=3D\$pipe_decode my_old_wait_key= =3D\$wait_key nopipe_decode nowait_key\ + notmuch-mutt -r --prompt search\ + `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: search mail" + macro index \ - "unset wait_keynotmuch-mutt = -r thread~/.cache/notmuch/mutt/resultsset wait_key" \ + "set my_old_pipe_decode=3D\$pipe_decode my_old_wait_key= =3D\$wait_key nopipe_decode nowait_key\ + notmuch-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 \ - "unset wait_keynotmuch-mutt = tag -- -inbox" \ + "set my_old_pipe_decode=3D\$pipe_decode my_old_wait_key= =3D\$wait_key nopipe_decode nowait_key\ + notmuch-mutt tag -- -inbox\ + set pipe_decode=3D\$my_old_pipe_decode wait_key=3D\$my_= old_wait_key" \ "notmuch: remove message from inbox" =20 The first macro (activated by ) prompts the user for notmuch search te= rms diff --git a/contrib/notmuch-mutt/notmuch-mutt.rc b/contrib/notmuch-mutt/no= tmuch-mutt.rc index ddc4b48..6b299dc 100644 --- a/contrib/notmuch-mutt/notmuch-mutt.rc +++ b/contrib/notmuch-mutt/notmuch-mutt.rc @@ -1,9 +1,19 @@ macro index \ - "unset wait_keynotmuch-mutt -r -= -prompt search`echo ${XDG_CACHE_HOME:-$HOME/= =2Ecache}/notmuch/mutt/results`" \ +"set my_old_pipe_decode=3D\$pipe_decode my_old_wait_key=3D\= $wait_key nopipe_decode nowait_key\ +notmuch-mutt -r --prompt search\ +`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: search mail" + macro index \ - "unset wait_keynotmuch-mutt -r t= hread`echo ${XDG_CACHE_HOME:-$HOME/.cache}/n= otmuch/mutt/results`set wait_key" \ +"set my_old_pipe_decode=3D\$pipe_decode my_old_wait_key=3D\= $wait_key nopipe_decode nowait_key\ +notmuch-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 \ - "unset wait_keynotmuch-mutt tag = -- -inbox" \ +"set my_old_pipe_decode=3D\$pipe_decode my_old_wait_key=3D\= $wait_key nopipe_decode nowait_key\ +notmuch-mutt tag -- -inbox\ +set pipe_decode=3D\$my_old_pipe_decode wait_key=3D\$my_old_= wait_key" \ "notmuch: remove message from inbox" --=20 1.7.10.4 --NMuMz9nt05w80d4+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBCAAGBQJRHX1/AAoJELaxzZYTaZ+4hN0H/24VkdDDfzyS90jDQQOcRg2j XfQ0jqx3vEFZxqp9RF9ISSc519wttNyNLvhFE6gppuFWj4d4VGhupwP+YMzYQD7z a+FQH2WNasiFzj1llNZ53GHwGarSIqWZYK565dAgedBfKQzil0Px9F2EhwuunkvZ CsW6aZePfEDZQYqKlf2nZT+GW3uR+c142TgNu6s0MLW+zxf7ALQmtJgv42G1kYAS YF+EcVfMPW+TfKG+XpKaqhTQoUa37jAj5bnuTAaNf9PI4Ci80y/VVKoFkRwL55HC 1iLdl4fI7qQTWzTzFKdyAaLLQYq2SG9/VJgBAq+qqkF3ICpFcZBYGTsrlMl+dCw= =+1EW -----END PGP SIGNATURE----- --NMuMz9nt05w80d4+--