Re: [PATCH 1/2] Add Google Inc. to AUTHORS as a contributor.
[notmuch-archives.git] / 54 / 47ce5fc466314d68da59b804034be271f6ef06
1 Return-Path: <markwalters1009@gmail.com>\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 2AAAC431FC3\r
6         for <notmuch@notmuchmail.org>; Sun,  1 Sep 2013 20:28:28 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id PS3arKU3VstE for <notmuch@notmuchmail.org>;\r
18         Sun,  1 Sep 2013 20:28:23 -0700 (PDT)\r
19 Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com\r
20  [74.125.82.49])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  614D9431FCB    for <notmuch@notmuchmail.org>; Sun,  1 Sep 2013 20:28:19 -0700\r
23  (PDT)\r
24 Received: by mail-wg0-f49.google.com with SMTP id l18so487667wgh.4\r
25         for <notmuch@notmuchmail.org>; Sun, 01 Sep 2013 20:28:18 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
28         bh=5dkBYhkrwOnwBRl9iwX3cmDChllaonwaR/LJUd7GoPA=;\r
29         b=FAevX8bPCP40zCbWkg6qqGLH3J4a3JzgwfVBuTzpDRvpMbb+amQJ9mYbIWpt8lJX3J\r
30         kLnfPNA6RLkrVdPyq+kQhDnzdLRAN6NXC8g04hS+/8eqecfK2U5Kf+VLlT35Z3VzRaCH\r
31         yK8njKhvNCJHRLTEYFL2qEtqb6grH1L0vJKN4dEkdO1ZGip5U6OFt7tO+6qHBAHP2FVl\r
32         InlikN1cFl3qRVZCEBy4QgjPA1qOWmXeE1/pucwGZFOW0i7RM6VTxNX9ygaBx6LAlCr9\r
33         TDLMAbnpI6bsv+Mij0+dMP3nufQb15FB7eO8NKMQxQRDBtqRNGeJQg6fgu0U3XwJ2/x8\r
34         6dHA==\r
35 X-Received: by 10.180.100.202 with SMTP id fa10mr4985867wib.8.1378092498263;\r
36         Sun, 01 Sep 2013 20:28:18 -0700 (PDT)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPSA id li9sm14430706wic.4.1969.12.31.16.00.00\r
39         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
40         Sun, 01 Sep 2013 20:28:17 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH 3/4] contrib: pick: allow recursive message field formats\r
44 Date: Mon,  2 Sep 2013 04:28:07 +0100\r
45 Message-Id: <1378092488-32050-4-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 1.7.9.1\r
47 In-Reply-To: <1378092488-32050-1-git-send-email-markwalters1009@gmail.com>\r
48 References: <1378092488-32050-1-git-send-email-markwalters1009@gmail.com>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Mon, 02 Sep 2013 03:28:28 -0000\r
62 \r
63 Previously, the message format was fixed: each part had to be a\r
64 certain width and either left or right justified. This allows the user\r
65 to specify that two parts can be variable width but that combined they\r
66 should be some fixed width. We do this by allowing the user to set as\r
67 a "field" a list of the normal result-format form which is formatted\r
68 and then itself inserted according to the format string specified.\r
69 \r
70 This means all existing formats work but allows more general things\r
71 too. This will be used in the next patch to allow the user to specify\r
72 where the tree box graphics are drawn but allow, e.g., the total width\r
73 of the tree box graphics and subject to be specified.\r
74 ---\r
75  contrib/notmuch-pick/notmuch-pick.el |   14 ++++++++++++--\r
76  1 files changed, 12 insertions(+), 2 deletions(-)\r
77 \r
78 diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
79 index f01be94..5dfcef3 100644\r
80 --- a/contrib/notmuch-pick/notmuch-pick.el\r
81 +++ b/contrib/notmuch-pick/notmuch-pick.el\r
82 @@ -616,6 +616,10 @@ unchanged ADDRESS if parsing fails."\r
83         (match (plist-get msg :match))\r
84         formatted-field)\r
85      (cond\r
86 +     ((listp field)\r
87 +      (setq formatted-field\r
88 +           (format format-string (notmuch-pick-format-field-list field msg))))\r
89 +\r
90       ((string-equal field "date")\r
91        (let ((face (if match\r
92                       'notmuch-pick-match-date-face\r
93 @@ -663,13 +667,19 @@ unchanged ADDRESS if parsing fails."\r
94                           'face face)))))\r
95      formatted-field))\r
96  \r
97 +(defun notmuch-pick-format-field-list (field-list msg)\r
98 +  "Format fields of MSG according to FIELD-LIST and return string"\r
99 +  (let (result-string)\r
100 +    (dolist (spec field-list result-string)\r
101 +      (let ((field-string (notmuch-pick-format-field (car spec) (cdr spec) msg)))\r
102 +       (setq result-string (concat result-string field-string))))))\r
103 +\r
104  (defun notmuch-pick-insert-msg (msg)\r
105    "Insert the message MSG according to notmuch-pick-result-format"\r
106    ;; We need to save the previous subject as it will get overwritten\r
107    ;; by the insert-field calls.\r
108    (let ((previous-subject notmuch-pick-previous-subject))\r
109 -    (dolist (spec notmuch-pick-result-format)\r
110 -      (insert (notmuch-pick-format-field (car spec) (cdr spec) msg)))\r
111 +    (insert (notmuch-pick-format-field-list notmuch-pick-result-format msg))\r
112      (notmuch-pick-set-message-properties msg)\r
113      (notmuch-pick-set-prop :previous-subject previous-subject)\r
114      (insert "\n")))\r
115 -- \r
116 1.7.9.1\r
117 \r