unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: hello: make --batch error gracefully
@ 2013-07-04 22:18 Mark Walters
  2013-07-06  9:06 ` Tomi Ollila
  2013-07-24  2:28 ` David Bremner
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Walters @ 2013-07-04 22:18 UTC (permalink / raw)
  To: notmuch

Recently notmuch-hello was converted to use batch count. However, it
seems that several people run different versions of notmuch-emacs and
notmuch-cli so this batch makes emacs fail with an error message if
--batch is not available in the CLI.
---
There have been two cases on irc of people getting backtraces when
hitting this problem so it might be worth adding an informative error
message.

Best wishes

Mark

 emacs/notmuch-hello.el |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 147c08c..fa46b7a 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -402,8 +402,13 @@ options will be handled as specified for
 					   (plist-get options :filter)))
 	 "\n")))
 
-    (call-process-region (point-min) (point-max) notmuch-command
-			 t t nil "count" "--batch")
+    (unless (= (call-process-region (point-min) (point-max) notmuch-command
+				    t t nil "count" "--batch") 0)
+      (notmuch-logged-error "notmuch CLI version mismatch error (count --batch)
+The most likely cause of this error is that the CLI is too old
+to support count --batch and needs to be upgraded to the same
+version as notmuch-emacs"))
+
     (goto-char (point-min))
 
     (notmuch-remove-if-not
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-27 21:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-04 22:18 [PATCH] emacs: hello: make --batch error gracefully Mark Walters
2013-07-06  9:06 ` Tomi Ollila
2013-07-07 10:21   ` Mark Walters
2013-07-13  8:06     ` Tomi Ollila
2013-07-24  2:28 ` David Bremner
2013-07-27 21:52   ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).