Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b9 / d59b6b1ee26c693dfa3094de2528344225f291
1 Return-Path: <aaronecay@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 4F6FA41488C\r
6         for <notmuch@notmuchmail.org>; Sun,  8 Jan 2012 17:09:07 -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 6sIsgKGbirmL for <notmuch@notmuchmail.org>;\r
17         Sun,  8 Jan 2012 17:09:06 -0800 (PST)\r
18 Received: from mail-gx0-f181.google.com (mail-gx0-f181.google.com\r
19         [209.85.161.181]) (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 267BF41522B\r
22         for <notmuch@notmuchmail.org>; Sun,  8 Jan 2012 17:09:06 -0800 (PST)\r
23 Received: by ggnq2 with SMTP id q2so1904257ggn.26\r
24         for <notmuch@notmuchmail.org>; Sun, 08 Jan 2012 17:09:04 -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:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type:content-transfer-encoding;\r
28         bh=oELaoowe3Adzw0XL6eZaoP8ugZv55BbXzZIscHWf9ng=;\r
29         b=lnQP45QX57w5dOzuaEOoG430QkfySR1r6nNIh8VNHbISSWgBNvYHwWjggE3HSz4XmV\r
30         yhu/P513Zq7k0CuxiXM1JwdcY2Wvl86UaxENSqjGt8kCW3WpDi5rxro/ilNR/X0z2HQh\r
31         WhuLK0iRhIf+GDxJ0yiXKmgziqZYZQlk38c8I=\r
32 Received: by 10.101.23.12 with SMTP id a12mr5970071anj.17.1326071344402;\r
33         Sun, 08 Jan 2012 17:09:04 -0800 (PST)\r
34 Received: from localhost (c-68-80-94-73.hsd1.pa.comcast.net. [68.80.94.73])\r
35         by mx.google.com with ESMTPS id y58sm99970823yhi.17.2012.01.08.17.09.01\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Sun, 08 Jan 2012 17:09:03 -0800 (PST)\r
38 From: Aaron Ecay <aaronecay@gmail.com>\r
39 To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
40         Notmuch Mail <notmuch@notmuchmail.org>\r
41 Subject: Re: [PATCH 2/4] emacs: repurpose notmuch-show-archive-thread-internal\r
42         function for general thread tagging\r
43 In-Reply-To: <1325975294-646-3-git-send-email-jrollins@finestructure.net>\r
44 References: <1325975294-646-1-git-send-email-jrollins@finestructure.net>\r
45         <1325975294-646-2-git-send-email-jrollins@finestructure.net>\r
46         <1325975294-646-3-git-send-email-jrollins@finestructure.net>\r
47 User-Agent: Notmuch/0.10.1+56~gd709fd6 (http://notmuchmail.org)\r
48         Emacs/24.0.92.3 (i386-apple-darwin10.8.0)\r
49 Date: Sun, 08 Jan 2012 20:08:59 -0500\r
50 Message-ID: <m239bpk7h0.fsf@gmail.com>\r
51 MIME-Version: 1.0\r
52 Content-Type: text/plain; charset=utf-8\r
53 Content-Transfer-Encoding: quoted-printable\r
54 X-BeenThere: notmuch@notmuchmail.org\r
55 X-Mailman-Version: 2.1.13\r
56 Precedence: list\r
57 List-Id: "Use and development of the notmuch mail system."\r
58         <notmuch.notmuchmail.org>\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
62 List-Post: <mailto:notmuch@notmuchmail.org>\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
66 X-List-Received-Date: Mon, 09 Jan 2012 01:09:08 -0000\r
67 \r
68 Jameson,\r
69 \r
70 Some comments below:\r
71 \r
72 On Sat,  7 Jan 2012 14:28:12 -0800, Jameson Graef Rollins <jrollins@finestr=\r
73 ucture.net> wrote:\r
74 > Instead of having a function that is only used for archiving a thread,\r
75 > we instead make it useful for any tagging operation.  The new\r
76 > function, notmuch-show-tag-thread-internal, now takes two more\r
77 > arguments, for the "sign" of the tagging operation ("-" or "+"), and\r
78 > the tag to be added or removed.  This will allow this function to be\r
79 > used for any generic thread tagging operation.\r
80 >=20\r
81 > The higher level functions that call this function are modified\r
82 > accordingly.\r
83 > ---\r
84 >  emacs/notmuch-show.el |   34 ++++++++++++++++++++--------------\r
85 >  1 files changed, 20 insertions(+), 14 deletions(-)\r
86 >=20\r
87 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
88 > index 5502efd..1e16f05 100644\r
89 > --- a/emacs/notmuch-show.el\r
90 > +++ b/emacs/notmuch-show.el\r
91 > @@ -1414,20 +1414,26 @@ argument, hide all of the messages."\r
92 >    (interactive)\r
93 >    (backward-button 1))\r
94 >=20=20\r
95 > -(defun notmuch-show-archive-thread-internal (show-next)\r
96 > +(defun notmuch-show-tag-thread-internal (sign tag show-next)\r
97 \r
98 A couple of comments on the arguments:\r
99 - It would be good to make show-next &optional.  This will enable code\r
100   to call the fn with only two arguments, and not showing next will be\r
101   the default behavior.\r
102 - A more lispy way of specifying the sign would be to use a\r
103   boolean.  Perhaps you could call this =E2=80=9Cremove=E2=80=9D; a value o=\r
104 f =E2=80=98t=E2=80=99 would\r
105   remove the tag; =E2=80=98nil=E2=80=99 would add it.  Moving this argument=\r
106  after =E2=80=98tag=E2=80=99\r
107   and also making it &optional woudl allow this fn to be called with one\r
108   arg to add a tag.  (Maybe this is too minimalist and API, however.)=20\r
109 \r
110 >    ;; Remove the tag from the current set of messages.\r
111 >    (goto-char (point-min))\r
112 > -  (loop do (notmuch-show-remove-tag "inbox")\r
113 > -     until (not (notmuch-show-goto-message-next)))\r
114 > -  ;; Move to the next item in the search results, if any.\r
115 > -  (let ((parent-buffer notmuch-show-parent-buffer))\r
116 > -    (notmuch-kill-this-buffer)\r
117 > -    (if parent-buffer\r
118 > -     (progn\r
119 > -       (switch-to-buffer parent-buffer)\r
120 > -       (forward-line)\r
121 > -       (if show-next\r
122 > -           (notmuch-search-show-thread))))))\r
123 > +  (let ((tag-function))\r
124 \r
125 No second set of parens is needed around tag-function.\r
126 \r
127 > +    (cond\r
128 > +     ((string=3D sign "-")\r
129 > +      (setq tag-function 'notmuch-show-remove-tag))\r
130 > +     ((string=3D sign "+")\r
131 > +      (setq tag-function 'notmuch-show-add-tag)))\r
132 > +    (loop do (funcall tag-function tag)\r
133 > +       until (not (notmuch-show-goto-message-next)))\r
134 > +    ;; Move to the next item in the search results, if any.\r
135 \r
136 Does it make sense to separate the tagging and the movement?  It seems\r
137 plausible that some code somewhere might want to add/remove a tag from\r
138 all messages in the thread w/o changing the display.\r
139 \r
140 > +    (let ((parent-buffer notmuch-show-parent-buffer))\r
141 > +      (notmuch-kill-this-buffer)\r
142 > +      (if parent-buffer\r
143 > +       (progn\r
144 > +         (switch-to-buffer parent-buffer)\r
145 > +         (forward-line)\r
146 > +         (if show-next\r
147 > +             (notmuch-search-show-thread)))))))\r
148 \r
149 --=20\r
150 Aaron Ecay\r