Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / e9 / 9d3a09685567504f32fc26ca6c00c798904d97
1 Return-Path: <bremner@tesseract.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 53F3E431FB6\r
6         for <notmuch@notmuchmail.org>; Sat, 28 Mar 2015 03:31:41 -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: 2.438\r
10 X-Spam-Level: **\r
11 X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
12         tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled\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 dw+f7+ZeOvzX for <notmuch@notmuchmail.org>;\r
16         Sat, 28 Mar 2015 03:31:38 -0700 (PDT)\r
17 Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
18         [87.98.215.224])\r
19         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 0C5DE431FAF\r
22         for <notmuch@notmuchmail.org>; Sat, 28 Mar 2015 03:31:38 -0700 (PDT)\r
23 Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim\r
24         4.80) (envelope-from <bremner@tesseract.cs.unb.ca>)\r
25         id 1Ybo0i-00036r-DM; Sat, 28 Mar 2015 10:30:36 +0000\r
26 Received: (nullmailer pid 1432 invoked by uid 1000); Sat, 28 Mar 2015\r
27         10:30:23 -0000\r
28 From: David Bremner <david@tethera.net>\r
29 To: Sebastian Fischmeister <sfischme@uwaterloo.ca>, David Bremner\r
30         <david@tethera.net>, notmuch <notmuch@notmuchmail.org>\r
31 Subject: [PATCH] emacs: print messages when starting and ending notmuch\r
32  queries\r
33 Date: Sat, 28 Mar 2015 11:30:17 +0100\r
34 Message-Id: <1427538617-1324-1-git-send-email-david@tethera.net>\r
35 X-Mailer: git-send-email 2.1.4\r
36 In-Reply-To: <87vbhpvp0x.fsf@uwaterloo.ca>\r
37 References: <87vbhpvp0x.fsf@uwaterloo.ca>\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Sat, 28 Mar 2015 10:31:41 -0000\r
51 \r
52 For slow queries, it is possible for a second query to block while the\r
53 first is still running.  This has the unfortunate effect that it is\r
54 impossible for the user to know if the query returned no results, or\r
55 if it is still running.  This change tries to remedy this by printing\r
56 messages in the echo area when starting and finishing queries.\r
57 ---\r
58 \r
59 I'm curious what people think about this possible change. It does make\r
60 the whole UI a bit noisier for fast queries.  OTOH, it seems simpler than trying to mess with the results buffer or mode line.\r
61 \r
62  emacs/notmuch.el | 4 ++++\r
63  1 file changed, 4 insertions(+)\r
64 \r
65 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
66 index ab00454..cb8ddef 100644\r
67 --- a/emacs/notmuch.el\r
68 +++ b/emacs/notmuch.el\r
69 @@ -616,6 +616,7 @@ of the result."\r
70    (let ((buffer (process-buffer proc))\r
71         (status (process-status proc))\r
72         (exit-status (process-exit-status proc))\r
73 +       (query (process-get proc 'query))\r
74         (never-found-target-thread nil))\r
75      (when (memq status '(exit signal))\r
76        (catch 'return\r
77 @@ -629,6 +630,7 @@ of the result."\r
78                   (if (eq status 'signal)\r
79                       (insert "Incomplete search results (search process was killed).\n"))\r
80                   (when (eq status 'exit)\r
81 +                   (message "notmuch query %s complete" query)\r
82                     (insert "End of search results.\n")\r
83                     ;; For version mismatch, there's no point in\r
84                     ;; showing the search buffer\r
85 @@ -931,6 +933,7 @@ the configured default sort order."\r
86           (error "notmuch search process already running for query `%s'" query)\r
87         )\r
88        (erase-buffer)\r
89 +      (message "running notmuch query %s..." query)\r
90        (goto-char (point-min))\r
91        (save-excursion\r
92         (let ((proc (notmuch-start-notmuch\r
93 @@ -945,6 +948,7 @@ the configured default sort order."\r
94               ;; should be called no matter how the process dies.\r
95               (parse-buf (generate-new-buffer " *notmuch search parse*")))\r
96           (process-put proc 'parse-buf parse-buf)\r
97 +         (process-put proc 'query query)\r
98           (set-process-filter proc 'notmuch-search-process-filter)\r
99           (set-process-query-on-exit-flag proc nil))))\r
100      (run-hooks 'notmuch-search-hook)))\r
101 -- \r
102 2.1.4\r
103 \r