RE: Reply all - issue
[notmuch-archives.git] / 03 / 3cc73bd5640ba25d1f5e3b0500ffb4f2af29d3
1 Return-Path: <amdragon@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 0FD80429E26\r
6         for <notmuch@notmuchmail.org>; Fri,  4 Nov 2011 20:51:58 -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.699\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
13         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 3ft+ooicgOp3 for <notmuch@notmuchmail.org>;\r
17         Fri,  4 Nov 2011 20:51:56 -0700 (PDT)\r
18 Received: from mail-iy0-f181.google.com (mail-iy0-f181.google.com\r
19         [209.85.210.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 5C960431FB6\r
22         for <notmuch@notmuchmail.org>; Fri,  4 Nov 2011 20:51:56 -0700 (PDT)\r
23 Received: by iahk25 with SMTP id k25so4167775iah.26\r
24         for <notmuch@notmuchmail.org>; Fri, 04 Nov 2011 20:51:56 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=mime-version:sender:in-reply-to:references:date\r
27         :x-google-sender-auth:message-id:subject:from:to:cc:content-type\r
28         :content-transfer-encoding;\r
29         bh=2ZaYleD2PSTGzxy0/SJPE+Rlkgw4FagwkUu0An/xuKI=;\r
30         b=dibRBpgetfymXA/FunEkjCDDyQy22mrUFFyrT6OA+baHg20m11lgLsqP/UbdoMhZYK\r
31         VJZ19xF2a3HyRgMZcUn0JRuPRiRicRIu8xfJEZ+rpBz5Zo2I4SNHO2QZzsU1Ml3fifEa\r
32         GNID8XEQBuEzPVnyLMCdVBGfPtIibQvQ40joE=\r
33 MIME-Version: 1.0\r
34 Received: by 10.42.144.65 with SMTP id a1mr20777348icv.46.1320465115888; Fri,\r
35         04 Nov 2011 20:51:55 -0700 (PDT)\r
36 Sender: amdragon@gmail.com\r
37 Received: by 10.143.166.17 with HTTP; Fri, 4 Nov 2011 20:51:55 -0700 (PDT)\r
38 In-Reply-To: <1319528464-22654-1-git-send-email-schnouki@schnouki.net>\r
39 References: <87pqhlh64c.fsf@thor.loria.fr>\r
40         <1319528464-22654-1-git-send-email-schnouki@schnouki.net>\r
41 Date: Fri, 4 Nov 2011 23:51:55 -0400\r
42 X-Google-Sender-Auth: 7_SnhWNZcZRm_eWwPFtn2uOs_Rk\r
43 Message-ID:\r
44  <CAH-f9WvuSFJJC+e0JRFwKD8xYtyncNYZreCXxxMDeSahpWAuRw@mail.gmail.com>\r
45 Subject: Re: [PATCH] emacs: Let the user choose where to compose new mails\r
46 From: Austin Clements <amdragon@mit.edu>\r
47 To: Thomas Jost <schnouki@schnouki.net>\r
48 Content-Type: text/plain; charset=ISO-8859-1\r
49 Content-Transfer-Encoding: quoted-printable\r
50 Cc: notmuch@notmuchmail.org\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Sat, 05 Nov 2011 03:51:58 -0000\r
64 \r
65 This seems like a good option to have, but your approach seems\r
66 unnecessarily complicated. I'm always wary of defcustom's :set because\r
67 it means you can't just setq the variable, which defeats the\r
68 underlying beauty of the customize system.=A0 You could eliminate the\r
69 other two variables and compute them on the fly, or, if you really\r
70 feel they may need to be controlled independently, make the custom\r
71 variable a pair or alist (which you can hide behind a few const\r
72 choices).  Alternatively, it seems like the variable could instead\r
73 take a single function (basically what notmuch-mua-switch-function is\r
74 now) and you could provide two new functions that simply combine\r
75 switch-to-buffer-other-x and set-window-dedicated-p.\r
76 \r
77 On Oct 25, 2011 3:41 AM, "Thomas Jost" <schnouki@schnouki.net> wrote:\r
78 >\r
79 > ---\r
80 > =A0emacs/notmuch-mua.el | =A0 37 +++++++++++++++++++++++++++++++++++--\r
81 > =A01 files changed, 35 insertions(+), 2 deletions(-)\r
82 >\r
83 > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
84 > index 8824b08..ebc922f 100644\r
85 > --- a/emacs/notmuch-mua.el\r
86 > +++ b/emacs/notmuch-mua.el\r
87 > @@ -31,6 +31,34 @@\r
88 > =A0 :group 'notmuch\r
89 > =A0 :type 'hook)\r
90 >\r
91 > +(defvar notmuch-mua-switch-function nil\r
92 > + =A0"Function used to switch and display the mail buffer. This is\r
93 > + =A0normally set by `notmuch-mua-compose-in'.")\r
94 > +(defvar notmuch-mua-dedicated-flag nil\r
95 > + =A0"Flag to pass to `set-window-dedicated-p' in the mail buffer.\r
96 > + =A0This is normally set by `notmuch-mua-compose-in'.")\r
97 > +(defcustom notmuch-mua-compose-in 'current-window\r
98 > + =A0"Where to create the mail buffer used to compose a new message.\r
99 > + =A0Possible values are `current-window' (default), `new-window'\r
100 > + =A0and `new-frame'. If set to `new-window' or `new-frame', the\r
101 > + =A0mail buffer will be displayer in a new window/frame that will\r
102 \r
103 s/displayer/displayed/\r
104 \r
105 > + =A0be destroyed when the buffer is killed. You may want to\r
106 > + =A0customize `message-kill-buffer-on-exit' accordingly."\r
107 \r
108 You should also describe 'current-window' in the defcustom docstring.\r
109 (Currently you describe the effect of the other two, but not\r
110 current-window.)\r
111 \r
112 > + =A0:group 'notmuch\r
113 > + =A0:type 'symbol\r
114 > + =A0:set (lambda (sym val)\r
115 > + =A0 =A0 =A0 =A0(cond ((eq val 'current-window)\r
116 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq notmuch-mua-switch-function nil\r
117 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 notmuch-mua-dedicated-flag nil)=\r
118 )\r
119 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0((eq val 'new-window)\r
120 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq notmuch-mua-switch-function 'switch-t=\r
121 o-buffer-other-window\r
122 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 notmuch-mua-dedicated-flag 1))\r
123 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0((eq val 'new-frame)\r
124 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq notmuch-mua-switch-function 'switch-t=\r
125 o-buffer-other-frame\r
126 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 notmuch-mua-dedicated-flag 1))\r
127 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0(t (error (concat "Bad value for notmuch-mua=\r
128 -compose-in: "\r
129 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(symbol-=\r
130 value val)))))))\r
131 > +\r
132 \r
133 The defcustom would be more user-friendly if it gave a choice between\r
134 const values, rather than requiring the user to enter a symbol value\r
135 (and then possibly rejecting it on validation).  Something like\r
136   :type '(choice (const :tag "Compose in the current window" current-window=\r
137 )\r
138                  (const :tag "Compose mail in a new window"  new-window)\r
139                  (const :tag "Compose mail in a new frame"   new-frame))\r
140 \r
141 > =A0(defcustom notmuch-mua-user-agent-function 'notmuch-mua-user-agent-ful=\r
142 l\r
143 > =A0 "Function used to generate a `User-Agent:' string. If this is\r
144 > =A0`nil' then no `User-Agent:' will be generated."\r
145 > @@ -99,7 +127,8 @@ list."\r
146 > =A0 =A0 =A0 =A0((same-window-regexps '("\\*mail .*")))\r
147 > =A0 =A0 =A0 (notmuch-mua-mail (mail-header 'to headers)\r
148 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(mail-header 'subject head=\r
149 ers)\r
150 > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (message-headers-to-generat=\r
151 e headers t '(to subject))))\r
152 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (message-headers-to-generat=\r
153 e headers t '(to subject))\r
154 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nil notmuch-mua-switch-func=\r
155 tion))\r
156 > =A0 =A0 ;; insert the message body - but put it in front of the signature\r
157 > =A0 =A0 ;; if one is present\r
158 > =A0 =A0 (goto-char (point-max))\r
159 > @@ -112,6 +141,8 @@ list."\r
160 > =A0 (message-goto-body))\r
161 >\r
162 > =A0(defun notmuch-mua-forward-message ()\r
163 > + =A0(when notmuch-mua-switch-function\r
164 > + =A0 =A0(funcall notmuch-mua-switch-function (current-buffer)))\r
165 > =A0 (message-forward)\r
166 >\r
167 > =A0 (when notmuch-mua-user-agent-function\r
168 > @@ -121,6 +152,7 @@ list."\r
169 > =A0 (message-sort-headers)\r
170 > =A0 (message-hide-headers)\r
171 > =A0 (set-buffer-modified-p nil)\r
172 > + =A0(set-window-dedicated-p (selected-window) notmuch-mua-dedicated-flag=\r
173 )\r
174 >\r
175 > =A0 (message-goto-to))\r
176 >\r
177 > @@ -143,6 +175,7 @@ list."\r
178 > =A0 (message-sort-headers)\r
179 > =A0 (message-hide-headers)\r
180 > =A0 (set-buffer-modified-p nil)\r
181 > + =A0(set-window-dedicated-p (selected-window) notmuch-mua-dedicated-flag=\r
182 )\r
183 >\r
184 > =A0 (message-goto-to))\r
185 >\r
186 > @@ -199,7 +232,7 @@ the From: address first."\r
187 > =A0 (let ((other-headers\r
188 > =A0 =A0 =A0 =A0 (when (or prompt-for-sender notmuch-always-prompt-for-sen=\r
189 der)\r
190 > =A0 =A0 =A0 =A0 =A0 (list (cons 'from (notmuch-mua-prompt-for-sender)))))=\r
191 )\r
192 > - =A0 =A0(notmuch-mua-mail nil nil other-headers)))\r
193 > + =A0 =A0(notmuch-mua-mail nil nil other-headers nil notmuch-mua-switch-f=\r
194 unction)))\r
195 >\r
196 > =A0(defun notmuch-mua-new-forward-message (&optional prompt-for-sender)\r
197 > =A0 "Invoke the notmuch message forwarding window.\r
198 > --\r
199 > 1.7.7\r
200 >\r
201 > _______________________________________________\r
202 > notmuch mailing list\r
203 > notmuch@notmuchmail.org\r
204 > http://notmuchmail.org/mailman/listinfo/notmuch\r