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 9E5264196F0
\r
6 for <notmuch@notmuchmail.org>; Thu, 29 Apr 2010 02:10:55 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 WJ3+B9Jtq0LS for <notmuch@notmuchmail.org>;
\r
16 Thu, 29 Apr 2010 02:10:54 -0700 (PDT)
\r
17 Received: from homiemail-a21.g.dreamhost.com (caiajhbdccah.dreamhost.com
\r
19 by olra.theworths.org (Postfix) with ESMTP id D24D7431FC1
\r
20 for <notmuch@notmuchmail.org>; Thu, 29 Apr 2010 02:10:54 -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-a21.g.dreamhost.com (Postfix) with ESMTPA id 8267A300061;
\r
24 Thu, 29 Apr 2010 02:10:47 -0700 (PDT)
\r
25 From: Sebastian Spaeth <Sebastian@SSpaeth.de>
\r
26 To: Notmuch developer list <notmuch@notmuchmail.org>
\r
27 Subject: [PATCH v2] emacs: Reuse rather than reinvent message header filtering
\r
28 Date: Thu, 29 Apr 2010 11:10:01 +0200
\r
29 Message-Id: <1272532201-8742-1-git-send-email-Sebastian@SSpaeth.de>
\r
30 X-Mailer: git-send-email 1.7.0.4
\r
31 In-Reply-To: <87eihyy6od.fsf@ut.hh.sledj.net>
\r
32 References: <87eihyy6od.fsf@ut.hh.sledj.net>
\r
33 X-BeenThere: notmuch@notmuchmail.org
\r
34 X-Mailman-Version: 2.1.13
\r
36 List-Id: "Use and development of the notmuch mail system."
\r
37 <notmuch.notmuchmail.org>
\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
39 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
41 List-Post: <mailto:notmuch@notmuchmail.org>
\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
45 X-List-Received-Date: Thu, 29 Apr 2010 09:10:55 -0000
\r
47 In notmuch-mua-reply we were filtering out the Subject and To headers
\r
48 manually in a loop, but message mode offers a nice function for
\r
49 exactly that. Simplify the code by using it. Also, as notmuch-mua-mail
\r
50 already sorts and hides headers that we want sorted and hidden, we can
\r
51 safely remove those 2 functions from here as well. Also remove the
\r
52 (require 'cl), the only reason for its existence was the now removed
\r
55 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
\r
57 Also removed (require 'cl) as per dme's suggestion.
\r
59 emacs/notmuch-mua.el | 8 +-------
\r
60 1 files changed, 1 insertions(+), 7 deletions(-)
\r
62 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
\r
63 index bd06e3c..0975fe6 100644
\r
64 --- a/emacs/notmuch-mua.el
\r
65 +++ b/emacs/notmuch-mua.el
\r
68 ;; Authors: David Edmondson <dme@dme.org>
\r
73 (require 'notmuch-lib)
\r
74 @@ -92,12 +91,7 @@ list."
\r
75 ((same-window-regexps '("\\*mail .*")))
\r
76 (notmuch-mua-mail (mail-header 'to headers)
\r
77 (mail-header 'subject headers)
\r
78 - (loop for header in headers
\r
79 - if (not (or (eq 'to (car header))
\r
80 - (eq 'subject (car header))))
\r
82 - (message-sort-headers)
\r
83 - (message-hide-headers)
\r
84 + (message-headers-to-generate headers t '(to subject))))
\r
85 ;; insert the message body - but put it in front of the signature
\r
86 ;; if one is present
\r
87 (goto-char (point-max))
\r