--- /dev/null
+Return-Path: <dme@ut.hh.sledj.net>\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 44FDE41A547\r
+ for <notmuch@notmuchmail.org>; Tue, 30 Nov 2010 03:00:41 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.363\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.363 tagged_above=-999 required=5\r
+ tests=[RDNS_DYNAMIC=0.363, TO_NO_BRKTS_DYNIP=1] 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 F35gGCu46gRD for <notmuch@notmuchmail.org>;\r
+ Tue, 30 Nov 2010 03:00:40 -0800 (PST)\r
+Received: from ut.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com\r
+ [81.149.164.25])\r
+ (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id D2A80431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 30 Nov 2010 03:00:39 -0800 (PST)\r
+Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
+ id 6CA1A59422B; Tue, 30 Nov 2010 11:00:29 +0000 (GMT)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 4/4] emacs: Fix indentation, add comments.\r
+Date: Tue, 30 Nov 2010 11:00:25 +0000\r
+Message-Id: <1291114825-3513-4-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 1.7.2.3\r
+In-Reply-To: <1291026599-14795-4-git-send-email-dme@dme.org>\r
+References: <1291026599-14795-4-git-send-email-dme@dme.org>\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: Tue, 30 Nov 2010 11:00:41 -0000\r
+\r
+`inhibit-redisplay' makes debugging hard - note this in a comment.\r
+---\r
+ emacs/notmuch.el | 81 ++++++++++++++++++++++++++++--------------------------\r
+ 1 files changed, 42 insertions(+), 39 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index d561c6e..20d954b 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -722,10 +722,13 @@ foreground and blue background."\r
+ (defun notmuch-search-process-insert (proc buffer string)\r
+ (with-current-buffer buffer\r
+ (let ((inhibit-read-only t)\r
++ ;; Comment out this next line to allow useful single-step\r
++ ;; during debugging.\r
+ (inhibit-redisplay t)\r
+ ;; Vectors are not as useful here.\r
+ (json-array-type 'list)\r
+ (json-object-type 'plist))\r
++\r
+ (save-excursion\r
+ ;; Insert the text, advancing the process marker\r
+ (goto-char (point-max))\r
+@@ -739,46 +742,46 @@ foreground and blue background."\r
+ \r
+ (save-excursion\r
+ (goto-char notmuch-search-parse-start)\r
+- (while\r
+- (let ((next-char (json-peek)))\r
+- (cond\r
+- ;; No more data (yet).\r
+- ((eq next-char :json-eof)\r
+- nil)\r
+-\r
+- ;; Opening bracket or comma separator between\r
+- ;; objects.\r
+- ((or (char-equal next-char ?\[)\r
+- (char-equal next-char ?\,))\r
+- (json-advance)\r
+- (delete-region notmuch-search-parse-start (point))\r
+- t)\r
+-\r
+- ;; Closing array.\r
+- ((char-equal next-char ?\])\r
+- ;; Consume both the closing bracket and any trailing\r
+- ;; whitespace (typically a carriage return).\r
+- (json-advance)\r
+- (json-skip-whitespace)\r
+- (delete-region notmuch-search-parse-start (point))\r
+- nil)\r
+-\r
+- ;; Single object.\r
+- ((condition-case nil\r
+- (let ((object (json-read-object)))\r
+- ;; Delete the object that we consumed.\r
+- (delete-region notmuch-search-parse-start (point))\r
+- ;; Insert the corresponding results.\r
+- (notmuch-search-process-insert-object object)\r
+- t)\r
+- (error nil)))))\r
+-\r
+- ;; Consume any white space between terms.\r
+- (let ((p (point)))\r
++ (while\r
++ (let ((next-char (json-peek)))\r
++ (cond\r
++ ;; No more data (yet).\r
++ ((eq next-char :json-eof)\r
++ nil)\r
++\r
++ ;; Opening bracket or comma separator between\r
++ ;; objects.\r
++ ((or (char-equal next-char ?\[)\r
++ (char-equal next-char ?\,))\r
++ (json-advance)\r
++ (delete-region notmuch-search-parse-start (point))\r
++ t)\r
++\r
++ ;; Closing array.\r
++ ((char-equal next-char ?\])\r
++ ;; Consume both the closing bracket and any trailing\r
++ ;; whitespace (typically a carriage return).\r
++ (json-advance)\r
+ (json-skip-whitespace)\r
+- (delete-region p (point)))\r
+- ;; Remember where we got up to.\r
+- (setq notmuch-search-parse-start (point)))))))\r
++ (delete-region notmuch-search-parse-start (point))\r
++ nil)\r
++\r
++ ;; Single object.\r
++ ((condition-case nil\r
++ (let ((object (json-read-object)))\r
++ ;; Delete the object that we consumed.\r
++ (delete-region notmuch-search-parse-start (point))\r
++ ;; Insert the corresponding results.\r
++ (notmuch-search-process-insert-object object)\r
++ t)\r
++ (error nil)))))\r
++\r
++ ;; Consume any white space between terms.\r
++ (let ((p (point)))\r
++ (json-skip-whitespace)\r
++ (delete-region p (point)))\r
++ ;; Remember where we got up to.\r
++ (setq notmuch-search-parse-start (point)))))))\r
+ \r
+ (defun notmuch-search-process-filter (proc string)\r
+ "Process and filter the output of `notmuch search'."\r
+-- \r
+1.7.2.3\r
+\r