[PATCH] emacs: implement notmuch-search-color-line with dolist.
[notmuch-archives.git] / b8 / 61163eba09ecc8b7f6b4348064609a27331760
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 0F26A431FD7\r
6         for <notmuch@notmuchmail.org>; Thu, 26 Apr 2012 12:14:49 -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 aWUV9odf8EzZ for <notmuch@notmuchmail.org>;\r
18         Thu, 26 Apr 2012 12:14:48 -0700 (PDT)\r
19 Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com\r
20  [74.125.82.45])        (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  BBA0D431FB6    for <notmuch@notmuchmail.org>; Thu, 26 Apr 2012 12:14:47 -0700\r
23  (PDT)\r
24 Received: by wgbdt14 with SMTP id dt14so1310020wgb.2\r
25         for <notmuch@notmuchmail.org>; Thu, 26 Apr 2012 12:14:46 -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:x-mailer:in-reply-to:references;\r
28         bh=RJo7MnMrRNaFlqSCIkZ9CsJb9sECfTyqURxcovwpRvY=;\r
29         b=xLXPRKSqTrRsH7NsEqPSbLsONYXeWUkO+uyYRSZpRrroF/4qoAkuiyfTJJQCZEOTt/\r
30         w8plpuXaTB3/TorpxDsnMp/3H5wMK/NTbtErfaZzsWTse4TTMhmb9mQwfiKwCThQDSmI\r
31         dO6sY0RvieKmFokIrQedeMthySU4F5XaXm4xvjU3h090LN85Pyi+guVgPWFfz0w4P9Jg\r
32         fFA+bEKpOH5qtmcmgmT9bw2rgWG/KZHHJOSoq3FZZm4Tj6ECiMkYUEGDWtjvMoy9y6Ie\r
33         cisP7cdoTwiHxwsLA7DYe6/Ke9LKCyQy7tKDThkUEuHFJAW8yKfGr9+RSX94/juMNKWA\r
34         BifQ==\r
35 Received: by 10.216.131.154 with SMTP id m26mr4747055wei.91.1335467686532;\r
36         Thu, 26 Apr 2012 12:14:46 -0700 (PDT)\r
37 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
38  [94.192.233.223])      by mx.google.com with ESMTPS id\r
39  k6sm46648801wie.9.2012.04.26.12.14.45  (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Thu, 26 Apr 2012 12:14:45 -0700 (PDT)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [Patch v3 1/2] emacs: add a filter option to show\r
44 Date: Thu, 26 Apr 2012 20:14:48 +0100\r
45 Message-Id: <1335467689-6513-2-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 1.7.9.1\r
47 In-Reply-To: <1335467689-6513-1-git-send-email-markwalters1009@gmail.com>\r
48 References: <1335467689-6513-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: Thu, 26 Apr 2012 19:14:49 -0000\r
62 \r
63 Show the current thread with a different filter (i.e., open messages\r
64 in the thread matching the new query).\r
65 \r
66 Bound to 'l' for "limit".\r
67 \r
68 Note that it is not the same as filter in search mode as it replaces\r
69 the existing query rather than ANDing with it (but it does keep the\r
70 thread-id part of the query).\r
71 ---\r
72  emacs/notmuch-show.el |   10 ++++++++++\r
73  1 files changed, 10 insertions(+), 0 deletions(-)\r
74 \r
75 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
76 index 30b26d1..492da72 100644\r
77 --- a/emacs/notmuch-show.el\r
78 +++ b/emacs/notmuch-show.el\r
79 @@ -42,6 +42,7 @@\r
80  (declare-function notmuch-search-next-thread "notmuch" nil)\r
81  (declare-function notmuch-search-show-thread "notmuch" nil)\r
82  (declare-function notmuch-update-tags "notmuch" (current-tags tag-changes))\r
83 +(declare-function notmuch-read-query "notmuch" (prompt))\r
84  \r
85  (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")\r
86    "Headers that should be shown in a message, in this order.\r
87 @@ -1157,6 +1158,7 @@ reset based on the original query."\r
88         (define-key map "s" 'notmuch-search)\r
89         (define-key map "m" 'notmuch-mua-new-mail)\r
90         (define-key map "f" 'notmuch-show-forward-message)\r
91 +       (define-key map "l" 'notmuch-show-filter-thread)\r
92         (define-key map "r" 'notmuch-show-reply-sender)\r
93         (define-key map "R" 'notmuch-show-reply)\r
94         (define-key map "|" 'notmuch-show-pipe-message)\r
95 @@ -1399,6 +1401,14 @@ current thread."\r
96    "Mark the current message as read."\r
97    (notmuch-show-tag-message "-unread"))\r
98  \r
99 +(defun notmuch-show-filter-thread (query)\r
100 +  "Filter or LIMIT the current thread based on a new query string.\r
101 +\r
102 +Reshows the current thread with matches defined by the new query-string."\r
103 +  (interactive (list (notmuch-read-query "Filter thread: ")))\r
104 +  (setq notmuch-show-query-context (if (string= query "") nil query))\r
105 +  (notmuch-show-refresh-view t))\r
106 +\r
107  ;; Functions for getting attributes of several messages in the current\r
108  ;; thread.\r
109  \r
110 -- \r
111 1.7.9.1\r
112 \r