--- /dev/null
+Return-Path: <too@guru-group.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 F3532431FD9\r
+ for <notmuch@notmuchmail.org>; Fri, 6 Sep 2013 07:32:37 -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 SSF15qBw2Sms for <notmuch@notmuchmail.org>;\r
+ Fri, 6 Sep 2013 07:32:29 -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 A1C3C431FBD\r
+ for <notmuch@notmuchmail.org>; Fri, 6 Sep 2013 07:32:29 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 85AF5100063; Fri, 6 Sep 2013 17:32:23 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] emacs: fix notmuch-mua-reply point placement when\r
+ signature involved\r
+Date: Fri, 6 Sep 2013 17:32:18 +0300\r
+Message-Id: <1378477938-26020-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+Cc: tomi.ollila@iki.fi\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: Fri, 06 Sep 2013 14:32:38 -0000\r
+\r
+When composing a reply, notmuch-mua-reply attempts to cite the\r
+the original message by inserting it before the user signature, if\r
+one is present. The existing method used to search the signature\r
+separator backward from the end of the buffer and then move one\r
+line up. In case of variable `message-signature-insert-empty-line'\r
+being nil this caused point to go to the beginning of\r
+'--text follows this line--'\r
+separator line, and citation was inserted there.\r
+This change checks the value of `message-signature-insert-empty-line'\r
+and doesn't move point if that is nil. Additional narrowing to\r
+the body region ensures that point never goes to the separator line\r
+(or beyond).\r
+`message-signature-setup-hook' or `message-setup-hook' may already have\r
+added some other content to the message body, therefore using simply\r
+(message-goto-body) to move point to the beginning of body might lead\r
+to unexpected results.\r
+\r
+Original patch from "Geoffrey H. Ferrari", continued with iterations\r
+from Jani and Mark.\r
+---\r
+\r
+This is update to\r
+\r
+id:1378322458-30159-1-git-send-email-tomi.ollila@iki.fi\r
+\r
+with comment changes only.\r
+\r
+Tomi\r
+\r
+ emacs/notmuch-mua.el | 15 ++++++++++-----\r
+ 1 file changed, 10 insertions(+), 5 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index ff8149b..d41c0b3 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -196,11 +196,16 @@ list."\r
+ nil (notmuch-mua-get-switch-function))))\r
+ \r
+ ;; Insert the message body - but put it in front of the signature\r
+- ;; if one is present\r
+- (goto-char (point-max))\r
+- (if (re-search-backward message-signature-separator nil t)\r
+- (forward-line -1)\r
+- (goto-char (point-max)))\r
++ ;; if one is present, and after any other content\r
++ ;; message*setup-hooks may have added to the message body already.\r
++ (save-restriction\r
++ (message-goto-body)\r
++ (narrow-to-region (point) (point-max))\r
++ (goto-char (point-max))\r
++ (if (re-search-backward message-signature-separator nil t)\r
++ (if message-signature-insert-empty-line\r
++ (forward-line -1))\r
++ (goto-char (point-max))))\r
+ \r
+ (let ((from (plist-get original-headers :From))\r
+ (date (plist-get original-headers :Date))\r
+-- \r
+1.8.0\r
+\r