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

Mark Walters markwalters1009 at gmail.com
Sat Oct 27 10:49:12 PDT 2012


On Sat, 27 Oct 2012, Ethan Glasser-Camp <ethan.glasser.camp at gmail.com> wrote:
> Mark Walters <markwalters1009 at 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 at qmul.ac.uk" or something
similar goes in I can delete some code from pick.

Best wishes

Mark



More information about the notmuch mailing list