From 5ad01c53b49b382012e87cc073af5b9a72e4514f Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 28 Mar 2015 11:30:17 +0100 Subject: [PATCH] [PATCH] emacs: print messages when starting and ending notmuch queries --- e9/9d3a09685567504f32fc26ca6c00c798904d97 | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 e9/9d3a09685567504f32fc26ca6c00c798904d97 diff --git a/e9/9d3a09685567504f32fc26ca6c00c798904d97 b/e9/9d3a09685567504f32fc26ca6c00c798904d97 new file mode 100644 index 000000000..71e91d7cc --- /dev/null +++ b/e9/9d3a09685567504f32fc26ca6c00c798904d97 @@ -0,0 +1,103 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 53F3E431FB6 + for ; Sat, 28 Mar 2015 03:31:41 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id dw+f7+ZeOvzX for ; + Sat, 28 Mar 2015 03:31:38 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0C5DE431FAF + for ; Sat, 28 Mar 2015 03:31:38 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.80) (envelope-from ) + id 1Ybo0i-00036r-DM; Sat, 28 Mar 2015 10:30:36 +0000 +Received: (nullmailer pid 1432 invoked by uid 1000); Sat, 28 Mar 2015 + 10:30:23 -0000 +From: David Bremner +To: Sebastian Fischmeister , David Bremner + , notmuch +Subject: [PATCH] emacs: print messages when starting and ending notmuch + queries +Date: Sat, 28 Mar 2015 11:30:17 +0100 +Message-Id: <1427538617-1324-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <87vbhpvp0x.fsf@uwaterloo.ca> +References: <87vbhpvp0x.fsf@uwaterloo.ca> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 28 Mar 2015 10:31:41 -0000 + +For slow queries, it is possible for a second query to block while the +first is still running. This has the unfortunate effect that it is +impossible for the user to know if the query returned no results, or +if it is still running. This change tries to remedy this by printing +messages in the echo area when starting and finishing queries. +--- + +I'm curious what people think about this possible change. It does make +the whole UI a bit noisier for fast queries. OTOH, it seems simpler than trying to mess with the results buffer or mode line. + + emacs/notmuch.el | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index ab00454..cb8ddef 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -616,6 +616,7 @@ of the result." + (let ((buffer (process-buffer proc)) + (status (process-status proc)) + (exit-status (process-exit-status proc)) ++ (query (process-get proc 'query)) + (never-found-target-thread nil)) + (when (memq status '(exit signal)) + (catch 'return +@@ -629,6 +630,7 @@ of the result." + (if (eq status 'signal) + (insert "Incomplete search results (search process was killed).\n")) + (when (eq status 'exit) ++ (message "notmuch query %s complete" query) + (insert "End of search results.\n") + ;; For version mismatch, there's no point in + ;; showing the search buffer +@@ -931,6 +933,7 @@ the configured default sort order." + (error "notmuch search process already running for query `%s'" query) + ) + (erase-buffer) ++ (message "running notmuch query %s..." query) + (goto-char (point-min)) + (save-excursion + (let ((proc (notmuch-start-notmuch +@@ -945,6 +948,7 @@ the configured default sort order." + ;; should be called no matter how the process dies. + (parse-buf (generate-new-buffer " *notmuch search parse*"))) + (process-put proc 'parse-buf parse-buf) ++ (process-put proc 'query query) + (set-process-filter proc 'notmuch-search-process-filter) + (set-process-query-on-exit-flag proc nil)))) + (run-hooks 'notmuch-search-hook))) +-- +2.1.4 + -- 2.26.2