Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / 93 / 4b16cdd6ac4220d3b104033674e20c9b8378d5
1 Return-Path: <bremner@pivot.cs.unb.ca>\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 1A8E3431FBF\r
6         for <notmuch@notmuchmail.org>; Fri, 26 Feb 2010 04:25:58 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.024\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.024 tagged_above=-999 required=5 tests=[AWL=0.575,\r
12         BAYES_00=-2.599] 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 NLLiTrvzrgw2 for <notmuch@notmuchmail.org>;\r
16         Fri, 26 Feb 2010 04:25:57 -0800 (PST)\r
17 Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57])\r
18         by olra.theworths.org (Postfix) with ESMTP id 34EB0431FAE\r
19         for <notmuch@notmuchmail.org>; Fri, 26 Feb 2010 04:25:57 -0800 (PST)\r
20 Received: from\r
21         fctnnbsc30w-142167166109.pppoe-dynamic.high-speed.nb.bellaliant.net\r
22         ([142.167.166.109] helo=rocinante.cs.unb.ca)\r
23         by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
24         (Exim 4.69) (envelope-from <bremner@pivot.cs.unb.ca>)\r
25         id 1NkzGR-0006Tv-R1; Fri, 26 Feb 2010 08:25:52 -0400\r
26 Received: from bremner by rocinante.cs.unb.ca with local (Exim 4.71)\r
27         (envelope-from <bremner@rocinante.cs.unb.ca>)\r
28         id 1NkzDQ-0001Dg-L8; Fri, 26 Feb 2010 08:22:44 -0400\r
29 From: david@tethera.net\r
30 To: notmuch@notmuchmail.org\r
31 Date: Fri, 26 Feb 2010 08:22:32 -0400\r
32 Message-Id: <1267186952-4561-1-git-send-email-david@tethera.net>\r
33 X-Mailer: git-send-email 1.6.5\r
34 X-Sender-Verified: bremner@pivot.cs.unb.ca\r
35 Cc: David Bremner <bremner@unb.ca>\r
36 Subject: [notmuch] [PATCH] notmuch.el: add a hook to notmuch-reply\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Fri, 26 Feb 2010 12:25:58 -0000\r
50 \r
51 From: David Bremner <bremner@unb.ca>\r
52 \r
53 This patch introduces a variable notmuch-reply-hook and calls it using\r
54 run-hooks. This allows people to easily override the header setup and\r
55 so forth done by notmuch.\r
56 ---\r
57 \r
58 This is my solution to trying to rationalize the headers of 'm' versus 'r';\r
59 now I just call the same hook in both cases. There is actually only 2 lines \r
60 of code added; the rest is a defcustom, docstrings and so on.\r
61 \r
62  notmuch.el |   10 ++++++++++\r
63  1 files changed, 10 insertions(+), 0 deletions(-)\r
64 \r
65 diff --git a/notmuch.el b/notmuch.el\r
66 index 6482170..f47f134 100644\r
67 --- a/notmuch.el\r
68 +++ b/notmuch.el\r
69 @@ -471,6 +471,8 @@ buffer."\r
70        (progn\r
71         (insert "--text follows this line--")\r
72         (forward-line)))\r
73 +  (save-excursion\r
74 +    (run-hooks 'notmuch-reply-hook))\r
75    (message-mode))\r
76  \r
77  (defun notmuch-show-reply ()\r
78 @@ -1107,6 +1109,14 @@ All currently available key bindings:\r
79    :options '(hl-line-mode)\r
80    :group 'notmuch)\r
81  \r
82 +(defcustom notmuch-reply-hook nil\r
83 +  "List of functions to call when replying to a message.\r
84 +Run after the buffer content is returned from notmuch and before\r
85 +handing off to message mode. The function `notmuch-reply' runs\r
86 +this hook."\r
87 +  :type 'hook\r
88 +  :group 'notmuch)\r
89 +\r
90  (defun notmuch-show-do-stash (text)\r
91      (kill-new text)\r
92      (message (concat "Saved: " text)))\r
93 -- \r
94 1.6.5\r
95 \r