--- /dev/null
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 48FA74196F2\r
+ for <notmuch@notmuchmail.org>; Wed, 19 May 2010 01:54:59 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.9\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
+ tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 2M7kFKf4Zr80 for <notmuch@notmuchmail.org>;\r
+ Wed, 19 May 2010 01:54:47 -0700 (PDT)\r
+Received: from mail-ew0-f213.google.com (mail-ew0-f213.google.com\r
+ [209.85.219.213])\r
+ by olra.theworths.org (Postfix) with ESMTP id 6B8DC41733F\r
+ for <notmuch@notmuchmail.org>; Wed, 19 May 2010 01:53:47 -0700 (PDT)\r
+Received: by mail-ew0-f213.google.com with SMTP id 5so1814153ewy.0\r
+ for <notmuch@notmuchmail.org>; Wed, 19 May 2010 01:53:47 -0700 (PDT)\r
+Received: by 10.213.52.139 with SMTP id i11mr3289701ebg.26.1274259226874;\r
+ Wed, 19 May 2010 01:53:46 -0700 (PDT)\r
+Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com\r
+ [83.217.165.81])\r
+ by mx.google.com with ESMTPS id 15sm3510933ewy.0.2010.05.19.01.53.43\r
+ (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+ Wed, 19 May 2010 01:53:45 -0700 (PDT)\r
+Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
+ id D77AC5940AF; Wed, 19 May 2010 08:03:45 +0100 (BST)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 08/13] emacs: Reuse rather than reinvent message header\r
+ filtering\r
+Date: Wed, 19 May 2010 08:03:35 +0100\r
+Message-Id: <1274252620-1249-9-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 1.7.1\r
+In-Reply-To: <1274252620-1249-1-git-send-email-dme@dme.org>\r
+References: <1274252620-1249-1-git-send-email-dme@dme.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 19 May 2010 08:54:59 -0000\r
+\r
+From: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
+\r
+In notmuch-mua-reply we were filtering out the Subject and To headers\r
+manually in a loop, but message mode offers a nice function for\r
+exactly that. Simplify the code by using that. Also, as\r
+notmuch-mua-mail already sorts and hides headers that we want sorted\r
+and hidden, we can safely remove those 2 functions from here as well.\r
+\r
+Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
+---\r
+ emacs/notmuch-mua.el | 7 +------\r
+ 1 files changed, 1 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index bd06e3c..6318c15 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -92,12 +92,7 @@ list."\r
+ ((same-window-regexps '("\\*mail .*")))\r
+ (notmuch-mua-mail (mail-header 'to headers)\r
+ (mail-header 'subject headers)\r
+- (loop for header in headers\r
+- if (not (or (eq 'to (car header))\r
+- (eq 'subject (car header))))\r
+- collect header)))\r
+- (message-sort-headers)\r
+- (message-hide-headers)\r
++ (message-headers-to-generate headers t '(to subject))))\r
+ ;; insert the message body - but put it in front of the signature\r
+ ;; if one is present\r
+ (goto-char (point-max))\r
+-- \r
+1.7.1\r
+\r