[PATCH v3 3/3] emacs: Code movement for the incremental JSON parser.
authorMark Walters <markwalters1009@gmail.com>
Wed, 24 Oct 2012 00:13:22 +0000 (01:13 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:00 +0000 (09:50 -0800)
9f/4399903136f2748610622eb7efbd1bb2f1b22e [new file with mode: 0644]

diff --git a/9f/4399903136f2748610622eb7efbd1bb2f1b22e b/9f/4399903136f2748610622eb7efbd1bb2f1b22e
new file mode 100644 (file)
index 0000000..d83b149
--- /dev/null
@@ -0,0 +1,126 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id BFFEA431FC9\r
+       for <notmuch@notmuchmail.org>; Tue, 23 Oct 2012 17:13:52 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id vEjqmUUP9CHL for <notmuch@notmuchmail.org>;\r
+       Tue, 23 Oct 2012 17:13:52 -0700 (PDT)\r
+Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com\r
+       [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id B1FB1431FC0\r
+       for <notmuch@notmuchmail.org>; Tue, 23 Oct 2012 17:13:51 -0700 (PDT)\r
+Received: by mail-wi0-f179.google.com with SMTP id hq7so3333696wib.2\r
+       for <notmuch@notmuchmail.org>; Tue, 23 Oct 2012 17:13:50 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=QemQXsgPh/2jIhYvWU40KTSnI0ZIdDYy8ZjGkLyZ6vY=;\r
+       b=cP6B6uBmST06m3/urN/MAUr46bU0UfMZtK4WfKqZve2fnYftS7k6YWkQDVyuKYO3gJ\r
+       8l8XisPicWHQC+pK7k4RE/5NYQbAAth0UBcVXjSEGhAPvXKZPdDtvSV6NNHNAmUpvIKP\r
+       UgcikvQ+tXgOdctGtaR/G3UTJCB0sYFFykIfI/apIy0VMIs4loIQc5oFTKghE3FIHnxO\r
+       Y97EL43ADFk6OWAyTmdZWGmOJtIV7QqluLWuuIJrkKjcuJZ6q+/0j9NquUgxlX2HAtCE\r
+       HhTftckZDvTLelsgpawLgJmVLI2QPV+0s5HudA89LXc+ZhRvzoJPkdEbH+pQ6aRV8UGb\r
+       tDnQ==\r
+Received: by 10.216.203.1 with SMTP id e1mr8827224weo.103.1351037630621;\r
+       Tue, 23 Oct 2012 17:13:50 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id f1sm1423272wiy.2.2012.10.23.17.13.49\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 23 Oct 2012 17:13:49 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 3/3] emacs: Code movement for the incremental JSON parser.\r
+Date: Wed, 24 Oct 2012 01:13:22 +0100\r
+Message-Id: <1351037602-11157-4-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1351037602-11157-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1351037602-11157-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 24 Oct 2012 00:13:53 -0000\r
+\r
+This just moves the notmuch-search-process-filter after the newly\r
+split out incremental json parser. I think this removes a warning in\r
+some versions of emacs.\r
+\r
+There should be no functional change.\r
+---\r
+ emacs/notmuch.el |   34 +++++++++++++++++-----------------\r
+ 1 files changed, 17 insertions(+), 17 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 7e5d052..ab253b7 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -818,23 +818,6 @@ non-authors is found, assume that all of the authors match."\r
+ (defvar notmuch-json-parser nil\r
+   "Internal Incremental JSON parser Object.")\r
\r
+-(defun notmuch-search-process-filter (proc string)\r
+-  "Process and filter the output of \"notmuch search\""\r
+-  (let ((results-buf (process-buffer proc))\r
+-      (parse-buf (process-get proc 'parse-buf))\r
+-      (inhibit-read-only t)\r
+-      done)\r
+-    (if (not (buffer-live-p results-buf))\r
+-      (delete-process proc)\r
+-      (with-current-buffer parse-buf\r
+-      ;; Insert new data\r
+-      (save-excursion\r
+-        (goto-char (point-max))\r
+-        (insert string))\r
+-      (notmuch-json-parse-partial-list 'notmuch-search-show-result\r
+-                                       'notmuch-search-show-error\r
+-                                       results-buf)))))\r
+-\r
+ (defun notmuch-json-parse-partial-list (result-function error-function results-buf)\r
+   "Parse a partial JSON list from current buffer.\r
\r
+@@ -884,6 +867,23 @@ RESULT-BUFFER to any input that was skipped."\r
+     ;; Clear out what we've parsed\r
+     (delete-region (point-min) (point))))\r
\r
++(defun notmuch-search-process-filter (proc string)\r
++  "Process and filter the output of \"notmuch search\""\r
++  (let ((results-buf (process-buffer proc))\r
++      (parse-buf (process-get proc 'parse-buf))\r
++      (inhibit-read-only t)\r
++      done)\r
++    (if (not (buffer-live-p results-buf))\r
++      (delete-process proc)\r
++      (with-current-buffer parse-buf\r
++      ;; Insert new data\r
++      (save-excursion\r
++        (goto-char (point-max))\r
++        (insert string))\r
++      (notmuch-json-parse-partial-list 'notmuch-search-show-result\r
++                                       'notmuch-search-show-error\r
++                                       results-buf)))))\r
++\r
+ (defun notmuch-search-tag-all (&optional tag-changes)\r
+   "Add/remove tags from all messages in current search buffer.\r
\r
+-- \r
+1.7.9.1\r
+\r