[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 0a / d50f0806ca9de1cd76e59e4519cbc53ad7c014
1 Return-Path: <bremner@tesseract.cs.unb.ca>\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 arlo.cworth.org (Postfix) with ESMTP id 9510A6DE1B8C\r
6  for <notmuch@notmuchmail.org>; Sun,  5 Apr 2015 16:02:13 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.545\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.545 tagged_above=-999 required=5 tests=[AWL=0.535, \r
12  T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id r4w-LzeliZbN for <notmuch@notmuchmail.org>;\r
16  Sun,  5 Apr 2015 16:02:11 -0700 (PDT)\r
17 Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
18  [87.98.215.224])\r
19  by arlo.cworth.org (Postfix) with ESMTPS id 610DA6DE1B9D\r
20  for <notmuch@notmuchmail.org>; Sun,  5 Apr 2015 16:02:09 -0700 (PDT)\r
21 Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim\r
22  4.80) (envelope-from <bremner@tesseract.cs.unb.ca>)\r
23  id 1YetXj-0002p8-NY; Sun, 05 Apr 2015 23:01:27 +0000\r
24 Received: (nullmailer pid 2255 invoked by uid 1000); Sun, 05 Apr 2015\r
25  22:59:25 -0000\r
26 From: David Bremner <david@tethera.net>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [WIP2 10/12] emacs: convert notmuch-search to format-version 3\r
29 Date: Mon,  6 Apr 2015 07:59:12 +0900\r
30 Message-Id: <1428274754-1698-11-git-send-email-david@tethera.net>\r
31 X-Mailer: git-send-email 2.1.4\r
32 In-Reply-To: <1428274754-1698-1-git-send-email-david@tethera.net>\r
33 References: <1428274754-1698-1-git-send-email-david@tethera.net>\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.18\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: Sun, 05 Apr 2015 23:02:13 -0000\r
47 \r
48 XXX this checks every result to see if it is metadata. This might or\r
49     might not be innefficient\r
50 \r
51 XXX This ignores the actual metadata from the query. Should it do\r
52     something useful?\r
53 ---\r
54  emacs/notmuch-query.el |  5 +++++\r
55  emacs/notmuch.el       | 15 ++++++++-------\r
56  test/T310-emacs.sh     |  2 +-\r
57  3 files changed, 14 insertions(+), 8 deletions(-)\r
58 \r
59 diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el\r
60 index d1daffc..bfef22c 100644\r
61 --- a/emacs/notmuch-query.el\r
62 +++ b/emacs/notmuch-query.el\r
63 @@ -34,6 +34,11 @@ is a possibly empty forest of replies.\r
64      (setq args (append args search-terms))\r
65      (apply #'notmuch-call-notmuch-sexp args)))\r
66  \r
67 +\r
68 +(defun notmuch-query-metadata-p (result)\r
69 +  "Determine if the result is a \"metadata\" object (format-version 3)"\r
70 +  (plist-get result :query_type))\r
71 +\r
72  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
73  ;; Mapping functions across collections of messages.\r
74  \r
75 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
76 index ab00454..87caee4 100644\r
77 --- a/emacs/notmuch.el\r
78 +++ b/emacs/notmuch.el\r
79 @@ -793,12 +793,13 @@ non-authors is found, assume that all of the authors match."\r
80  \r
81  This is only called when a result is first inserted so it also\r
82  sets the :orig-tag property."\r
83 -  (let ((new-result (plist-put result :orig-tags (plist-get result :tags)))\r
84 -       (pos (point-max)))\r
85 -    (notmuch-search-show-result new-result pos)\r
86 -    (when (string= (plist-get result :thread) notmuch-search-target-thread)\r
87 -      (setq notmuch-search-target-thread "found")\r
88 -      (goto-char pos))))\r
89 +  (unless (notmuch-query-metadata-p result)\r
90 +    (let ((new-result (plist-put result :orig-tags (plist-get result :tags)))\r
91 +         (pos (point-max)))\r
92 +      (notmuch-search-show-result new-result pos)\r
93 +      (when (string= (plist-get result :thread) notmuch-search-target-thread)\r
94 +       (setq notmuch-search-target-thread "found")\r
95 +       (goto-char pos)))))\r
96  \r
97  (defun notmuch-search-process-filter (proc string)\r
98    "Process and filter the output of \"notmuch search\""\r
99 @@ -935,7 +936,7 @@ the configured default sort order."\r
100        (save-excursion\r
101         (let ((proc (notmuch-start-notmuch\r
102                      "notmuch-search" buffer #'notmuch-search-process-sentinel\r
103 -                    "search" "--format=sexp" "--format-version=2"\r
104 +                    "search" "--format=sexp" "--format-version=3"\r
105                      (if oldest-first\r
106                          "--sort=oldest-first"\r
107                        "--sort=newest-first")\r
108 diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh\r
109 index d72799b..f460923 100755\r
110 --- a/test/T310-emacs.sh\r
111 +++ b/test/T310-emacs.sh\r
112 @@ -897,7 +897,7 @@ YYY/notmuch_fail exited with status 1 (see *Notmuch errors* for more details)\r
113  === ERROR ===\r
114  [XXX]\r
115  YYY/notmuch_fail exited with status 1\r
116 -command: YYY/notmuch_fail search --format\=sexp --format-version\=2 --sort\=newest-first tag\:inbox\r
117 +command: YYY/notmuch_fail search --format\=sexp --format-version\=3 --sort\=newest-first tag\:inbox\r
118  exit status: 1"\r
119  \r
120  test_begin_subtest "Search handles subprocess warnings"\r
121 -- \r
122 2.1.4\r
123 \r