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 70B554196F0 for ; Mon, 26 Apr 2010 04:50:52 -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] 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 dHurrxuqwPKI for ; Mon, 26 Apr 2010 04:50:51 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by olra.theworths.org (Postfix) with ESMTP id 90160431FC1 for ; Mon, 26 Apr 2010 04:50:51 -0700 (PDT) Received: by wyj26 with SMTP id 26so634077wyj.26 for ; Mon, 26 Apr 2010 04:50:51 -0700 (PDT) Received: by 10.216.87.66 with SMTP id x44mr1947236wee.183.1272282650864; Mon, 26 Apr 2010 04:50:50 -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 d75sm460864wek.8.2010.04.26.04.50.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Apr 2010 04:50:50 -0700 (PDT) Received: by ut.hh.sledj.net (Postfix, from userid 1000) id 848F459413B; Mon, 26 Apr 2010 12:51:00 +0100 (BST) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Hide the "User-Agent:" when composing messages Date: Mon, 26 Apr 2010 12:50:59 +0100 Message-Id: <1272282659-4832-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.0 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: Mon, 26 Apr 2010 11:50:52 -0000 Add a list of headers to those hidden by `message-mode' when composing. By default the list includes only "User-Agent:". --- emacs/notmuch-mua.el | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 004b50a..bca20db 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -41,6 +41,12 @@ notmuch-mua-user-agent-notmuch notmuch-mua-user-agent-emacs)) +(defcustom notmuch-mua-hidden-headers '("^User-Agent:") + "Headers that are added to the `message-mode' hidden headers +list." + :group 'notmuch + :type '(repeat string)) + ;; (defun notmuch-mua-user-agent-full () @@ -57,6 +63,13 @@ "Generate a `User-Agent:' string suitable for notmuch." (concat "Emacs/" emacs-version " (" system-configuration ")")) +(defun notmuch-mua-add-more-hidden-headers () + "Add some headers to the list that are hidden by default." + (mapc (lambda (header) + (when (not (member header 'message-hidden-headers)) + (push header message-hidden-headers))) + notmuch-mua-hidden-headers)) + (defun notmuch-mua-reply (query-string) (let (headers body) ;; This make assumptions about the output of `notmuch reply', but @@ -134,6 +147,10 @@ simply runs the corresponding `message-mode' hook functions." 'notmuch-mua-mail 'notmuch-mua-send-and-exit 'notmuch-mua-kill-buffer 'notmuch-mua-send-hook) +;; Add some more headers to the list that `message-mode' hides when +;; composing a message. +(notmuch-mua-add-more-hidden-headers) + ;; (provide 'notmuch-mua) -- 1.7.0