Re: [PATCH 1/3] contrib: add notmuch-pick.el file itself

Subject: Re: [PATCH 1/3] contrib: add notmuch-pick.el file itself

Date: Sat, 27 Oct 2012 18:49:12 +0100

To: Ethan Glasser-Camp, notmuch@notmuchmail.org

Cc:

From: Mark Walters


On Sat, 27 Oct 2012, Ethan Glasser-Camp <ethan.glasser.camp@gmail.com> wrote:
> Mark Walters <markwalters1009@gmail.com> writes:
>
>> +(defvar notmuch-pick-json-parser nil
>> +  "Incremental JSON parser for the search process filter.")
>> +
>> +(defun notmuch-pick-process-filter (proc string)
>> +  "Process and filter the output of \"notmuch show\" (for pick)"
>> +  (let ((results-buf (process-buffer proc))
>> +        (parse-buf (process-get proc 'parse-buf))
>> +        (inhibit-read-only t)
>> +        done)
>> +    (if (not (buffer-live-p results-buf))
>> +        (delete-process proc)
>> +      (with-current-buffer parse-buf
>> +        ;; Insert new data
>> +        (save-excursion
>> +          (goto-char (point-max))
>> +          (insert string)))
>> +      (with-current-buffer results-buf
>> +	(save-excursion
>> +	  (goto-char (point-max))
>> +	  (while (not done)
>> +	    (condition-case nil
>> +		(case notmuch-pick-process-state
>
> This looks awfully familiar. Not looking too close, but why can't this
> re-use the JSON parser from your other patch? Just not to rely on the
> other patch series?

I was not sure how long it would take to get the other series pushed,
and I realised that in its latest incarnation notmuch-pick could be
entirely in contrib so I thought that might be relatively easy to get
in.

If they both go in then I will submit a patch to make pick use the split
out parser. Similarly, if id:"87ehnw84e5.fsf@qmul.ac.uk" or something
similar goes in I can delete some code from pick.

Best wishes

Mark


Thread: