Re: [PATCH v2 1/4] cli: add global option --stderr=FILE
[notmuch-archives.git] / f9 / 88a03f33ad4f74e79c3e3e7ada7ec5028fba39
1 Return-Path: <BATV+28bf489b39c899822e75+2435+infradead.org+hohndel@bombadil.srs.infradead.org>\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 615C04196F2\r
6         for <notmuch@notmuchmail.org>; Sat, 24 Apr 2010 15:50:31 -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: -4.2\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=unavailable\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 Jj65kMJuLbZP for <notmuch@notmuchmail.org>;\r
16         Sat, 24 Apr 2010 15:50:29 -0700 (PDT)\r
17 Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 1F034431FC1\r
19         for <notmuch@notmuchmail.org>; Sat, 24 Apr 2010 15:50:29 -0700 (PDT)\r
20 Received: from localhost ([::1] helo=x200.gr8dns.org)\r
21         by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux))\r
22         id 1O5oBA-0005n6-AX; Sat, 24 Apr 2010 22:50:28 +0000\r
23 Received: by x200.gr8dns.org (Postfix, from userid 500)\r
24         id BA2D0CC5D1; Sat, 24 Apr 2010 15:50:27 -0700 (PDT)\r
25 From: Dirk Hohndel <hohndel@infradead.org>\r
26 To: Carl Worth <cworth@cworth.org>, notmuch@notmuchmail.org\r
27 Subject: Re: Wrapping up the 0.3 release\r
28 In-Reply-To: <m3iq7gv73w.fsf@x200.gr8dns.org>\r
29 References: <87ljcchnfc.fsf@yoom.home.cworth.org>\r
30         <m3eii43i82.fsf@x200.gr8dns.org>\r
31         <87aassh6d2.fsf@yoom.home.cworth.org>\r
32         <m3iq7gv73w.fsf@x200.gr8dns.org>\r
33 User-Agent: Notmuch/0.2-197-ged00626 (http://notmuchmail.org) Emacs/23.1.1\r
34         (i386-redhat-linux-gnu)\r
35 Date: Sat, 24 Apr 2010 15:50:27 -0700\r
36 Message-ID: <m3sk6kqxcc.fsf@x200.gr8dns.org>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain; charset=us-ascii\r
39 X-SRS-Rewrite: SMTP reverse-path rewritten from <hohndel@infradead.org> by\r
40         bombadil.infradead.org See http://www.infradead.org/rpr.html\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Sat, 24 Apr 2010 22:50:31 -0000\r
54 \r
55 On Sat, 24 Apr 2010 15:05:55 -0700, Dirk Hohndel <hohndel@infradead.org> wrote:\r
56 > > Dirk also mentioned in IRC that there's a regression with the signature\r
57 > > being mispositioned before the quoted text with a reply buffer. Now that\r
58 > > I've added a signature, I'm noticing this as well.\r
59\r
60 > Well - we don't seem to be adding the signature ourselves anymore... I\r
61 > still don't quite understand where and how we hand over to the existing\r
62 > message-mode functions - I why those decide to insert a signature at\r
63 > point.\r
64 \r
65 Learning elisp every day. I think I now understand at least somewhat\r
66 what's happening there...\r
67  \r
68 > Here's a trivial patch that ALSO adds a signature at the end of the\r
69 > message buffer (where it belongs). But I haven't figured out how to get\r
70 > rid of the one above the reply...\r
71\r
72 > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
73 > index acb7dbf..493cd0e 100644\r
74 > --- a/emacs/notmuch-mua.el\r
75 > +++ b/emacs/notmuch-mua.el\r
76 > @@ -63,6 +63,7 @@\r
77 >      ;; line and then the body.\r
78 >      (with-temp-buffer\r
79 >        (call-process notmuch-command nil t nil "reply" query-string)\r
80 > +      (message-insert-signature)\r
81 >        (goto-char (point-min))\r
82 >        (if (re-search-forward "^$" nil t)\r
83 >         (save-excursion\r
84 \r
85 This patch is of course completely bogus. But understanding why it was\r
86 bogus helped me come up with this patch, that hopefully makes more\r
87 sense. People who ACTUALLY understand elisp - please take a look\r
88 \r
89 (I could have sworn there was a variable somewhere that gives me the\r
90 correct regex to search for a signature separator... but I can't find\r
91 it. so please replace '-- ' with that if you know)\r
92 \r
93 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
94 index acb7dbf..05c9603 100644\r
95 --- a/emacs/notmuch-mua.el\r
96 +++ b/emacs/notmuch-mua.el\r
97 @@ -82,7 +82,13 @@\r
98      (message-hide-headers)\r
99      (save-excursion\r
100        (goto-char (point-max))\r
101 -      (insert body))\r
102 +      (if (re-search-backward "-- " nil t)\r
103 +         (progn \r
104 +           (forward-line -1)\r
105 +           (insert body))\r
106 +       (progn\r
107 +         (goto-char (point-max))\r
108 +         (insert body))))\r
109      (set-buffer-modified-p nil)))\r
110  \r
111  (defun notmuch-mua-forward-message ()\r
112 \r
113 \r
114 -- \r
115 Dirk Hohndel\r
116 Intel Open Source Technology Center\r