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 493C7431FAF for ; Sat, 7 Sep 2013 01:28:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 qJHHNAgNdv3h for ; Sat, 7 Sep 2013 01:28:05 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 82884431FAE for ; Sat, 7 Sep 2013 01:28:05 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id C908D10005E; Sat, 7 Sep 2013 11:27:55 +0300 (EEST) From: Tomi Ollila To: "Kevin J. McCarthy" , notmuch@notmuchmail.org Subject: Re: [PATCH 1/1] notmuch-mutt: Fix tagging issues In-Reply-To: <20130906221520.GC4226@zaogao.lan> References: <20130906221520.GC4226@zaogao.lan> User-Agent: Notmuch/0.16+60~gbdcc747 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Sat, 07 Sep 2013 08:28:18 -0000 On Sat, Sep 07 2013, "Kevin J. McCarthy" wrote: > 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. The patch looks good to me, just that I cannot test it. +1. If it weren't inconsistent what is there now a simpler alternative could be: system qw/notmuch tag/, @_, '--', "id:$mid"; or even exec qw/notmuch tag/, @_, '--', "id:$mid"; ... as these bypasses the intermediate shell altogether. Tomi > --- > 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/not= much-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=20 > system("notmuch tag " > - . shell_quote(join(' ', @_)) > - . " id:$mid"); > + . shell_quote(@_) > + . " -- " > + . shell_quote("id:$mid")); > } >=20=20 > sub die_usage() { > --=20 > 1.8.4.rc3 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch --=20 "kaik on m=C3=A4nt!"