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 4A97E431FAF for ; Mon, 21 Jan 2013 10:09:15 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 tqGJYpgG3enF for ; Mon, 21 Jan 2013 10:09:14 -0800 (PST) Received: from mail-bk0-f48.google.com (mail-bk0-f48.google.com [209.85.214.48]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 94396431FAE for ; Mon, 21 Jan 2013 10:09:14 -0800 (PST) Received: by mail-bk0-f48.google.com with SMTP id jk14so676481bkc.21 for ; Mon, 21 Jan 2013 10:09:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:x-gm-message-state; bh=V1YWDI/hBqeZMU0msR2LbWUnnD+6J1bgDD+G2bbRbmo=; b=Tf+giVbpOxyulW+7j6GbmTqJm9aMQt/CqhOg86nDA4ea4bvMo/47Q0C9r4DbtfdM/U uo8QB0UONnRh+NdgEPXgJqi3xZdY9gO3QXC574q0xo2BIiBVhnBqBt40ciU5x9FDoCnb FwoqXXeRvNDIkSDq7u/15Bh3mIwmzbeJC0wHjDA16Lfx+VPF8R7CseSYWSI4lkiKLT4x XqdYSYJovp3MRQHwIXAqjIsniwoW0DhAW0eGNOpPG+3aQXUh5kbyGcgNZSwME6KzkDhJ ks9NW1xin8PK1XWr2AZiRpvytyDZZ/661BSyMkm6Sn/fejhnkpJbWLbIz7ZbaufKwkx4 Ua7w== X-Received: by 10.204.149.11 with SMTP id r11mr4940260bkv.93.1358791753124; Mon, 21 Jan 2013 10:09:13 -0800 (PST) Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) by mx.google.com with ESMTPS id y11sm9235154bkw.8.2013.01.21.10.09.10 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 21 Jan 2013 10:09:11 -0800 (PST) From: Jani Nikula To: Peter Wang , notmuch@notmuchmail.org Subject: Re: [PATCH v3 07/20] tag-util: do not reset list in parse_tag_command_line In-Reply-To: <1358643004-14522-8-git-send-email-novalazy@gmail.com> References: <1358643004-14522-1-git-send-email-novalazy@gmail.com> <1358643004-14522-8-git-send-email-novalazy@gmail.com> User-Agent: Notmuch/0.14+259~gdee88db (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Mon, 21 Jan 2013 19:09:04 +0100 Message-ID: <878v7m2ytb.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQlVxLKOvt7ikoTdSrVLp6SXrD8pMom0NFKRCS7FKgN49gfJcASisalTuIbJHBW8MEungHAR 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: Mon, 21 Jan 2013 18:09:15 -0000 On Sun, 20 Jan 2013, Peter Wang wrote: > No current callers of parse_tag_command_line require that it clear its > tag list argument. The notmuch 'insert' command will be better served > if the function modifies a pre-populated list (of new.tags) instead of > clobbering it outright. I think I'd like parse_tag_command_line() and parse_tag_line() to behave similarly, both either resetting or not resetting tag list. I think you could just parse command line first, and add new.tags afterwards, and you'd be fine without changing parse_tag_command_line(). > --- > tag-util.c | 2 -- > tag-util.h | 2 ++ > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tag-util.c b/tag-util.c > index 701d329..3f9da05 100644 > --- a/tag-util.c > +++ b/tag-util.c > @@ -165,8 +165,6 @@ parse_tag_command_line (void *ctx, int argc, char **argv, > > int i; > > - tag_op_list_reset (tag_ops); > - > for (i = 0; i < argc; i++) { > if (strcmp (argv[i], "--") == 0) { > i++; > diff --git a/tag-util.h b/tag-util.h > index 246de85..4628f16 100644 > --- a/tag-util.h > +++ b/tag-util.h > @@ -81,6 +81,8 @@ parse_tag_line (void *ctx, char *line, > * Output Parameters: > * ops contains a list of tag operations > * query_str the search terms. > + * > + * The ops argument is not cleared. > */ > > tag_parse_status_t > -- > 1.7.12.1 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch