Re: [PATCH v4 10/16] Add n_d_add_message_with_indexopts (extension of n_d_add_message)
[notmuch-archives.git] / 12 / 1671ccf7e822a8cbd004ca6e13fc9e5b82355e
1 Return-Path: <markwalters1009@gmail.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 7C147421198\r
6         for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 17:19:28 -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: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id IimSLn1iqxdU for <notmuch@notmuchmail.org>;\r
18         Sun, 12 Feb 2012 17:19:27 -0800 (PST)\r
19 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
20         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 76B8C421171\r
23         for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 17:19:27 -0800 (PST)\r
24 Received: by mail-wi0-f181.google.com with SMTP id hi8so3615406wib.26\r
25         for <notmuch@notmuchmail.org>; Sun, 12 Feb 2012 17:19:27 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=JoVR2Z6W7fGXZ6kRe/dVDRXYwLcmBIEgc1k9q8dCN20=;\r
29         b=r8lIjF79ZYAWcLFk32kFWWniyA4jbP/le1/4RnFVWi5nEzifcq3d9boiPKnVcRjT7J\r
30         oiRJ3x++hF0oOBhbVbPqq7OwFHp4JBRDmCfEG1S0ZKuyCJiOebFSyeWt4SQB/mxhmvrd\r
31         iKtGHUddShu/BWdAiJHcsEje3i8K/OMJ3reFg=\r
32 Received: by 10.216.135.76 with SMTP id t54mr5600836wei.14.1329095967213;\r
33         Sun, 12 Feb 2012 17:19:27 -0800 (PST)\r
34 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
35  [94.192.233.223])      by mx.google.com with ESMTPS id\r
36  ex2sm41853756wib.1.2012.02.12.17.19.25 (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Sun, 12 Feb 2012 17:19:26 -0800 (PST)\r
38 From: Mark Walters <markwalters1009@gmail.com>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [RFC PATCH v3 07/11] emacs: add entry to notmuch-pick from notmuch.el\r
41 Date: Mon, 13 Feb 2012 01:20:11 +0000\r
42 Message-Id: <1329096015-8078-8-git-send-email-markwalters1009@gmail.com>\r
43 X-Mailer: git-send-email 1.7.2.3\r
44 In-Reply-To: <1329072579-27340-1-git-send-email-markwalters1009@gmail.com>\r
45 References: <1329072579-27340-1-git-send-email-markwalters1009@gmail.com>\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: Mon, 13 Feb 2012 01:19:29 -0000\r
59 \r
60 Add bindings 'z' to enter a notmuch-pick search and 'Z' to go straight\r
61 to the current search (i.e. the on being viewed in notmuch.el buffer)\r
62 in notmuch-pick. Also add binding `M-RET' to view the currently selected\r
63 thread with notmuch-pick.\r
64 ---\r
65  emacs/notmuch.el |   20 ++++++++++++++++++++\r
66  1 files changed, 20 insertions(+), 0 deletions(-)\r
67 \r
68 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
69 index 5b4f1c5..28f7953 100644\r
70 --- a/emacs/notmuch.el\r
71 +++ b/emacs/notmuch.el\r
72 @@ -54,6 +54,7 @@\r
73  \r
74  (require 'notmuch-lib)\r
75  (require 'notmuch-show)\r
76 +(require 'notmuch-pick)\r
77  (require 'notmuch-mua)\r
78  (require 'notmuch-hello)\r
79  (require 'notmuch-maildir-fcc)\r
80 @@ -272,6 +273,8 @@ For a mouse binding, return nil."\r
81      (define-key map "R" 'notmuch-search-reply-to-thread)\r
82      (define-key map "m" 'notmuch-mua-new-mail)\r
83      (define-key map "s" 'notmuch-search)\r
84 +    (define-key map "z" 'notmuch-pick)\r
85 +    (define-key map "Z" 'notmuch-search-pick-current-query)\r
86      (define-key map "o" 'notmuch-search-toggle-order)\r
87      (define-key map "c" 'notmuch-search-stash-map)\r
88      (define-key map "=" 'notmuch-search-refresh-view)\r
89 @@ -284,6 +287,7 @@ For a mouse binding, return nil."\r
90      (define-key map "-" 'notmuch-search-remove-tag)\r
91      (define-key map "+" 'notmuch-search-add-tag)\r
92      (define-key map (kbd "RET") 'notmuch-search-show-thread)\r
93 +    (define-key map (kbd "M-RET") 'notmuch-search-pick-thread)\r
94      map)\r
95    "Keymap for \"notmuch search\" buffers.")\r
96  (fset 'notmuch-search-mode-map notmuch-search-mode-map)\r
97 @@ -1021,6 +1025,22 @@ same relative position within the new buffer."\r
98      (notmuch-search query oldest-first target-thread target-line continuation)\r
99      (goto-char (point-min))))\r
100  \r
101 +(defun notmuch-search-pick-current-query ()\r
102 +  "Call notmuch pick with the current query"\r
103 +  (interactive)\r
104 +  (notmuch-pick notmuch-search-query-string))\r
105 +\r
106 +(defun notmuch-search-pick-thread ()\r
107 +  "Show the selected thread with notmuch-pick"\r
108 +  (interactive)\r
109 +  (notmuch-pick (notmuch-search-find-thread-id)\r
110 +               notmuch-search-query-string\r
111 +               (notmuch-prettify-subject (notmuch-search-find-subject)))\r
112 +  (unless (notmuch-pick-get-match)\r
113 +    (notmuch-pick-next-message))\r
114 +  (notmuch-pick-show-message))\r
115 +\r
116 +\r
117  (defcustom notmuch-poll-script nil\r
118    "An external script to incorporate new mail into the notmuch database.\r
119  \r
120 -- \r
121 1.7.2.3\r
122 \r