From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 5078E431FAF for ; Fri, 6 Sep 2013 15:15:34 -0700 (PDT) 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 F7XwbwihtDpK for ; Fri, 6 Sep 2013 15:15:30 -0700 (PDT) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 0C3B2431FAE for ; Fri, 6 Sep 2013 15:15:30 -0700 (PDT) Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 9F05A20B09; Fri, 6 Sep 2013 18:15:22 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 06 Sep 2013 18:15:22 -0400 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=N81VV1MMpBzvj+z/pvDFUWm4wKc=; b=svjk/y+RKcvthNN7M2sno E6lXbH4TqiLuinxhv20tlkaScKPfcJrUiU3+RX6nBXdRTrwa2usKKfwhQ2lm8Jyy Hkyprx9NpFl45onbnR3rEns0diB1LtD213JjtD902wbzZtVgWxK3PumOACoqa9Y+ /RKvr0vaJMfk+ZJ7lILjQ8= 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=N81VV1MMpBzvj+z/pvDFUW m4wKc=; b=Db/qAamkPu7MEhBomGe9lffMD/WcqUEaPP1c8LzSlVocO4RgbcRcVV UBVXempYZ3kLpeaQLuNvatSTV4gDDsk0jA+180Z8HwqWuR0mMDcTXtgHCvVRmHHY YZhqVict6fXsiJyaK60LTFD6bo1E2glFqT6AOuI6do4w9E31LcjyI= X-Sasl-enc: Bm/byO7589pEX8oC3HYtFB+5RMCmibKjViypJs/cB6Sq 1378505721 Received: from localhost (unknown [97.125.94.9]) by mail.messagingengine.com (Postfix) with ESMTPA id F04C2680143; Fri, 6 Sep 2013 18:15:21 -0400 (EDT) Date: Fri, 6 Sep 2013 15:15:20 -0700 From: "Kevin J. McCarthy" To: notmuch@notmuchmail.org Subject: [PATCH 1/1] notmuch-mutt: Fix tagging issues Message-ID: <20130906221520.GC4226@zaogao.lan> Mail-Followup-To: notmuch@notmuchmail.org, Stefano Zacchiroli , Jason Miller MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pQhZXvAqiZgbeUkD" 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, 06 Sep 2013 22:15:34 -0000 --pQhZXvAqiZgbeUkD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable This patch fixes three issues with "notmuch-mutt tag": 1. The message-id was not shell quoted. Thanks to Jason Miller for the bug report and patch. 2. The tags passed into tag_action() were not being properly quoted. The "join before shell_quote" was combining multiple tags into a single argument to notmuch tag: '+one -two -three' instead of '+one' '-two' '-three'. Note that shell_quote() will join array arguments with a space after quoting each, so a join afterwards was not needed. 3. A "--" was added between the tags and search-term as shown in the current notmuch-tag man page. --- contrib/notmuch-mutt/notmuch-mutt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmu= ch-mutt index c69b35c..e5d6848 100755 --- a/contrib/notmuch-mutt/notmuch-mutt +++ b/contrib/notmuch-mutt/notmuch-mutt @@ -114,8 +114,9 @@ sub tag_action(@) { defined $mid or die "notmuch-mutt: cannot find Message-Id, abort.\n"; =20 system("notmuch tag " - . shell_quote(join(' ', @_)) - . " id:$mid"); + . shell_quote(@_) + . " -- " + . shell_quote("id:$mid")); } =20 sub die_usage() { --=20 1.8.4.rc3 --pQhZXvAqiZgbeUkD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQEcBAEBCAAGBQJSKlP4AAoJELaxzZYTaZ+4QJAIAK9yWz1lV31ctIbjKHfcSuob tD1lj7tBqjIzEbYKC5N9FmBQXUV7/z1JlIeMW2asLQ1SklZubZ8OJvGTh8FsDiUE HvFqnUbC+Za39DQnnk45slON2QmSBkfhEAwhxkWAqSMj6H58FWBDe0EWw6llLqjo KCHT/OdMsuFzUjDRLWiLr+fnZ+m9VcbNZHii8E14dxn1rm6J8KHbtuE+5qlOy1am cWBer8TjRN3mxDmKSx9vKMLyRxsuZJU6vttJ0oblZHfHTXeVsvpBSWThKnoqux+T t7hDLuumqrpVBnG0GsH4xasM5I9utJ8UQPN74YsyWl9tZE5mwNagKe2bjz65xMU= =ztJe -----END PGP SIGNATURE----- --pQhZXvAqiZgbeUkD--