database error
[notmuch-archives.git] / 89 / e3a5afe08b214dd707a52dbc95501c7aff6c41
1 Return-Path: <markwalters1009@gmail.com>\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 D2335431FAF\r
6         for <notmuch@notmuchmail.org>; Thu,  1 Mar 2012 14:29:52 -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: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id InBP-QeCsMPo for <notmuch@notmuchmail.org>;\r
18         Thu,  1 Mar 2012 14:29:51 -0800 (PST)\r
19 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
20         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id D4729431FDA\r
23         for <notmuch@notmuchmail.org>; Thu,  1 Mar 2012 14:29:48 -0800 (PST)\r
24 Received: by mail-we0-f181.google.com with SMTP id m13so775491wer.26\r
25         for <notmuch@notmuchmail.org>; Thu, 01 Mar 2012 14:29:48 -0800 (PST)\r
26 Received-SPF: pass (google.com: domain of markwalters1009@gmail.com designates\r
27         10.180.82.227 as permitted sender) client-ip=10.180.82.227; \r
28 Authentication-Results: mr.google.com; spf=pass (google.com: domain of\r
29         markwalters1009@gmail.com designates 10.180.82.227 as permitted\r
30         sender) smtp.mail=markwalters1009@gmail.com;\r
31         dkim=pass header.i=markwalters1009@gmail.com\r
32 Received: from mr.google.com ([10.180.82.227])\r
33         by 10.180.82.227 with SMTP id l3mr15012262wiy.1.1330640988710 (num_hops\r
34         = 1); Thu, 01 Mar 2012 14:29:48 -0800 (PST)\r
35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
36         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
37         bh=HXooxiQR2Gh1c1aSByOtrG10GZvrOkR/KUAglx4PYE4=;\r
38         b=1CbucXD5M2KNUvdNENFKsvLvopkanCHPQhKfhdJcbt1GIhXwAuiBey4N/iqugRgMnx\r
39         +8umxqL3lqjK1S8MvgsGWu2hLv/5LYt5R4TfxIFN7KVUXOpmbdMJHj/r5f2ZUCJjwDSk\r
40         Vrrd2NYPx3LMFXkDkba2QP9tb9FeRBLB6svbOiru2YBMjC2gRdFmnxOkXkG9pjyUvh6a\r
41         GQYo8XyCeNEL4I+Vf3mLeEVzbEA3nOrniHi2PetZyfPCngGICMcSlaZAjHPYP6HZKdh+\r
42         G2p3/Ybpgaa7gHwKhu9xtIvIUQCeKzlbpo9l626McA9ALhSny/oC0e9PeUX1VXvaZEUK\r
43         qs+g==\r
44 Received: by 10.180.82.227 with SMTP id l3mr12054064wiy.1.1330640988659;\r
45         Thu, 01 Mar 2012 14:29:48 -0800 (PST)\r
46 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
47  [94.192.233.223])      by mx.google.com with ESMTPS id\r
48  h19sm44658185wiw.9.2012.03.01.14.29.46 (version=TLSv1/SSLv3 cipher=OTHER);\r
49         Thu, 01 Mar 2012 14:29:47 -0800 (PST)\r
50 From: Mark Walters <markwalters1009@gmail.com>\r
51 To: notmuch@notmuchmail.org\r
52 Subject: [Patch v7 12/13] emacs: show: recognize the exclude flag.\r
53 Date: Thu,  1 Mar 2012 22:30:44 +0000\r
54 Message-Id: <1330641045-27416-13-git-send-email-markwalters1009@gmail.com>\r
55 X-Mailer: git-send-email 1.7.2.3\r
56 In-Reply-To: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com>\r
57 References: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com>\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Thu, 01 Mar 2012 22:29:53 -0000\r
71 \r
72 Show mode will recognize the exclude flag by not opening excluding\r
73 messages by default, and will start at the first matching non-excluded\r
74 message. If there are no matching non-excluded messages it will go to\r
75 the first matching (necessarily excluded) message.\r
76 ---\r
77  emacs/notmuch-show.el |   36 +++++++++++++++++++++++++++---------\r
78  1 files changed, 27 insertions(+), 9 deletions(-)\r
79 \r
80 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
81 index 7c4c0be..4a60631 100644\r
82 --- a/emacs/notmuch-show.el\r
83 +++ b/emacs/notmuch-show.el\r
84 @@ -981,7 +981,8 @@ current buffer, if possible."\r
85  \r
86      ;; Message visibility depends on whether it matched the search\r
87      ;; criteria.\r
88 -    (notmuch-show-message-visible msg (plist-get msg :match))))\r
89 +    (notmuch-show-message-visible msg (and (plist-get msg :match)\r
90 +                                          (not (plist-get msg :excluded))))))\r
91  \r
92  (defun notmuch-show-toggle-process-crypto ()\r
93    "Toggle the processing of cryptographic MIME parts."\r
94 @@ -1081,11 +1082,7 @@ function is used."\r
95           notmuch-show-parent-buffer parent-buffer\r
96           notmuch-show-query-context query-context)\r
97      (notmuch-show-build-buffer)\r
98 -\r
99 -    ;; Move to the first open message and mark it read\r
100 -    (if (notmuch-show-message-visible-p)\r
101 -       (notmuch-show-mark-read)\r
102 -      (notmuch-show-next-open-message))))\r
103 +    (notmuch-show-goto-first-wanted-message)))\r
104  \r
105  (defun notmuch-show-build-buffer ()\r
106    (let ((inhibit-read-only t))\r
107 @@ -1167,9 +1164,7 @@ reset based on the original query."\r
108         (notmuch-show-apply-state state)\r
109        ;; We're resetting state, so navigate to the first open message\r
110        ;; and mark it read, just like opening a new show buffer.\r
111 -      (if (notmuch-show-message-visible-p)\r
112 -         (notmuch-show-mark-read)\r
113 -       (notmuch-show-next-open-message)))))\r
114 +      (notmuch-show-goto-first-wanted-message))))\r
115  \r
116  (defvar notmuch-show-stash-map\r
117    (let ((map (make-sparse-keymap)))\r
118 @@ -1601,6 +1596,29 @@ to show, nil otherwise."\r
119         (goto-char (point-max))))\r
120      r))\r
121  \r
122 +(defun notmuch-show-next-matching-message ()\r
123 +  "Show the next matching message."\r
124 +  (interactive)\r
125 +  (let (r)\r
126 +    (while (and (setq r (notmuch-show-goto-message-next))\r
127 +               (not (notmuch-show-get-prop :match))))\r
128 +    (if r\r
129 +       (progn\r
130 +         (notmuch-show-mark-read)\r
131 +         (notmuch-show-message-adjust))\r
132 +      (goto-char (point-max)))))\r
133 +\r
134 +(defun notmuch-show-goto-first-wanted-message ()\r
135 +  "Move to the first open message and mark it read"\r
136 +  (goto-char (point-min))\r
137 +  (if (notmuch-show-message-visible-p)\r
138 +      (notmuch-show-mark-read)\r
139 +    (notmuch-show-next-open-message))\r
140 +  (when (eobp)\r
141 +    (goto-char (point-min))\r
142 +    (unless (notmuch-show-get-prop :match)\r
143 +      (notmuch-show-next-matching-message))))\r
144 +\r
145  (defun notmuch-show-previous-open-message ()\r
146    "Show the previous open message."\r
147    (interactive)\r
148 -- \r
149 1.7.2.3\r
150 \r