[PATCH v4 1/5] man: clean up notmuch-emacs-mua man page
[notmuch-archives.git] / 94 / fb5b469a6fce9b52c83982d949b704d55b9500
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 AE894431FAE\r
6         for <notmuch@notmuchmail.org>; Sat, 25 May 2013 23:50:24 -0700 (PDT)\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 md-uCAPrUeLa for <notmuch@notmuchmail.org>;\r
18         Sat, 25 May 2013 23:50:20 -0700 (PDT)\r
19 Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com\r
20  [74.125.82.46])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  2BA80431FB6    for <notmuch@notmuchmail.org>; Sat, 25 May 2013 23:50:18 -0700\r
23  (PDT)\r
24 Received: by mail-wg0-f46.google.com with SMTP id l18so3514500wgh.25\r
25         for <notmuch@notmuchmail.org>; Sat, 25 May 2013 23:50:17 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=k3oLI12N5hwpZBw2iHurRwx61VNgThKDEsOMPczFG0g=;\r
29         b=ZOJUUw+/UXIkNQRqWWAEye8xDnn+3arqkcudv5kky/6ygZz0Fv4BP7RBy0XFVha0iL\r
30         QZy/ii5AQo1vzCIr1+56xEvfp3g1Hs04xx1OOdXjg/6qEFmC9Y2emqqaCSdE14c88h8j\r
31         nx/S0rN304fNnTCQoP8veWMgSDdsrb0ebnMYtRk72E65WxBDAP6cptVsO4UKUZP8FGhO\r
32         d/YTzsAftM/xSfNZ+LKppr8L3MhLUboX4JHDpcIxJD3iy2vYpyFpGBlpt9KYYZMxCAP7\r
33         WDFLZUYWz+5hNzMDAwpFnr/liwxDG+ThSOTYtZcjd+VU/is1LbAD2K+vFAQqDsVfIokE\r
34         41sg==\r
35 X-Received: by 10.194.77.15 with SMTP id o15mr4401036wjw.27.1369551017144;\r
36         Sat, 25 May 2013 23:50:17 -0700 (PDT)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPSA id fu14sm9032723wic.8.2013.05.25.23.50.16\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Sat, 25 May 2013 23:50:16 -0700 (PDT)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH 2/2] contrib: pick: fix refresh result\r
45 Date: Sun, 26 May 2013 07:50:08 +0100\r
46 Message-Id: <1369551008-30697-3-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1369551008-30697-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1369551008-30697-1-git-send-email-markwalters1009@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Sun, 26 May 2013 06:50:24 -0000\r
63 \r
64 The function notmuch-pick-refresh-result (used to update tag changes)\r
65 was not quite correct: sometimes it got the choice between the subject\r
66 and " ..." wrong. This was always true but the new code often calls\r
67 this (when opening a message in the message pane to remove the unread\r
68 tag) while the async pick process is still running and this caused\r
69 mistakes which made the tests fail.\r
70 \r
71 Thus we store the previous subject with the message.\r
72 ---\r
73  contrib/notmuch-pick/notmuch-pick.el |   23 +++++++++++++++++------\r
74  1 files changed, 17 insertions(+), 6 deletions(-)\r
75 \r
76 diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
77 index 9112989..46d9503 100644\r
78 --- a/contrib/notmuch-pick/notmuch-pick.el\r
79 +++ b/contrib/notmuch-pick/notmuch-pick.el\r
80 @@ -264,8 +264,15 @@ Some useful entries are:\r
81         (msg (notmuch-pick-get-message-properties))\r
82         (inhibit-read-only t))\r
83      (beginning-of-line)\r
84 -    (delete-region (point) (1+ (line-end-position)))\r
85 -    (notmuch-pick-insert-msg msg)\r
86 +    ;; This is a little tricky: we override\r
87 +    ;; notmuch-pick-previous-subject to get the decision between\r
88 +    ;; ... and a subject right and it stops notmuch-pick-insert-msg\r
89 +    ;; from overwriting the buffer local copy of\r
90 +    ;; notmuch-pick-previous-subject if this is called while the\r
91 +    ;; buffer is displaying.\r
92 +    (let ((notmuch-pick-previous-subject (notmuch-pick-get-prop :previous-subject)))\r
93 +      (delete-region (point) (1+ (line-end-position)))\r
94 +      (notmuch-pick-insert-msg msg))\r
95      (let ((new-end (line-end-position)))\r
96        (goto-char (if (= init-point end)\r
97                      new-end\r
98 @@ -628,10 +635,14 @@ unchanged ADDRESS if parsing fails."\r
99  \r
100  (defun notmuch-pick-insert-msg (msg)\r
101    "Insert the message MSG according to notmuch-pick-result-format"\r
102 -  (dolist (spec notmuch-pick-result-format)\r
103 -    (notmuch-pick-insert-field (car spec) (cdr spec) msg))\r
104 -  (notmuch-pick-set-message-properties msg)\r
105 -  (insert "\n"))\r
106 +  ;; We need to save the previous subject as it will get overwritten\r
107 +  ;; by the insert-field calls.\r
108 +  (let ((previous-subject notmuch-pick-previous-subject))\r
109 +    (dolist (spec notmuch-pick-result-format)\r
110 +      (notmuch-pick-insert-field (car spec) (cdr spec) msg))\r
111 +    (notmuch-pick-set-message-properties msg)\r
112 +    (notmuch-pick-set-prop :previous-subject previous-subject)\r
113 +    (insert "\n")))\r
114  \r
115  (defun notmuch-pick-goto-and-insert-msg (msg)\r
116    "Insert msg at the end of the buffer. Move point to msg if it is the target"\r
117 -- \r
118 1.7.9.1\r
119 \r