From f3e3fe0aa479d8ea57e5fa8d780aac62ac46f569 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 27 Oct 2012 18:49:12 +0100 Subject: [PATCH] Re: [PATCH 1/3] contrib: add notmuch-pick.el file itself --- cf/457adc45b1095330295c6405f50c8f990c5662 | 117 ++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 cf/457adc45b1095330295c6405f50c8f990c5662 diff --git a/cf/457adc45b1095330295c6405f50c8f990c5662 b/cf/457adc45b1095330295c6405f50c8f990c5662 new file mode 100644 index 000000000..f4fbbb4fe --- /dev/null +++ b/cf/457adc45b1095330295c6405f50c8f990c5662 @@ -0,0 +1,117 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id C40BE431FBC + for ; Sat, 27 Oct 2012 10:49:23 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id MYISSDjxn1DD for ; + Sat, 27 Oct 2012 10:49:20 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id C26DD431FAF + for ; Sat, 27 Oct 2012 10:49:19 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1TSAVU-0001Zt-DO; Sat, 27 Oct 2012 18:49:12 +0100 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) + (envelope-from ) + id 1TSAVU-0003qh-2z; Sat, 27 Oct 2012 18:49:12 +0100 +From: Mark Walters +To: Ethan Glasser-Camp , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/3] contrib: add notmuch-pick.el file itself +In-Reply-To: <87txtfhl1j.fsf@betacantrips.com> +References: <1351337200-18050-1-git-send-email-markwalters1009@gmail.com> + <1351337200-18050-2-git-send-email-markwalters1009@gmail.com> + <87txtfhl1j.fsf@betacantrips.com> +User-Agent: Notmuch/0.14+69~g024ea36 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Sat, 27 Oct 2012 18:49:12 +0100 +Message-ID: <87d3034xgn.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: a57c5499b88c5782e17e5ad2d7938f13 (of first 20000 bytes) +X-SpamAssassin-Score: -1.8 +X-SpamAssassin-SpamBar: - +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -1.8 points. + Summary of the scoring: + * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, + * medium trust + * [138.37.6.40 listed in list.dnswl.org] + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.5 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 27 Oct 2012 17:49:23 -0000 + +On Sat, 27 Oct 2012, Ethan Glasser-Camp wrote: +> Mark Walters 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 + -- 2.26.2