[PATCH] emacs: hello: make --batch error gracefully

David Bremner david at tethera.net
Tue Jul 23 19:28:11 PDT 2013


Mark Walters <markwalters1009 at gmail.com> writes:
> -    (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"))
> +

I had a look at this, and I agree the current failure mode is not nice
(it just says something mysterious about nil not being a string). On the
other hand, I think we should use the two argument form of
notmuch-logged-error, and the the first argument should say only what we
know. Something like

(notmuch-logged-error "notmuch count --batch failed"
"notmuch count --batch failed
Please check that the notmuch CLI is new enough to  support `count
--batch'. In general we recommend running matching versions of the CLI
and emacs interface.")

d



More information about the notmuch mailing list