Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 46 / 9eea2ec58962ce0f0dbdbd68d7d19ce7940099
1 Return-Path: <tomi.ollila@iki.fi>\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 2FF3B431FAF\r
6         for <notmuch@notmuchmail.org>; Thu,  6 Sep 2012 07:00:51 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id w0RHchRdGuxS for <notmuch@notmuchmail.org>;\r
16         Thu,  6 Sep 2012 07:00:49 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id A2EED431FAE\r
19         for <notmuch@notmuchmail.org>; Thu,  6 Sep 2012 07:00:49 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 9620B1000E5;\r
22         Thu,  6 Sep 2012 17:00:55 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Michal Sojka <sojkam1@fel.cvut.cz>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH v2] emacs: Add customization group for replying\r
26 In-Reply-To: <87y5kntjf1.fsf@steelpick.2x.cz>\r
27 References: <1346919815-20397-1-git-send-email-sojkam1@fel.cvut.cz>\r
28         <m2wr07fs0y.fsf@guru.guru-group.fi>\r
29         <87y5kntjf1.fsf@steelpick.2x.cz>\r
30 User-Agent: Notmuch/0.14+11~gd9bf007 (http://notmuchmail.org) Emacs/24.2.1\r
31         (x86_64-unknown-linux-gnu)\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
33         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
34         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
35 Date: Thu, 06 Sep 2012 17:00:55 +0300\r
36 Message-ID: <m2sjavxnc8.fsf@guru.guru-group.fi>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Thu, 06 Sep 2012 14:00:51 -0000\r
52 \r
53 On Thu, Sep 06 2012, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
54 \r
55 >> So far good, but...\r
56 >>\r
57 >> You forgot to handle the current group setting for \r
58 >> notmuch-message-replied-tags -- currently notmuch-message.el has this:\r
59 >>\r
60 >> (defcustom notmuch-message-replied-tags '("replied")\r
61 >>   "Tags to be automatically added to or removed from a message when it is\r
62 >>   replied to.\r
63 >> Any tag in the list will be added to a replied message or,\r
64 >> if it is prefaced with a \"-\", removed.\r
65 >>\r
66 >> For example, if you wanted to add a \"replied\" tag and remove\r
67 >> the \"inbox\" and \"todo\", you would set\r
68 >>     (\"replied\" \"-inbox\" \"-todo\"\)"\r
69 >>   :type 'list\r
70 >>   :group 'notmuch-send)\r
71 >>\r
72 >> If the above was changed to 'normuch-send, (require 'notmuch-lib)\r
73 >> was added to the beginning of notmuch-message.el and the defgroup\r
74 >> below was written as\r
75 >>\r
76 >> (defgroup notmuch-reply\r
77 >>   '((message-insertion custom-group)))\r
78 >>    "Replying to messages.\r
79 >>     ...\r
80 >>\r
81 >> would that work as expected ?\r
82 >\r
83 > Hi Tomi,\r
84 >\r
85 > I don't really get what are you trying to say. Do you mean that\r
86 > notmuch-message-replied-tags is referenced from notmuch-lib.el without\r
87 > (require 'notmuch-message)? I'm not sure whether it is required, but it\r
88 > works here without problems.\r
89 \r
90 Ok, some sillines in my part and something I did not check well\r
91 enough before replying...\r
92 \r
93 First, notmuch-lib.el defines notmuch-send group, yet \r
94 (defcustom notmuch-message-replied-tags ...) is defined \r
95 in notmuch-message.el which is not requiring notmuch-lib...\r
96 and all of this works now...\r
97 \r
98 Actually, notmuch-lib.el defines all defgroups (except coolj).\r
99 \r
100 Then, I found the following: notmuch-mua-send-hook is defined \r
101 both in notmuch-hooks and notmuch-send groups (having a precedent\r
102 helps a bit there when choosing alternatives below)\r
103 \r
104 \r
105 All the defgroups are defined using pattern:\r
106 \r
107 (defgroup notmuch-<group> nil ...)\r
108 \r
109 We should follow this pattern unless there is good reason not to \r
110 do so here: notmuch-send is written as:\r
111 \r
112   (defgroup notmuch-send nil\r
113     "Sending messages from Notmuch."\r
114     :group 'notmuch)\r
115 \r
116   (custom-add-to-group 'notmuch-send 'message 'custom-group)\r
117 \r
118 But, as the documentation in this notmuch-reply definition references\r
119 'Message insertion' group, doing\r
120 \r
121   (defgroup notmuch-reply \r
122     '((message-insertion custom-group))'\r
123     "Replying to messages.\r
124 \r
125   Most of the reply customization settings can be found in `Message\r
126   insertion' group. Notmuch specific settings are included directly\r
127   here."\r
128   :group 'notmuch)\r
129 \r
130 could be good thing to do here; definition matches doc from the beginning\r
131 (just not adding any of the custom variables, yet).\r
132 \r
133 \r
134 Now, currently notmuch-message.el defines notmuch-message-replied-tags\r
135 and puts that to :group 'notmuch-send\r
136 \r
137 There are 2 alternatives:\r
138 \r
139 1) change that to :group 'notmuch-reply\r
140 \r
141 2) add (custom-add-to-group 'notmuch-reply 'notmuch-message-replied-tags 'custom-variable)\r
142    to notmuch-message.el (or notmuch-lib.el)\r
143 \r
144 2b) change :group 'notmuch-send -> :group 'notmuch-reply and\r
145    add (custom-add-to-group 'notmuch-send 'notmuch-message-replied-tags 'custom-variable)\r
146    to notmuch-message.el (or notmuch-lib.el)\r
147 \r
148 \r
149 I personally would slightly lean to option 1 but if 2 gets more \r
150 supporters then 2b (so that the spesific group is in the group definition).\r
151 \r
152 On other words; 1 or 2b gets LGTM from me :)\r
153 \r
154 Understood ? :D\r
155 \r
156 \r
157 Tomi\r
158 \r
159 \r
160 > Running M-x customize-variable RET notmuch-message-replied-tags RET\r
161 > shows the following. Note that both groups are mentioned at the bottom.\r
162 > No warning or errors are produced.\r
163 \r
164 Yes, I tested that missing group-thing with:\r
165 \r
166 (defgroup foo '((bar-group custom-group)) "test")\r
167 \r
168 It seems the nonexisting bar-group is created on-the-fly (but\r
169 exist temporarily). No warnings nor errors :).\r
170 \r
171 >\r
172 > -Michal\r
173 \r
174 Tomi\r
175 \r
176 >\r
177 > --8<---------------cut here---------------start------------->8---\r
178 > To apply changes, use the Save or Set buttons.\r
179 > For details, see Saving Customizations in the Emacs manual.\r
180 >\r
181 >                                           Search \r
182 >\r
183 >  Operate on all settings in this buffer:\r
184 >   Set for current session   Save for future sessions \r
185 >   Undo edits   Reset to saved   Erase customizations     Exit \r
186 >\r
187 > Hide notmuch-message-replied-tags: '("replied")\r
188 >     State : STANDARD. (mismatch)\r
189 >    Tags to be automatically added to or removed from a message when it is replied to. Hide   \r
190 >    Any tag in the list will be added to a replied message or,\r
191 >    if it is prefaced with a "-", removed.\r
192 >    \r
193 >    For example, if you wanted to add a "replied" tag and remove\r
194 >    the "inbox" and "todo", you would set\r
195 >        ("replied" "-inbox" "-todo")\r
196 > Groups: Notmuch Send Notmuch Reply\r
197 > --8<---------------cut here---------------end--------------->8---\r