Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 66 / 0fad8539122ba671f94ea7421d87800c32e67c
1 Return-Path: <dmitry.kurochkin@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 2AD03431FBC\r
6         for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 18:28:30 -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.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 0IuB5uKf2Hpa for <notmuch@notmuchmail.org>;\r
17         Sun, 29 Jan 2012 18:28:28 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 15835421181\r
22         for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 18:27:54 -0800 (PST)\r
23 Received: by mail-bk0-f53.google.com with SMTP id 11so960260bke.26\r
24         for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 18:27:54 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=koECAv77ZnQagpNvAf+1eBUKUpoAqA0fyijQha0nnew=;\r
28         b=Tn+pbum9eFn50U/+vp0AYsFPTeviNGMaxM9+uRZlz88he2Z11U2MBYoY7fA6mGUNth\r
29         d2Fo+VyOZ/fC7rg+wYi84orAZvRS6CH1ND1QQCeDPeziR7+sMFq7BgESOY1GkkhJkr/U\r
30         FziL2RMEuiCrK/XtYKtuFPXNMVd7NhWSRzRMk=\r
31 Received: by 10.204.10.80 with SMTP id o16mr4652760bko.50.1327890474827;\r
32         Sun, 29 Jan 2012 18:27:54 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id\r
34         ci12sm34228723bkb.13.2012.01.29.18.27.53\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Sun, 29 Jan 2012 18:27:54 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v2 10/13] emacs: use message ids instead of thread id in\r
40         `notmuch-show-operate-all'\r
41 Date: Mon, 30 Jan 2012 06:26:19 +0400\r
42 Message-Id: <1327890382-548-11-git-send-email-dmitry.kurochkin@gmail.com>\r
43 X-Mailer: git-send-email 1.7.8.3\r
44 In-Reply-To: <1327890382-548-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45 References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46         <1327890382-548-1-git-send-email-dmitry.kurochkin@gmail.com>\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Mon, 30 Jan 2012 02:28:30 -0000\r
60 \r
61 Before the change, `notmuch-show-operate-all' used thread id for\r
62 "notmuch tag" search.  This could result in tagging unexpected\r
63 messages that were added to the thread after the notmuch-show buffer\r
64 was created.  The patch changes `notmuch-show-operate-all' to use ids\r
65 of shown messages to fix this.\r
66 ---\r
67  emacs/notmuch-show.el |   23 ++++++++++++++++++++++-\r
68  1 files changed, 22 insertions(+), 1 deletions(-)\r
69 \r
70 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
71 index 0d90c1e..b115a8f 100644\r
72 --- a/emacs/notmuch-show.el\r
73 +++ b/emacs/notmuch-show.el\r
74 @@ -1170,6 +1170,15 @@ All currently available key bindings:\r
75      (notmuch-show-move-to-message-top)\r
76      t))\r
77  \r
78 +(defun notmuch-show-mapc (function)\r
79 +  "Iterate through all messages in the current thread with\r
80 +`notmuch-show-goto-message-next' and call FUNCTION for side\r
81 +effects."\r
82 +  (save-excursion\r
83 +    (goto-char (point-min))\r
84 +    (loop do (funcall function)\r
85 +         while (notmuch-show-goto-message-next))))\r
86 +\r
87  ;; Functions relating to the visibility of messages and their\r
88  ;; components.\r
89  \r
90 @@ -1222,6 +1231,18 @@ Some useful entries are:\r
91    "Return the message id of the current message."\r
92    (concat "id:\"" (notmuch-show-get-prop :id) "\""))\r
93  \r
94 +(defun notmuch-show-get-messages-ids ()\r
95 +  "Return all message ids of messages in the current thread."\r
96 +  (let ((message-ids))\r
97 +    (notmuch-show-mapc\r
98 +     (lambda () (push (notmuch-show-get-message-id) message-ids)))\r
99 +    message-ids))\r
100 +\r
101 +(defun notmuch-show-get-messages-ids-search ()\r
102 +  "Return a search string for all message ids of messages in the\r
103 +current thread."\r
104 +  (mapconcat 'identity (notmuch-show-get-messages-ids) " or "))\r
105 +\r
106  ;; dme: Would it make sense to use a macro for many of these?\r
107  \r
108  (defun notmuch-show-get-filename ()\r
109 @@ -1494,7 +1515,7 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
110  \r
111  TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
112    (interactive (notmuch-read-tag-changes nil notmuch-show-thread-id))\r
113 -  (apply 'notmuch-tag notmuch-show-thread-id tag-changes)\r
114 +  (apply 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)\r
115    (save-excursion\r
116      (goto-char (point-min))\r
117      (loop do (let* ((current-tags (notmuch-show-get-tags))\r
118 -- \r
119 1.7.8.3\r
120 \r