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 1A8E3431FBF for ; Fri, 26 Feb 2010 04:25:58 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.024 X-Spam-Level: X-Spam-Status: No, score=-2.024 tagged_above=-999 required=5 tests=[AWL=0.575, BAYES_00=-2.599] 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 NLLiTrvzrgw2 for ; Fri, 26 Feb 2010 04:25:57 -0800 (PST) Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57]) by olra.theworths.org (Postfix) with ESMTP id 34EB0431FAE for ; Fri, 26 Feb 2010 04:25:57 -0800 (PST) Received: from fctnnbsc30w-142167166109.pppoe-dynamic.high-speed.nb.bellaliant.net ([142.167.166.109] helo=rocinante.cs.unb.ca) by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NkzGR-0006Tv-R1; Fri, 26 Feb 2010 08:25:52 -0400 Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.71) (envelope-from ) id 1NkzDQ-0001Dg-L8; Fri, 26 Feb 2010 08:22:44 -0400 From: david@tethera.net To: notmuch@notmuchmail.org Date: Fri, 26 Feb 2010 08:22:32 -0400 Message-Id: <1267186952-4561-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.6.5 X-Sender-Verified: bremner@pivot.cs.unb.ca Cc: David Bremner Subject: [notmuch] [PATCH] notmuch.el: add a hook to notmuch-reply 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: Fri, 26 Feb 2010 12:25:58 -0000 From: David Bremner This patch introduces a variable notmuch-reply-hook and calls it using run-hooks. This allows people to easily override the header setup and so forth done by notmuch. --- This is my solution to trying to rationalize the headers of 'm' versus 'r'; now I just call the same hook in both cases. There is actually only 2 lines of code added; the rest is a defcustom, docstrings and so on. notmuch.el | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/notmuch.el b/notmuch.el index 6482170..f47f134 100644 --- a/notmuch.el +++ b/notmuch.el @@ -471,6 +471,8 @@ buffer." (progn (insert "--text follows this line--") (forward-line))) + (save-excursion + (run-hooks 'notmuch-reply-hook)) (message-mode)) (defun notmuch-show-reply () @@ -1107,6 +1109,14 @@ All currently available key bindings: :options '(hl-line-mode) :group 'notmuch) +(defcustom notmuch-reply-hook nil + "List of functions to call when replying to a message. +Run after the buffer content is returned from notmuch and before +handing off to message mode. The function `notmuch-reply' runs +this hook." + :type 'hook + :group 'notmuch) + (defun notmuch-show-do-stash (text) (kill-new text) (message (concat "Saved: " text))) -- 1.6.5