--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 036AF431FB6\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Sep 2012 05:06:34 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 2GGhXhd+jGJZ for <notmuch@notmuchmail.org>;\r
+ Mon, 3 Sep 2012 05:06:33 -0700 (PDT)\r
+Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com\r
+ [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 6DF11431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Sep 2012 05:06:33 -0700 (PDT)\r
+Received: by vbbfc26 with SMTP id fc26so5548794vbb.26\r
+ for <notmuch@notmuchmail.org>; Mon, 03 Sep 2012 05:06:32 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+ :mime-version:content-type:content-transfer-encoding\r
+ :x-gm-message-state;\r
+ bh=iAJbF1g6ElUTeHRe9UujWaUb1GWb8wdN13MCbpKuMd8=;\r
+ b=Uo1Lo2+EzSH2uYN2+1oWIgYp9R7OA1CcFHtoMC00QAZlZLT8SCpm34kymAiG2TsKpA\r
+ IBUnhX49xXKvbCseH1iz9oIHiZy9VjPz6QzHf8fzFTVwezsTR9oXxOzIyfQTkFyjuQso\r
+ Gpt9klPKGGQ2ZpFMvklFuORw//Vyj6g++hV0dJ5p0mngwGyqUPd31ojTiXj+j/0x2uEe\r
+ V3fZ5hNIwfCLSZe1+thoHo3+a45LIxR694QfIdtAAWCCp5ipCWsX2gYOTfze9zIygaV+\r
+ rUUnTFbFJ3O0R5EbRNQF4RXdGkXlPGGtMUNU4aXbJ5sP16WecKU3paaaQR3WZSxcff4u\r
+ kL2w==\r
+Received: by 10.220.228.131 with SMTP id je3mr12086371vcb.73.1346673992674;\r
+ Mon, 03 Sep 2012 05:06:32 -0700 (PDT)\r
+Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
+ by mx.google.com with ESMTPS id n19sm5381305vde.5.2012.09.03.05.06.31\r
+ (version=SSLv3 cipher=OTHER); Mon, 03 Sep 2012 05:06:32 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Michal Nazarewicz <mina86@mina86.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/6] emacs: add helper for tag change list manipulation\r
+In-Reply-To: <xa1tipbvwdb0.fsf@mina86.com>\r
+References: <cover.1346614915.git.jani@nikula.org>\r
+ <9dbf16fb95f40812ad246f95b954681bc895ceb2.1346614915.git.jani@nikula.org>\r
+ <xa1tipbvwdb0.fsf@mina86.com>\r
+User-Agent: Notmuch/0.14+42~g397e223 (http://notmuchmail.org) Emacs/23.2.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Mon, 03 Sep 2012 14:06:24 +0200\r
+Message-ID: <87txvf8g5b.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+X-Gm-Message-State:\r
+ ALoCoQlTybitowxnKiyA9wCDr+4z7r35veHn9Wh9BZKL3QGtuJUYduJWAdjEZCzZlAK0135N2o77\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 03 Sep 2012 12:06:34 -0000\r
+\r
+On Mon, 03 Sep 2012, Michal Nazarewicz <mina86@mina86.com> wrote:\r
+> Jani Nikula <jani@nikula.org> writes:\r
+>> Add a helper to create (and optionally reverse) a list of tag changes.\r
+>> ---\r
+>> emacs/notmuch-tag.el | 17 +++++++++++++++++\r
+>> 1 file changed, 17 insertions(+)\r
+>>\r
+>> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
+>> index 0c0fc87..c1aeb99 100644\r
+>> --- a/emacs/notmuch-tag.el\r
+>> +++ b/emacs/notmuch-tag.el\r
+>> @@ -140,6 +140,23 @@ notmuch-after-tag-hook will be run."\r
+>> ;; in all cases we return tag-changes as a list\r
+>> tag-changes)\r
+>>=20=20\r
+>> +(defun notmuch-tag-change-list (tags &optional reverse)\r
+>> + "Convert TAGS into a list of tag changes.\r
+>> +\r
+>> +Add a \"+\" prefix to any tag in TAGS list that doesn't already\r
+>> +begin with a \"+\" or a \"-\". If REVERSE is non-nil, replace all\r
+>> +\"+\" prefixes with \"-\" and vice versa in the result."\r
+>> + (mapcar (lambda (str)\r
+>> + (let ((s (if (not (string-match "^[+-]" str))\r
+>> + (concat "+" str)\r
+>> + str)))\r
+>\r
+> (if (string-match "^[-+]" str) str (concat "+" str))\r
+>\r
+> Negation only makes things less readable IMO.\r
+\r
+Agreed.\r
+\r
+Jani.\r
+\r
+>\r
+>> + (if reverse\r
+>> + (concat (if (=3D (string-to-char s) ?-) "+" "-")\r
+>> + (substring s 1))\r
+>> + s)))\r
+>> + tags))\r
+>> +\r
+>> +\r
+>> ;;\r
+>>=20=20\r
+>> (provide 'notmuch-tag)\r
+>\r
+> --=20\r
+> Best regards, _ _\r
+> .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o\r
+> ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz =\r
+ (o o)\r
+> ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--\r