[PATCH 3/3] notmuch: Add support for listing the parent message
[notmuch-archives.git] / 26 / ac60a5bcdc428c518c56162f437fdfcfc633cd
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 2C69840D157\r
6         for <notmuch@notmuchmail.org>; Wed, 27 Oct 2010 10:27:31 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -4.2\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=unavailable\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 nq70tu+GAsBt for <notmuch@notmuchmail.org>;\r
16         Wed, 27 Oct 2010 10:27:18 -0700 (PDT)\r
17 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 0F65140D160\r
21         for <notmuch@notmuchmail.org>; Wed, 27 Oct 2010 10:27:08 -0700 (PDT)\r
22 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245])\r
23         by e23smtp06.au.ibm.com (8.14.4/8.13.1) with ESMTP id o9RHQuZk013102\r
24         for <notmuch@notmuchmail.org>; Thu, 28 Oct 2010 04:26:56 +1100\r
25 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138])\r
26         by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id\r
27         o9RHR4Yn1093864\r
28         for <notmuch@notmuchmail.org>; Thu, 28 Oct 2010 04:27:04 +1100\r
29 Received: from d23av02.au.ibm.com (loopback [127.0.0.1])\r
30         by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id\r
31         o9RHR4Ki031520\r
32         for <notmuch@notmuchmail.org>; Thu, 28 Oct 2010 04:27:04 +1100\r
33 Received: from skywalker.in.ibm.com ([9.77.207.27])\r
34         by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id\r
35         o9RHQxk7031146; Thu, 28 Oct 2010 04:27:03 +1100\r
36 From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>\r
37 To: cworth@cworth.org\r
38 Subject: [PATCH 3/3] notmuch: Add support for listing the parent message\r
39 Date: Wed, 27 Oct 2010 22:56:57 +0530\r
40 Message-Id: <1288200417-6584-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
41 X-Mailer: git-send-email 1.7.1\r
42 In-Reply-To:\r
43  <1288200417-6584-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
44 References: <1288200417-6584-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
45 Cc: "Aneesh Kumar K.V" <aneesh.kumar@gmail.com>, notmuch@notmuchmail.org\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Wed, 27 Oct 2010 17:27:31 -0000\r
59 \r
60 From: Aneesh Kumar K.V <aneesh.kumar@gmail.com>\r
61 \r
62 When you have long thread, it would be nice to be able to\r
63 show the message to which the current message is a reply\r
64 \r
65 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>\r
66 ---\r
67  emacs/notmuch-show.el |   12 ++++++++++++\r
68  1 files changed, 12 insertions(+), 0 deletions(-)\r
69 \r
70 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
71 index 3fc3787..139c44d 100644\r
72 --- a/emacs/notmuch-show.el\r
73 +++ b/emacs/notmuch-show.el\r
74 @@ -582,6 +582,7 @@ function is used. "\r
75         (define-key map " " 'notmuch-show-advance-and-archive)\r
76         (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)\r
77         (define-key map (kbd "RET") 'notmuch-show-toggle-message)\r
78 +       (define-key map "A" 'notmuch-show-search-parent)\r
79         map)\r
80        "Keymap for \"notmuch show\" buffers.")\r
81  (fset 'notmuch-show-mode-map notmuch-show-mode-map)\r
82 @@ -1095,4 +1096,15 @@ buffer."\r
83  \r
84  ;;\r
85  \r
86 +(defun notmuch-show-get-parent ()\r
87 +  (let ((id (notmuch-show-get-header :In-Reply-To)))\r
88 +    (if (string-match "^<\\(.*\\)>$" id)\r
89 +       (match-string 1 id)\r
90 +      id)))\r
91 +\r
92 +(defun notmuch-show-search-parent ()\r
93 +  "Search parent message"\r
94 +  (interactive)\r
95 +  (notmuch-search (concat "id:\"" (notmuch-show-get-parent) "\"")))\r
96 +\r
97  (provide 'notmuch-show)\r
98 -- \r
99 1.7.1\r
100 \r