database error
[notmuch-archives.git] / b4 / 5539608601e4bda80c5889936e7c8f9dfa3b2d
1 Return-Path: <notmuch@dima.secretsauce.net>\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 37A2C429E25\r
6         for <notmuch@notmuchmail.org>; Mon,  6 Jun 2011 23:26:14 -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: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id wlsI-vjzXz2j for <notmuch@notmuchmail.org>;\r
17         Mon,  6 Jun 2011 23:26:13 -0700 (PDT)\r
18 Received: from new1.smtp.messagingengine.com (new1.smtp.messagingengine.com\r
19         [66.111.4.221])\r
20         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 5F72B431FB6\r
23         for <notmuch@notmuchmail.org>; Mon,  6 Jun 2011 23:26:13 -0700 (PDT)\r
24 Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46])\r
25         by gateway1.messagingengine.com (Postfix) with ESMTP id 66CBB20247\r
26         for <notmuch@notmuchmail.org>; Tue,  7 Jun 2011 02:26:12 -0400 (EDT)\r
27 Received: from frontend1.messagingengine.com ([10.202.2.160])\r
28         by compute6.internal (MEProxy); Tue, 07 Jun 2011 02:26:12 -0400\r
29 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com;\r
30         h=date:from:to:subject:message-id:in-reply-to:references:mime-version:content-type;     s=smtpout; bh=tglnvRQ+XlHaEOUgJ3QZ5sNSxTU=;\r
31         b=LoM15Vh30JGUk6xAwdM4tcdPoBEi6Qw2SV26lVqweyjQzET/wGXSAs7BBNzT3nmMD+SaZSNMzxdllEHZ3PG4IGiMUJsg+vOEjYIPU7IAX1f2d8Bgd7EsUbLYBWs9HutOh1zvwDfwjMmsWZtNlZOmvWnLCd7wl2NjMKBYUdmEhb4=\r
32 X-Sasl-enc: z1eFREclrWg5EpLaxiwxA8OM9gPzYmcJInRfGsBuGLus 1307427971\r
33 Received: from smart (cpe-76-175-234-46.socal.res.rr.com [76.175.234.46])\r
34         by mail.messagingengine.com (Postfix) with ESMTPSA id 28718406830\r
35         for <notmuch@notmuchmail.org>; Tue,  7 Jun 2011 02:26:10 -0400 (EDT)\r
36 Date: Mon, 6 Jun 2011 23:26:20 -0700\r
37 From: Dima Kogan <notmuch@dima.secretsauce.net>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: Re: [PATCH] Added C-up and C-down to cycle through previous searches\r
40 Message-ID: <20110606232620.049fa55f@smart>\r
41 In-Reply-To: <87fwnopwhw.fsf@gmail.com>\r
42 References: <1306659388-21809-1-git-send-email-notmuch@dima.secretsauce.net>\r
43         <87vcwto5n3.fsf@gmail.com> <20110604130732.5d28fb68@smart>\r
44         <87fwnopwhw.fsf@gmail.com>\r
45 X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-pc-linux-gnu)\r
46 Mime-Version: 1.0\r
47 Content-Type: multipart/mixed; boundary="MP_/GUBy1g+ec3F+vRYS1FEBbzi"\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Tue, 07 Jun 2011 06:26:14 -0000\r
61 \r
62 --MP_/GUBy1g+ec3F+vRYS1FEBbzi\r
63 Content-Type: text/plain; charset=US-ASCII\r
64 Content-Transfer-Encoding: 7bit\r
65 Content-Disposition: inline\r
66 \r
67 > Notmuch uses a mix of 8 char width tabs and spaces.  First go tabs,\r
68 > then, if you need indenting with more precision, spaces.  Look at the\r
69 > lines your patch removes for an example.\r
70\r
71 > Also, .dir-locals.el sets some variables to configure Emacs for\r
72 > Notmuch coding style but only for c-mode.  You may set it by hand for\r
73 > lisp.\r
74 \r
75 Hi again. Here's the new patch, with M-n/M-p and tabbed indentation\r
76 \r
77 dima\r
78 --MP_/GUBy1g+ec3F+vRYS1FEBbzi\r
79 Content-Type: text/x-patch\r
80 Content-Transfer-Encoding: 7bit\r
81 Content-Disposition: attachment;\r
82  filename=0001-Added-M-n-and-M-p-to-cycle-through-previous-searches.patch\r
83 \r
84 >From 70193e0a9f7451033fd0843d46ac40e5524b000b Mon Sep 17 00:00:00 2001\r
85 From: Dima Kogan <dima@secretsauce.net>\r
86 Date: Mon, 6 Jun 2011 23:15:26 -0700\r
87 Subject: [PATCH] Added M-n and M-p to cycle through previous searches\r
88 \r
89 ---\r
90  emacs/notmuch-hello.el |   47 ++++++++++++++++++++++++++++++++++++++++-------\r
91  1 files changed, 40 insertions(+), 7 deletions(-)\r
92 \r
93 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
94 index 916cda1..035e551 100644\r
95 --- a/emacs/notmuch-hello.el\r
96 +++ b/emacs/notmuch-hello.el\r
97 @@ -123,6 +123,12 @@ Typically \",\" in the US and UK and \".\" in Europe."\r
98  \r
99  (defvar notmuch-hello-recent-searches nil)\r
100  \r
101 +(defvar notmuch-hello-cyclerecent-index 0\r
102 +  "The current index of the most-recent searches" )\r
103 +\r
104 +(defvar notmuch-hello-search-widget nil\r
105 +  "The search widget")\r
106 +\r
107  (defun notmuch-hello-remember-search (search)\r
108    (if (not (member search notmuch-hello-recent-searches))\r
109        (push search notmuch-hello-recent-searches))\r
110 @@ -148,6 +154,26 @@ Typically \",\" in the US and UK and \".\" in Europe."\r
111        (match-string 1 search)\r
112      search))\r
113  \r
114 +(defun notmuch-hello-cyclerecent-next ()\r
115 +  "Cycle through the most recently-searched queries, going forwards"\r
116 +  (interactive)\r
117 +  (notmuch-hello-cyclerecent 1))\r
118 +\r
119 +(defun notmuch-hello-cyclerecent-prev ()\r
120 +  "Cycle through the most recently-searched queries, going backwards"\r
121 +  (interactive)\r
122 +  (notmuch-hello-cyclerecent -1))\r
123 +\r
124 +(defun notmuch-hello-cyclerecent (d) ()\r
125 +  (when notmuch-hello-recent-searches ; if no recent searches, do nothing\r
126 +    (let ((N (length notmuch-hello-recent-searches)))\r
127 +      (setq notmuch-hello-cyclerecent-index\r
128 +           (% (+ notmuch-hello-cyclerecent-index d N) N))) ; update the index\r
129 +\r
130 +    (widget-value-set notmuch-hello-search-widget\r
131 +                     (nth notmuch-hello-cyclerecent-index notmuch-hello-recent-searches))\r
132 +    (widget-setup)))\r
133 +\r
134  (defun notmuch-hello-search (search)\r
135    (let ((search (notmuch-hello-trim search)))\r
136      (notmuch-hello-remember-search search)\r
137 @@ -455,13 +481,19 @@ Complete list of currently available key bindings:\r
138  \r
139         (widget-insert "\nSearch: ")\r
140         (setq notmuch-hello-search-bar-marker (point-marker))\r
141 -       (widget-create 'editable-field\r
142 -                      ;; Leave some space at the start and end of the\r
143 -                      ;; search boxes.\r
144 -                      :size (max 8 (- (window-width) notmuch-hello-indent\r
145 -                                      (length "Search: ")))\r
146 -                      :action (lambda (widget &rest ignore)\r
147 -                                (notmuch-hello-search (widget-value widget))))\r
148 +       (setq notmuch-hello-search-widget\r
149 +             (widget-create 'editable-field\r
150 +                            ;; Leave some space at the start and end of the\r
151 +                            ;; search boxes.\r
152 +                            :size (max 8 (- (window-width) notmuch-hello-indent\r
153 +                                            (length "Search: ")))\r
154 +                            :action (lambda (widget &rest ignore)\r
155 +                                      (notmuch-hello-search (widget-value widget)))\r
156 +                            :keymap (let ((map (make-sparse-keymap)))\r
157 +                                      (set-keymap-parent map widget-field-keymap)\r
158 +                                      (define-key map (kbd "M-p") 'notmuch-hello-cyclerecent-prev)\r
159 +                                      (define-key map (kbd "M-n") 'notmuch-hello-cyclerecent-next)\r
160 +                                      map)))\r
161         (widget-insert "\n")\r
162  \r
163         (when notmuch-hello-recent-searches\r
164 @@ -535,6 +567,7 @@ Complete list of currently available key bindings:\r
165         (widget-insert "Type a search query and hit RET to view matching threads.\n")\r
166         (when notmuch-hello-recent-searches\r
167           (widget-insert "Hit RET to re-submit a previous search. Edit it first if you like.\n")\r
168 +         (widget-insert "In the search box, M-n/M-p cycles through the recent searches.\n")\r
169           (widget-insert "Save recent searches with the `save' button.\n"))\r
170         (when notmuch-saved-searches\r
171           (widget-insert "Edit saved searches with the `edit' button.\n"))\r
172 -- \r
173 1.7.5.3\r
174 \r
175 \r
176 --MP_/GUBy1g+ec3F+vRYS1FEBbzi--\r