Re: [PATCH v4 08/16] reorganize indexing of multipart/signed and multipart/encrypted
[notmuch-archives.git] / bd / c515670d9d0b3a2a59eae51673f61225782b5f
1 Return-Path: <bremner@unb.ca>\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 BB171431FBC\r
6         for <notmuch@notmuchmail.org>; Sun, 30 Sep 2012 17:57: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\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 QWQXTs+HVRPx for <notmuch@notmuchmail.org>;\r
16         Sun, 30 Sep 2012 17:57:57 -0700 (PDT)\r
17 Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
18         (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 18B5E431FAE\r
21         for <notmuch@notmuchmail.org>; Sun, 30 Sep 2012 17:57:57 -0700 (PDT)\r
22 Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net\r
23         ([156.34.89.108] helo=zancas.localnet)\r
24         by tesseract.cs.unb.ca with esmtpsa\r
25         (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72)\r
26         (envelope-from <bremner@unb.ca>)\r
27         id 1TIUKa-0004Ut-2b; Sun, 30 Sep 2012 21:57:56 -0300\r
28 Received: from bremner by zancas.localnet with local (Exim 4.80)\r
29         (envelope-from <bremner@unb.ca>)\r
30         id 1TIUKU-0002uY-LG; Sun, 30 Sep 2012 21:57:50 -0300\r
31 From: David Bremner <bremner@debian.org>\r
32 To: 687390@bugs.debian.org\r
33 Subject: solution to gnus-alias problems?\r
34 User-Agent: Notmuch/0.14+37~gf227d63 (http://notmuchmail.org) Emacs/24.1.1\r
35         (x86_64-pc-linux-gnu)\r
36 Date: Sun, 30 Sep 2012 21:57:50 -0300\r
37 Message-ID: <87pq53xb3l.fsf@zancas.localnet>\r
38 MIME-Version: 1.0\r
39 Content-Type: text/plain\r
40 X-Spam_bar: -\r
41 Cc: notmuch@notmuchmail.org\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Mon, 01 Oct 2012 00:57:58 -0000\r
55 \r
56 \r
57 Geoff writes:\r
58 \r
59    Hi David,\r
60 \r
61    I've found the source of the problem I was having. It seems to be due\r
62    to some interference with the notmuch-mua-reply function and\r
63    gnus-alias. In particular, there was a problem with the part of\r
64    notmuch-mua-reply that inserted the newly setup message contents.\r
65 \r
66    Towards the end of the notmuch-mua-reply function, there is the following code:\r
67 \r
68        ;; insert the message body - but put it in front of the signature\r
69        ;; if one is present\r
70        (goto-char (point-max))\r
71    *    (if (re-search-backward message-signature-separator nil t)\r
72    *      (forward-line -1)\r
73          (goto-char (point-max)))\r
74        (insert body)\r
75        (push-mark))\r
76      (set-buffer-modified-p nil)\r
77 \r
78    The problem is with the two lines I've marked with a *. Suppose the\r
79    main message reply buffer already contains a signature and looks like\r
80    this\r
81 \r
82    [Headers]\r
83    --text follows this line\r
84    --\r
85    [Signature text]\r
86 \r
87    The above goes goes to the end of buffer with (point-max), then\r
88    searches back to the beginning of the signature separator, which is\r
89    fine. But then it moves one line up to the beginning of '--text\r
90    follows this line--" and then inserts the newly created message body,\r
91    which means that it inserts it before the '--text follows this\r
92    line--'.\r
93 \r
94    I've solved the problem (I think) by adjust the above code as follows:\r
95 \r
96        (if (re-search-backward message-signature-separator nil t)\r
97              (progn\r
98                (beginning-of-line)\r
99                (newline))\r
100          (goto-char (point-max)))\r
101 \r
102    Hope this helps!\r
103 \r
104    Best,\r
105 \r
106    Geoffrey\r
107 \r