Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 40 / 70529daef309ebd24ae4861e94cc769632d520
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 E9D8E431FAF\r
6         for <notmuch@notmuchmail.org>; Wed,  8 Feb 2012 08:58:08 -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.7\r
10 X-Spam-Level: *\r
11 X-Spam-Status: No, score=1.7 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, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7]\r
14         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 MlKvkJ0h8SJm for <notmuch@notmuchmail.org>;\r
18         Wed,  8 Feb 2012 08:58:08 -0800 (PST)\r
19 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
20         [209.85.214.53]) (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 E8FA0431FAE\r
23         for <notmuch@notmuchmail.org>; Wed,  8 Feb 2012 08:58:07 -0800 (PST)\r
24 Received: by bkcjk7 with SMTP id jk7so807835bkc.26\r
25         for <notmuch@notmuchmail.org>; Wed, 08 Feb 2012 08:58:06 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
27         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
28         :mime-version:content-type;\r
29         bh=hJYQuOxjWR6pYUSe6AL5aWfazoo7547u421qFrfnJ1M=;\r
30         b=M5fHnxKu2F19zg1PX68tFXc6tA6Cr3TVgr+ISxX2zC0BXAirD9PEQnB32Cv1wVH2++\r
31         OHQFMAH3Ej9rEaOY5gq1d7I644rR9lmvRUPDrCivPYG7kbBcMSuOW/p4EtBWFNXJ7X68\r
32         kEvgnobFpiGBJ7VYH3P72BloCbtSyeBcCA04c=\r
33 Received: by 10.205.127.147 with SMTP id ha19mr3425996bkc.64.1328720286614;\r
34         Wed, 08 Feb 2012 08:58:06 -0800 (PST)\r
35 Received: from localhost ([91.144.186.21])\r
36         by mx.google.com with ESMTPS id x20sm6232651bka.9.2012.02.08.08.58.05\r
37         (version=TLSv1/SSLv3 cipher=OTHER);\r
38         Wed, 08 Feb 2012 08:58:05 -0800 (PST)\r
39 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
40 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org\r
41 Subject: Re: [PATCH v4] emacs: Call "notmuch tag" once when applying tag\r
42         changes to a thread.\r
43 In-Reply-To: <1328719395-6333-1-git-send-email-dme@dme.org>\r
44 References: <1328632303-31877-1-git-send-email-jani@nikula.org>\r
45         <1328719395-6333-1-git-send-email-dme@dme.org>\r
46 User-Agent: Notmuch/0.11.1+167~g6e72434 (http://notmuchmail.org) Emacs/23.3.1\r
47         (x86_64-pc-linux-gnu)\r
48 Date: Wed, 08 Feb 2012 20:56:48 +0400\r
49 Message-ID: <87sjil8drj.fsf@gmail.com>\r
50 MIME-Version: 1.0\r
51 Content-Type: text/plain; charset=us-ascii\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Wed, 08 Feb 2012 16:58:09 -0000\r
65 \r
66 On Wed,  8 Feb 2012 16:43:15 +0000, David Edmondson <dme@dme.org> wrote:\r
67 > Optimize thread tagging by combining all the tagging operations to a\r
68 > single "notmuch tag" call.\r
69\r
70 > For threads in the order of tens or a hundred inbox tagged messages,\r
71 > this gives a noticeable speedup. On two different machines, archiving\r
72 > a thread of about 50 inbox tagged messages goes down from 10+ seconds\r
73 > to about 0.5 seconds.\r
74\r
75 > The bottleneck is not within emacs; the same behaviour can be observed\r
76 > in the CLI. This approach has the added benefit of being more\r
77 > reliable: any of the individual tagging operations might face a locked\r
78 > database, leading to partial results.\r
79\r
80 > This introduces a limitation to the number of messages that can be\r
81 > archived at the same time (through ARG_MAX limiting the command\r
82 > line). While at least on Linux this seems more like a theoretical\r
83 > limitation than a real one, it could be avoided by archiving at most a\r
84 > few hundred messages at a time.\r
85\r
86 > Based on code from Jani Nikula <jani@nikula.org>.\r
87 > ---\r
88\r
89 > v4:\r
90 > - Rebased after Dmitry's tagging changes (yay!).\r
91\r
92 \r
93 Now, that my tagging changes are pushed, the same effect can be (and\r
94 should be) achieved by some code cleanup and function reuse.\r
95 \r
96 This patch is obsoleted by [1].\r
97 \r
98 Regards,\r
99   Dmitry\r
100 \r
101 [1] id:"1328719731-13402-1-git-send-email-dmitry.kurochkin@gmail.com"\r
102 \r
103 >  emacs/notmuch-show.el |   18 +++++++++++-------\r
104 >  1 files changed, 11 insertions(+), 7 deletions(-)\r
105\r
106 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
107 > index faa9f9b..9294bc8 100644\r
108 > --- a/emacs/notmuch-show.el\r
109 > +++ b/emacs/notmuch-show.el\r
110 > @@ -1599,14 +1599,18 @@ argument, hide all of the messages."\r
111 >    (backward-button 1))\r
112 >  \r
113 >  (defun notmuch-show-tag-thread-internal (tag &optional remove)\r
114 > -  "Add tag to the current set of messages.\r
115 > +  "Add TAG to the current set of messages.\r
116 >  \r
117 > -If the remove switch is given, tags will be removed instead of\r
118 > -added."\r
119 > -  (goto-char (point-min))\r
120 > -  (let ((op (if remove "-" "+")))\r
121 > -    (loop do (notmuch-show-tag-message (concat op tag))\r
122 > -       until (not (notmuch-show-goto-message-next)))))\r
123 > +If REMOVE is non-nil, TAG will be removed rather than added."\r
124 > +  (save-excursion\r
125 > +    (goto-char (point-min))\r
126 > +    (let ((tag-op (concat (if remove "-" "+") tag))\r
127 > +       (message-ids\r
128 > +        (loop collect (notmuch-show-get-message-id)\r
129 > +              until (not (notmuch-show-goto-message-next)))))\r
130 > +      (if message-ids\r
131 > +       (notmuch-tag (mapconcat #'identity message-ids " OR ")\r
132 > +                    tag-op)))))\r
133 >  \r
134 >  (defun notmuch-show-add-tag-thread (tag)\r
135 >    "Add tag to all messages in the current thread."\r
136 > -- \r
137 > 1.7.8.3\r
138\r
139 > _______________________________________________\r
140 > notmuch mailing list\r
141 > notmuch@notmuchmail.org\r
142 > http://notmuchmail.org/mailman/listinfo/notmuch\r