Re: correct way to search for only PDF attachments
[notmuch-archives.git] / f9 / 4c227927d9eeb4fab60b83fd9084ccb32b6cf7
1 Return-Path: <Sebastian@SSpaeth.de>\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 9C9C24196F0\r
6         for <notmuch@notmuchmail.org>; Thu, 29 Apr 2010 01:48:05 -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: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\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 L14YbbuiIaq3 for <notmuch@notmuchmail.org>;\r
16         Thu, 29 Apr 2010 01:48:04 -0700 (PDT)\r
17 Received: from homiemail-a20.g.dreamhost.com (caiajhbdcaib.dreamhost.com\r
18         [208.97.132.81])\r
19         by olra.theworths.org (Postfix) with ESMTP id 4E086431FC1\r
20         for <notmuch@notmuchmail.org>; Thu, 29 Apr 2010 01:48:04 -0700 (PDT)\r
21 Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch\r
22         [129.132.133.204]) (Authenticated sender: sebastian@sspaeth.de)\r
23         by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id E366C7EC06A; \r
24         Thu, 29 Apr 2010 01:47:58 -0700 (PDT)\r
25 From: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
26 To: Notmuch developer list <notmuch@notmuchmail.org>\r
27 Subject: [PATCH] emacs: Reuse rather than reinvent message header filtering\r
28 Date: Thu, 29 Apr 2010 10:47:55 +0200\r
29 Message-Id: <1272530875-7141-1-git-send-email-Sebastian@SSpaeth.de>\r
30 X-Mailer: git-send-email 1.7.0.4\r
31 X-BeenThere: notmuch@notmuchmail.org\r
32 X-Mailman-Version: 2.1.13\r
33 Precedence: list\r
34 List-Id: "Use and development of the notmuch mail system."\r
35         <notmuch.notmuchmail.org>\r
36 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
37         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
39 List-Post: <mailto:notmuch@notmuchmail.org>\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
41 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
43 X-List-Received-Date: Thu, 29 Apr 2010 08:48:05 -0000\r
44 \r
45 In notmuch-mua-reply we were filtering out the Subject and To headers\r
46 manually in a loop, but message mode offers a nice function for\r
47 exactly that. Simplify the code by using that. Also, as\r
48 notmuch-mua-mail already sorts and hides headers that we want sorted\r
49 and hidden, we can safely remove those 2 functions from here as well.\r
50 \r
51 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
52 ---\r
53  emacs/notmuch-mua.el |    7 +------\r
54  1 files changed, 1 insertions(+), 6 deletions(-)\r
55 \r
56 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
57 index bd06e3c..6318c15 100644\r
58 --- a/emacs/notmuch-mua.el\r
59 +++ b/emacs/notmuch-mua.el\r
60 @@ -92,12 +92,7 @@ list."\r
61         ((same-window-regexps '("\\*mail .*")))\r
62        (notmuch-mua-mail (mail-header 'to headers)\r
63                         (mail-header 'subject headers)\r
64 -                       (loop for header in headers\r
65 -                             if (not (or (eq 'to (car header))\r
66 -                                         (eq 'subject (car header))))\r
67 -                             collect header)))\r
68 -    (message-sort-headers)\r
69 -    (message-hide-headers)\r
70 +                       (message-headers-to-generate headers t '(to subject))))\r
71      ;; insert the message body - but put it in front of the signature\r
72      ;; if one is present\r
73      (goto-char (point-max))\r
74 -- \r
75 1.7.0.4\r
76 \r