--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 2FC6C431FBC\r
+ for <notmuch@notmuchmail.org>; Wed, 28 Aug 2013 13:47:06 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id YchIN6f5PUQC for <notmuch@notmuchmail.org>;\r
+ Wed, 28 Aug 2013 13:46:58 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 8D9FF431FAE\r
+ for <notmuch@notmuchmail.org>; Wed, 28 Aug 2013 13:46:58 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id BC303100030;\r
+ Wed, 28 Aug 2013 23:46:48 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>,\r
+ Geoffrey Ferrari <geoffrey.ferrari@oriel.oxon.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: bugfix notmuch-mua-reply when signature is present\r
+In-Reply-To: <87sixtsj1y.fsf@nikula.org>\r
+References:\r
+ <1375961732-14327-1-git-send-email-geoffrey.ferrari@oriel.oxon.org>\r
+ <m2sixtyb5k.fsf@guru.guru-group.fi> <m2ob8hy7da.fsf@guru.guru-group.fi>\r
+ <87sixtsj1y.fsf@nikula.org>\r
+User-Agent: Notmuch/0.16+42~g938dae6 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Wed, 28 Aug 2013 23:46:48 +0300\r
+Message-ID: <m2y57lfsqv.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 28 Aug 2013 20:47:06 -0000\r
+\r
+On Wed, Aug 28 2013, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+> On Wed, 28 Aug 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+>> On Wed, Aug 28 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+>>\r
+>>> On Thu, Aug 08 2013, Geoffrey Ferrari <geoffrey.ferrari@oriel.oxon.org> wrote:\r
+>>>\r
+>>>> From: "Geoffrey H. Ferrari" <geoffrey.ferrari@oriel.oxon.org>\r
+>>>>\r
+>>>> When composing a reply, notmuch-mua-reply tries to be smart and cite\r
+>>>> the original message by inserting it before the user signature, if\r
+>>>> one is present. However, the existing method of backward searching\r
+>>>> from the end of the buffer to find the signature separator and then\r
+>>>> moving one line up results in the original message being cited in\r
+>>>> the message headers. That's because at this point the message looks\r
+>>>> like this (with | representing point after searching for the\r
+>>>> signature separator):\r
+>>>>\r
+>>>> From: xxx\r
+>>>> To: xxx\r
+>>>> Subject: xxx\r
+>>>> --text follows this line--\r
+>>>> |--\r
+>>>> My fancy signature\r
+>>>\r
+>>> Now that I tested, (with ~/.signature), composing new mail starts with\r
+>>>\r
+>>> --8<---8<---8<---8<---8<---8<---8<---8<---8<-\r
+>>> From: Tomi Ollila <tomi.ollila@iki.fi>\r
+>>> To:\r
+>>> Subject: \r
+>>> Fcc: /home/too/mail/mails/sent\r
+>>> --text follows this line--\r
+>>>\r
+>>> --\r
+>>> signature\r
+>>> --8<---8<---8<---8<---8<---8<---8<---8<---8<-\r
+>>>\r
+>>> Notice the empty line between '--text follows this line--' and '--'\r
+>>>\r
+>>> In your example, the signature block is -- for some reason --\r
+>>> inserted without the empty line.\r
+>>>\r
+>>>> With this patch, a newline is opened instead, so that the orignal\r
+>>>> message is cited above the signature but still in the message text.\r
+>>\r
+>> ....\r
+>>\r
+>>>> (goto-char (point-max))\r
+>>>> (if (re-search-backward message-signature-separator nil t)\r
+>>>>- (forward-line -1)\r
+>>>>+ (newline)\r
+>>>> (goto-char (point-max)))\r
+>>\r
+>> If the case is like I think, it should have used (open-line 1) instead.\r
+>>\r
+>> Anyway, what about:\r
+>\r
+> Hi Tomi, what about [1] instead? KISS and all that.\r
+\r
+Indeed, I just looked that. Looks Good. Will test tomorrow...\r
+\r
+>\r
+> Cheers,\r
+> Jani.\r
+\r
+Tomi\r
+\r
+PS: my test signature intentionally left there ;)\r
+\r
+>\r
+> [1] id:cover.1377718199.git.jani@nikula.org\r
+>\r
+>\r
+>>\r
+>> (goto-char (point-max))\r
+>> (when (re-search-backward message-signature-separator nil t)\r
+>> (forward-line -1)\r
+>> (unless (eolp)\r
+>> (end-of-line)\r
+>> (newline)))\r
+>>\r
+>> The else clause with (goto-char (point-max)) is unnecessary as \r
+>> with the third argument NOERROR being t point is moved if\r
+>> re-search-backward doesn't find match.\r
+>>\r
+>>>> ---\r
+>>>\r
+>>> Tomi\r
+>>\r
+>> Tomi\r
+>> _______________________________________________\r
+>> notmuch mailing list\r
+>> notmuch@notmuchmail.org\r
+>> http://notmuchmail.org/mailman/listinfo/notmuch\r
+>\r
+> -- \r
+> whoaaa \r
+>\r
+> asdfasfd\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+>\r
+\r
+-- \r
+foobar\r