1 Return-Path: <aneesh.kumar@linux.vnet.ibm.com>
\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 7DD8E431FBC
\r
6 for <notmuch@notmuchmail.org>; Wed, 18 Nov 2009 07:15:04 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id bvGyeqzC8e89 for <notmuch@notmuchmail.org>;
\r
11 Wed, 18 Nov 2009 07:15:03 -0800 (PST)
\r
12 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148])
\r
13 by olra.theworths.org (Postfix) with ESMTP id 23E0A431FAE
\r
14 for <notmuch@notmuchmail.org>; Wed, 18 Nov 2009 07:15:02 -0800 (PST)
\r
15 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246])
\r
16 by e23smtp06.au.ibm.com (8.14.3/8.13.1) with ESMTP id nAIFExRC018885
\r
17 for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 02:14:59 +1100
\r
18 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96])
\r
19 by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id
\r
21 for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 02:11:43 +1100
\r
22 Received: from d23av01.au.ibm.com (loopback [127.0.0.1])
\r
23 by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id
\r
25 for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 02:15:01 +1100
\r
26 Received: from skywalker.linux.vnet.ibm.com ([9.77.125.7])
\r
27 by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id
\r
29 for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 02:15:00 +1100
\r
30 From: aneesh.kumar@linux.vnet.ibm.com (Aneesh Kumar K.V)
\r
31 To: notmuch <notmuch@notmuchmail.org>
\r
32 Date: Wed, 18 Nov 2009 20:44:58 +0530
\r
33 Message-ID: <87my2jrhjh.fsf@linux.vnet.ibm.com>
\r
35 Content-Type: text/plain; charset=us-ascii
\r
36 Subject: [notmuch] [PATCH] notmuch: Add hooks for show-mode and search-mode
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.12
\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: Wed, 18 Nov 2009 15:15:04 -0000
\r
52 >From e3a801c90ed5e037b68bd16807606388e6dbe6e8 Mon Sep 17 00:00:00 2001
\r
53 From: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
\r
54 Date: Wed, 18 Nov 2009 20:43:13 +0530
\r
55 Subject: [PATCH] notmuch: Add hooks for show-mode and search-mode
\r
57 This enables to do things like
\r
59 (add-hook 'notmuch-search-mode-hook
\r
63 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
\r
65 notmuch.el | 12 ++++++++++--
\r
66 1 files changed, 10 insertions(+), 2 deletions(-)
\r
68 diff --git a/notmuch.el b/notmuch.el
\r
69 index 014d15b..87116f9 100644
\r
73 "Keymap for \"notmuch show\" buffers.")
\r
74 (fset 'notmuch-show-mode-map notmuch-show-mode-map)
\r
76 +(defvar notmuch-show-mode-hook nil
\r
77 + "Hooks run when notmuch-show-mode is enabled")
\r
79 +(defvar notmuch-search-mode-hook nil
\r
80 + "Hooks run when notmuch-search-mode is enabled")
\r
82 (defvar notmuch-show-signature-regexp "\\(-- ?\\|_+\\)$"
\r
83 "Pattern to match a line that separates content from signature.
\r
85 @@ -636,7 +642,8 @@ view, (remove the \"inbox\" tag from each), with
\r
86 (use-local-map notmuch-show-mode-map)
\r
87 (setq major-mode 'notmuch-show-mode
\r
88 mode-name "notmuch-show")
\r
89 - (setq buffer-read-only t))
\r
90 + (setq buffer-read-only t)
\r
91 + (run-hooks 'notmuch-show-mode-hook))
\r
93 (defun notmuch-show (thread-id &optional parent-buffer)
\r
94 "Run \"notmuch show\" with the given thread ID and display results.
\r
95 @@ -759,7 +766,8 @@ global search.
\r
96 (use-local-map notmuch-search-mode-map)
\r
97 (setq major-mode 'notmuch-search-mode
\r
98 mode-name "notmuch-search")
\r
99 - (setq buffer-read-only t))
\r
100 + (setq buffer-read-only t)
\r
101 + (run-hooks 'notmuch-search-mode-hook))
\r
103 (defun notmuch-search-find-thread-id ()
\r