From c14d8b51a9e399e4133781a52428de81a71ec187 Mon Sep 17 00:00:00 2001 From: Ethan Glasser-Camp Date: Sun, 28 Oct 2012 13:39:04 +2000 Subject: [PATCH] Re: [PATCH 1/3] contrib: add notmuch-pick.el file itself --- 6b/28185a2f13192c63747a4992cbf4df4a186baf | 99 +++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 6b/28185a2f13192c63747a4992cbf4df4a186baf diff --git a/6b/28185a2f13192c63747a4992cbf4df4a186baf b/6b/28185a2f13192c63747a4992cbf4df4a186baf new file mode 100644 index 000000000..772d3ef2f --- /dev/null +++ b/6b/28185a2f13192c63747a4992cbf4df4a186baf @@ -0,0 +1,99 @@ +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 7A594431FBC + for ; Sat, 27 Oct 2012 10:39:08 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 NnCwQm6MT1Hq for ; + Sat, 27 Oct 2012 10:39:08 -0700 (PDT) +Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com + [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 10735431FAF + for ; Sat, 27 Oct 2012 10:39:08 -0700 (PDT) +Received: by mail-vc0-f181.google.com with SMTP id n11so4236943vch.26 + for ; Sat, 27 Oct 2012 10:39:07 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type; + bh=DZg7TkyvLZKeAc8oufVXtPwWk+cHtC5wwBcXIkbt6JE=; + b=OBXrOCpvZ1tvMOClNuiY0dTaTlYzvBIDab2qpq3hAiBCMFkETWVuq9WRsY2dUeNFUA + eizfB/FTPCb0U065mE10sM1L+OHAfL22Y4JNqlFVsxIBDJqkItkama21lK9kwCGTc8ra + Z9nQXcyDVrxEGhmMMmEjw29u/KKXESYkr3jbSpI5OKuDFKPnj+8vFT8uis6nn9amQhe8 + 4eeoxMyKPApud6hqMjQ6tU/59qc/xDWAnYqP3X65HFx/lZeUxRgFO51ayltBX68Kez2Y + CBWpyRWgmxy5egv997YyZZyN42Ps4vp0lC/YRodYsqnLy/aVQvUDT8FKZ9RFlL3ao2bI + 4iFA== +Received: by 10.52.23.199 with SMTP id o7mr33951020vdf.129.1351359547468; + Sat, 27 Oct 2012 10:39:07 -0700 (PDT) +Received: from smtp.gmail.com (cpe-74-70-7-64.nycap.res.rr.com. [74.70.7.64]) + by mx.google.com with ESMTPS id + l15sm2773841vdt.14.2012.10.27.10.39.05 + (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 27 Oct 2012 10:39:05 -0700 (PDT) +From: Ethan Glasser-Camp +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/3] contrib: add notmuch-pick.el file itself +In-Reply-To: <1351337200-18050-2-git-send-email-markwalters1009@gmail.com> +References: <1351337200-18050-1-git-send-email-markwalters1009@gmail.com> + <1351337200-18050-2-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.14+45~g6ea9330 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Sat, 27 Oct 2012 13:39:04 -0400 +Message-ID: <87txtfhl1j.fsf@betacantrips.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +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:39:08 -0000 + +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? + +Still, let's get this pushed. + +Ethan -- 2.26.2