Re: [PATCH v2] VIM: Use notmuch CLI for config

Subject: Re: [PATCH v2] VIM: Use notmuch CLI for config

Date: Fri, 03 Oct 2014 11:41:12 -0700

To: David Bremner, David Bremner, notmuch@notmuchmail.org

Cc:

From: Ian Main


David Bremner wrote:
> Ian Main <imain@stemwinder.org> writes:
> 
> > This patch switches from reading .notmuch-config directly to using
> > the CLI the same way that emacs does it.  It actually uses less code
> > and is probably less error prone.
> >
> >     Ian
> 
> The general approach seems sane; it seems quite brittle to read the
> config file directly. I notice there is not really any error handling;
> OTOH, as far as I can read Ruby, there is not any in the previous
> version either.  Technically, this does add a dependency of the vim
> client on the CLI that did not exist before. Personally I don't find
> this onerous (even notmuch-vim users need "notmuch new", except in
> rather unusual circumstances.).
> 
> I'd like feedback/testing from actual vim interface users before
> merging.

I am actually just following suit on what was already being done.
The Vim client was already calling out to notmuch CLI for other things,
eg:

   system "notmuch show --format=mbox id:#{m.message_id} > #{mbox} && #{cmd}"

Is used to save the email for display in another program.  Also with no
error checking.  I think basically we are relying on rubys exception handling
to display errors to the user.. not the best idea but it is functional.

I could add a check for 'notmuch' binary.. especially there because loading
the config is the first thing that is done on startup.

    Ian

Thread: