Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 02 / b8020badc872a9044d3e4995c07092aceadf03
1 Return-Path: <dme@ut.hh.sledj.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 2134A41A546\r
6         for <notmuch@notmuchmail.org>; Tue, 30 Nov 2010 03:00:46 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 1.363\r
10 X-Spam-Level: *\r
11 X-Spam-Status: No, score=1.363 tagged_above=-999 required=5\r
12         tests=[RDNS_DYNAMIC=0.363, TO_NO_BRKTS_DYNIP=1] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id B7ELlyp1I-7G for <notmuch@notmuchmail.org>;\r
16         Tue, 30 Nov 2010 03:00:44 -0800 (PST)\r
17 Received: from ut.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com\r
18         [81.149.164.25])\r
19         (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 7D64441A541\r
22         for <notmuch@notmuchmail.org>; Tue, 30 Nov 2010 03:00:43 -0800 (PST)\r
23 Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
24         id 69DD0594235; Tue, 30 Nov 2010 11:00:28 +0000 (GMT)\r
25 From: David Edmondson <dme@dme.org>\r
26 To: notmuch@notmuchmail.org\r
27 Subject: [PATCH 2/4] emacs: Use a plists rather than an assoc list in JSON\r
28         search.\r
29 Date: Tue, 30 Nov 2010 11:00:23 +0000\r
30 Message-Id: <1291114825-3513-2-git-send-email-dme@dme.org>\r
31 X-Mailer: git-send-email 1.7.2.3\r
32 In-Reply-To: <1291026599-14795-4-git-send-email-dme@dme.org>\r
33 References: <1291026599-14795-4-git-send-email-dme@dme.org>\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.13\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38         <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Tue, 30 Nov 2010 11:00:46 -0000\r
47 \r
48 For commonality with the `notmuch-show' code, prefer plists over\r
49 associative lists.\r
50 ---\r
51  emacs/notmuch.el |   17 +++++++++--------\r
52  1 files changed, 9 insertions(+), 8 deletions(-)\r
53 \r
54 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
55 index f4aefc8..d561c6e 100644\r
56 --- a/emacs/notmuch.el\r
57 +++ b/emacs/notmuch.el\r
58 @@ -700,14 +700,14 @@ foreground and blue background."\r
59    (insert "\n"))\r
60  \r
61  (defun notmuch-search-process-insert-object (object)\r
62 -  (let* ((thread-id (concat "thread:" (cdr (assoc 'thread object))))\r
63 -        (date (format "%12s" (cdr (assoc 'date_relative object))))\r
64 +  (let* ((thread-id (concat "thread:" (plist-get object :thread)))\r
65 +        (date (format "%12s" (plist-get object :date_relative)))\r
66          (count (format "[%d/%d]"\r
67 -                       (cdr (assoc 'matched object))\r
68 -                       (cdr (assoc 'total object))))\r
69 -        (authors (cdr (assoc 'authors object)))\r
70 -        (subject (cdr (assoc 'subject object)))\r
71 -        (tag-list (cdr (assoc 'tags object)))\r
72 +                       (plist-get object :matched)\r
73 +                       (plist-get object :total)))\r
74 +        (authors (plist-get object :authors))\r
75 +        (subject (plist-get object :subject))\r
76 +        (tag-list (plist-get object :tags))\r
77          (tags (mapconcat 'identity tag-list " "))\r
78          (beg (point-marker)))\r
79      (notmuch-search-show-result date count authors subject tags)\r
80 @@ -724,7 +724,8 @@ foreground and blue background."\r
81      (let ((inhibit-read-only t)\r
82           (inhibit-redisplay t)\r
83           ;; Vectors are not as useful here.\r
84 -         (json-array-type 'list))\r
85 +         (json-array-type 'list)\r
86 +         (json-object-type 'plist))\r
87        (save-excursion\r
88         ;; Insert the text, advancing the process marker\r
89         (goto-char (point-max))\r
90 -- \r
91 1.7.2.3\r
92 \r