From: Sebastian Spaeth <Sebastian@SSpaeth.de>
To: Notmuch developer list <notmuch@notmuchmail.org>
Subject: [PATCH v2] emacs: Reuse rather than reinvent message header filtering
Date: Thu, 29 Apr 2010 11:10:01 +0200 [thread overview]
Message-ID: <1272532201-8742-1-git-send-email-Sebastian@SSpaeth.de> (raw)
In-Reply-To: <87eihyy6od.fsf@ut.hh.sledj.net>
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 it. 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. Also remove the
(require 'cl), the only reason for its existence was the now removed
"loop" function.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
---
Also removed (require 'cl) as per dme's suggestion.
emacs/notmuch-mua.el | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index bd06e3c..0975fe6 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -19,7 +19,6 @@
;;
;; Authors: David Edmondson <dme@dme.org>
-(require 'cl)
(require 'message)
(require 'notmuch-lib)
@@ -92,12 +91,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.0.4
next prev parent reply other threads:[~2010-04-29 9:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-29 8:47 [PATCH] emacs: Reuse rather than reinvent message header filtering Sebastian Spaeth
2010-04-29 9:00 ` David Edmondson
2010-04-29 9:10 ` Sebastian Spaeth [this message]
2010-06-04 0:06 ` [PATCH v2] " Carl Worth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1272532201-8742-1-git-send-email-Sebastian@SSpaeth.de \
--to=sebastian@sspaeth.de \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).