1 Return-Path: <dme@dme.org>
\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 70B554196F0
\r
6 for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 04:50:52 -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 dHurrxuqwPKI for <notmuch@notmuchmail.org>;
\r
16 Mon, 26 Apr 2010 04:50:51 -0700 (PDT)
\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com
\r
19 by olra.theworths.org (Postfix) with ESMTP id 90160431FC1
\r
20 for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 04:50:51 -0700 (PDT)
\r
21 Received: by wyj26 with SMTP id 26so634077wyj.26
\r
22 for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 04:50:51 -0700 (PDT)
\r
23 Received: by 10.216.87.66 with SMTP id x44mr1947236wee.183.1272282650864;
\r
24 Mon, 26 Apr 2010 04:50:50 -0700 (PDT)
\r
25 Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com
\r
27 by mx.google.com with ESMTPS id d75sm460864wek.8.2010.04.26.04.50.49
\r
28 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
29 Mon, 26 Apr 2010 04:50:50 -0700 (PDT)
\r
30 Received: by ut.hh.sledj.net (Postfix, from userid 1000)
\r
31 id 848F459413B; Mon, 26 Apr 2010 12:51:00 +0100 (BST)
\r
32 From: David Edmondson <dme@dme.org>
\r
33 To: notmuch@notmuchmail.org
\r
34 Subject: [PATCH] emacs: Hide the "User-Agent:" when composing messages
\r
35 Date: Mon, 26 Apr 2010 12:50:59 +0100
\r
36 Message-Id: <1272282659-4832-1-git-send-email-dme@dme.org>
\r
37 X-Mailer: git-send-email 1.7.0
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.13
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Mon, 26 Apr 2010 11:50:52 -0000
\r
52 Add a list of headers to those hidden by `message-mode' when
\r
53 composing. By default the list includes only "User-Agent:".
\r
55 emacs/notmuch-mua.el | 17 +++++++++++++++++
\r
56 1 files changed, 17 insertions(+), 0 deletions(-)
\r
58 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
\r
59 index 004b50a..bca20db 100644
\r
60 --- a/emacs/notmuch-mua.el
\r
61 +++ b/emacs/notmuch-mua.el
\r
63 notmuch-mua-user-agent-notmuch
\r
64 notmuch-mua-user-agent-emacs))
\r
66 +(defcustom notmuch-mua-hidden-headers '("^User-Agent:")
\r
67 + "Headers that are added to the `message-mode' hidden headers
\r
70 + :type '(repeat string))
\r
74 (defun notmuch-mua-user-agent-full ()
\r
76 "Generate a `User-Agent:' string suitable for notmuch."
\r
77 (concat "Emacs/" emacs-version " (" system-configuration ")"))
\r
79 +(defun notmuch-mua-add-more-hidden-headers ()
\r
80 + "Add some headers to the list that are hidden by default."
\r
81 + (mapc (lambda (header)
\r
82 + (when (not (member header 'message-hidden-headers))
\r
83 + (push header message-hidden-headers)))
\r
84 + notmuch-mua-hidden-headers))
\r
86 (defun notmuch-mua-reply (query-string)
\r
88 ;; This make assumptions about the output of `notmuch reply', but
\r
89 @@ -134,6 +147,10 @@ simply runs the corresponding `message-mode' hook functions."
\r
90 'notmuch-mua-mail 'notmuch-mua-send-and-exit
\r
91 'notmuch-mua-kill-buffer 'notmuch-mua-send-hook)
\r
93 +;; Add some more headers to the list that `message-mode' hides when
\r
94 +;; composing a message.
\r
95 +(notmuch-mua-add-more-hidden-headers)
\r
99 (provide 'notmuch-mua)
\r