[PATCH] emacs: bugfix notmuch-mua-reply when signature is present
authorGeoffrey Ferrari <geoffrey.ferrari@oriel.oxon.org>
Thu, 8 Aug 2013 11:35:32 +0000 (12:35 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:15 +0000 (09:56 -0800)
1b/7ca35fda092f958ecd4a8d59c9371db7c13e05 [new file with mode: 0644]

diff --git a/1b/7ca35fda092f958ecd4a8d59c9371db7c13e05 b/1b/7ca35fda092f958ecd4a8d59c9371db7c13e05
new file mode 100644 (file)
index 0000000..d30abe9
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <geoffrey.ferrari@gmail.com>\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 45942430ACB\r
+       for <notmuch@notmuchmail.org>; Thu,  8 Aug 2013 13:30:21 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] 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 b0Cu8vUMUPRX for <notmuch@notmuchmail.org>;\r
+       Thu,  8 Aug 2013 13:30:16 -0700 (PDT)\r
+Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com\r
+ [74.125.83.43])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 3193049B9E9   for <notmuch@notmuchmail.org>; Thu,  8 Aug 2013 04:35:51 -0700\r
+ (PDT)\r
+Received: by mail-ee0-f43.google.com with SMTP id e52so1452699eek.2\r
+       for <notmuch@notmuchmail.org>; Thu, 08 Aug 2013 04:35:48 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=sender:from:to:cc:subject:date:message-id;\r
+       bh=Ei5t4DgOvF6HsCKKDfWQeShwrQQ8SnTeBVlF73op82s=;\r
+       b=YpI9u42FXrqJo2nrRFUhzc4pXQ73f9R4KMCyH3cYdJpOnGpmM3snFwFAwiprULFXIk\r
+       5k2KoVYea5wfQcHOCwkd7MaUwa/SDPnzPADR/vW76xlAfsmXhvppJNOoEvpf2KP3jtZm\r
+       G/fKMc0N4dgWlJhv16P72MiMQeEvCMUO6lnQdIVJi37D8VtNC1pf0LrNX8LckevJGbsw\r
+       kqBNdY7gPiiOqisK0zqJN8DqVUpL4icK6adm2ewpcgwCtqgIrqICjRiEDy++OwsXYyrs\r
+       4KC7TmaOgOyzbQIfuFzLi5CXTJFjF252A9j6KBJKTfVKLDw+WS2/QOYJLEll6KS1r5XC\r
+       7eGw==\r
+X-Received: by 10.14.2.200 with SMTP id 48mr2287416eef.58.1375961748342;\r
+       Thu, 08 Aug 2013 04:35:48 -0700 (PDT)\r
+Received: from lindy.local (cpc4-oxfd20-2-0-cust69.4-3.cable.virginmedia.com.\r
+       [86.26.58.70])\r
+       by mx.google.com with ESMTPSA id a1sm18450990eem.1.2013.08.08.04.35.45\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128);\r
+       Thu, 08 Aug 2013 04:35:47 -0700 (PDT)\r
+Sender: Geoffrey Ferrari <geoffrey.ferrari@gmail.com>\r
+From: Geoffrey Ferrari <geoffrey.ferrari@oriel.oxon.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: bugfix notmuch-mua-reply when signature is present\r
+Date: Thu,  8 Aug 2013 12:35:32 +0100\r
+Message-Id:\r
+ <1375961732-14327-1-git-send-email-geoffrey.ferrari@oriel.oxon.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+X-Mailman-Approved-At: Thu, 08 Aug 2013 23:01:44 -0700\r
+Cc: "Geoffrey H. Ferrari" <geoffrey.ferrari@oriel.oxon.org>\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: Thu, 08 Aug 2013 20:30:21 -0000\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
+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
+ emacs/notmuch-mua.el |    2 +-\r
+ 1 file changed, 1 insertion(+), 1 deletion(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 2baae5f..86f164d 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -194,7 +194,7 @@ list."\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
++        (newline)\r
+       (goto-char (point-max)))\r
\r
+       (let ((from (plist-get original-headers :From))\r
+-- \r
+1.7.10.4\r
+\r