Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 9a / 7823b8fcae43a4501f6bc024d8cfdd9d6c27b8
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 4DAF8431FC4\r
6         for <notmuch@notmuchmail.org>; Sun,  2 Sep 2012 12:58:22 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id LvZuDkdKEYXC for <notmuch@notmuchmail.org>;\r
17         Sun,  2 Sep 2012 12:58:20 -0700 (PDT)\r
18 Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
19         [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id E0A2E431FC2\r
22         for <notmuch@notmuchmail.org>; Sun,  2 Sep 2012 12:58:14 -0700 (PDT)\r
23 Received: by lahc1 with SMTP id c1so3430631lah.26\r
24         for <notmuch@notmuchmail.org>; Sun, 02 Sep 2012 12:58:13 -0700 (PDT)\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=google.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
28         :in-reply-to:references:x-gm-message-state;\r
29         bh=GFmrz+2vzZpdJHZluDIQkuM7tZ+QToNsrJcsOpgb3os=;\r
30         b=apS5U7iOuf0mck0R5Zs5blVGXMHzJxg6kfTzftYJ9DXVdeHuzW7OX3Y3uP6JGH27TN\r
31         nabjpBgMCGYEzECpN+YrXQVt+M4xnoav7zeiQkOCr+hMef6LWjCWGqIlaXLK9MkmSB+0\r
32         s3UA2HnYunyFORHTEQZkv3eu8cgQTgO3kfuy8LGw3NDQ4UhkuX2T7yFASHC0onEqZcD0\r
33         Zoeo5ddpTg0Y5hxQmMK+2LRwySd6/8Co6ZtogrFLLwWdpnBsClj1d1qoLW/fCJdyOYyx\r
34         8Qd6N22jtpvFeCNH0e83xXOOC3UfhT++aWtMCnu5OWxjAVc5kbb/PG2mxCh6EiPfh3R2\r
35         yAmw==\r
36 Received: by 10.112.17.161 with SMTP id p1mr2927015lbd.64.1346615893216;\r
37         Sun, 02 Sep 2012 12:58:13 -0700 (PDT)\r
38 Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.\r
39         [80.223.81.27])\r
40         by mx.google.com with ESMTPS id n7sm2750552lbk.10.2012.09.02.12.58.11\r
41         (version=SSLv3 cipher=OTHER); Sun, 02 Sep 2012 12:58:12 -0700 (PDT)\r
42 From: Jani Nikula <jani@nikula.org>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH 1/6] emacs: add helper for tag change list manipulation\r
45 Date: Sun,  2 Sep 2012 22:58:00 +0300\r
46 Message-Id:\r
47  <9dbf16fb95f40812ad246f95b954681bc895ceb2.1346614915.git.jani@nikula.org>\r
48 X-Mailer: git-send-email 1.7.9.5\r
49 In-Reply-To: <cover.1346614915.git.jani@nikula.org>\r
50 References: <cover.1346614915.git.jani@nikula.org>\r
51 In-Reply-To: <cover.1346614915.git.jani@nikula.org>\r
52 References: <cover.1346614915.git.jani@nikula.org>\r
53 X-Gm-Message-State:\r
54  ALoCoQlhKpRqZd852T0c+HnfZ/UrLB2bWFw3vxyQ8wgwQ1XGsvl8aJMRntlORTM8Zz5rIasPKBYg\r
55 X-BeenThere: notmuch@notmuchmail.org\r
56 X-Mailman-Version: 2.1.13\r
57 Precedence: list\r
58 List-Id: "Use and development of the notmuch mail system."\r
59         <notmuch.notmuchmail.org>\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
63 List-Post: <mailto:notmuch@notmuchmail.org>\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
67 X-List-Received-Date: Sun, 02 Sep 2012 19:58:23 -0000\r
68 \r
69 Add a helper to create (and optionally reverse) a list of tag changes.\r
70 ---\r
71  emacs/notmuch-tag.el |   17 +++++++++++++++++\r
72  1 file changed, 17 insertions(+)\r
73 \r
74 diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
75 index 0c0fc87..c1aeb99 100644\r
76 --- a/emacs/notmuch-tag.el\r
77 +++ b/emacs/notmuch-tag.el\r
78 @@ -140,6 +140,23 @@ notmuch-after-tag-hook will be run."\r
79    ;; in all cases we return tag-changes as a list\r
80    tag-changes)\r
81  \r
82 +(defun notmuch-tag-change-list (tags &optional reverse)\r
83 +  "Convert TAGS into a list of tag changes.\r
84 +\r
85 +Add a \"+\" prefix to any tag in TAGS list that doesn't already\r
86 +begin with a \"+\" or a \"-\". If REVERSE is non-nil, replace all\r
87 +\"+\" prefixes with \"-\" and vice versa in the result."\r
88 +  (mapcar (lambda (str)\r
89 +           (let ((s (if (not (string-match "^[+-]" str))\r
90 +                        (concat "+" str)\r
91 +                      str)))\r
92 +             (if reverse\r
93 +                 (concat (if (= (string-to-char s) ?-) "+" "-")\r
94 +                         (substring s 1))\r
95 +               s)))\r
96 +         tags))\r
97 +\r
98 +\r
99  ;;\r
100  \r
101  (provide 'notmuch-tag)\r
102 -- \r
103 1.7.9.5\r
104 \r