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