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