From 4d01d510ce55d5c8fd1154b5180598552989a12f Mon Sep 17 00:00:00 2001 From: Geoffrey Ferrari Date: Thu, 8 Aug 2013 12:35:32 +0100 Subject: [PATCH] [PATCH] emacs: bugfix notmuch-mua-reply when signature is present --- 1b/7ca35fda092f958ecd4a8d59c9371db7c13e05 | 105 ++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 1b/7ca35fda092f958ecd4a8d59c9371db7c13e05 diff --git a/1b/7ca35fda092f958ecd4a8d59c9371db7c13e05 b/1b/7ca35fda092f958ecd4a8d59c9371db7c13e05 new file mode 100644 index 000000000..d30abe984 --- /dev/null +++ b/1b/7ca35fda092f958ecd4a8d59c9371db7c13e05 @@ -0,0 +1,105 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 45942430ACB + for ; Thu, 8 Aug 2013 13:30:21 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.699 +X-Spam-Level: +X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id b0Cu8vUMUPRX for ; + Thu, 8 Aug 2013 13:30:16 -0700 (PDT) +Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com + [74.125.83.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 3193049B9E9 for ; Thu, 8 Aug 2013 04:35:51 -0700 + (PDT) +Received: by mail-ee0-f43.google.com with SMTP id e52so1452699eek.2 + for ; Thu, 08 Aug 2013 04:35:48 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=sender:from:to:cc:subject:date:message-id; + bh=Ei5t4DgOvF6HsCKKDfWQeShwrQQ8SnTeBVlF73op82s=; + b=YpI9u42FXrqJo2nrRFUhzc4pXQ73f9R4KMCyH3cYdJpOnGpmM3snFwFAwiprULFXIk + 5k2KoVYea5wfQcHOCwkd7MaUwa/SDPnzPADR/vW76xlAfsmXhvppJNOoEvpf2KP3jtZm + G/fKMc0N4dgWlJhv16P72MiMQeEvCMUO6lnQdIVJi37D8VtNC1pf0LrNX8LckevJGbsw + kqBNdY7gPiiOqisK0zqJN8DqVUpL4icK6adm2ewpcgwCtqgIrqICjRiEDy++OwsXYyrs + 4KC7TmaOgOyzbQIfuFzLi5CXTJFjF252A9j6KBJKTfVKLDw+WS2/QOYJLEll6KS1r5XC + 7eGw== +X-Received: by 10.14.2.200 with SMTP id 48mr2287416eef.58.1375961748342; + Thu, 08 Aug 2013 04:35:48 -0700 (PDT) +Received: from lindy.local (cpc4-oxfd20-2-0-cust69.4-3.cable.virginmedia.com. + [86.26.58.70]) + by mx.google.com with ESMTPSA id a1sm18450990eem.1.2013.08.08.04.35.45 + for + (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); + Thu, 08 Aug 2013 04:35:47 -0700 (PDT) +Sender: Geoffrey Ferrari +From: Geoffrey Ferrari +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: bugfix notmuch-mua-reply when signature is present +Date: Thu, 8 Aug 2013 12:35:32 +0100 +Message-Id: + <1375961732-14327-1-git-send-email-geoffrey.ferrari@oriel.oxon.org> +X-Mailer: git-send-email 1.7.10.4 +X-Mailman-Approved-At: Thu, 08 Aug 2013 23:01:44 -0700 +Cc: "Geoffrey H. Ferrari" +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 08 Aug 2013 20:30:21 -0000 + +From: "Geoffrey H. Ferrari" + +When composing a reply, notmuch-mua-reply tries to be smart and cite +the original message by inserting it before the user signature, if +one is present. However, the existing method of backward searching +from the end of the buffer to find the signature separator and then +moving one line up results in the original message being cited in +the message headers. That's because at this point the message looks +like this (with | representing point after searching for the +signature separator): + +From: xxx +To: xxx +Subject: xxx +--text follows this line-- +|-- +My fancy signature + +With this patch, a newline is opened instead, so that the orignal +message is cited above the signature but still in the message text. +--- + emacs/notmuch-mua.el | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +index 2baae5f..86f164d 100644 +--- a/emacs/notmuch-mua.el ++++ b/emacs/notmuch-mua.el +@@ -194,7 +194,7 @@ list." + ;; if one is present + (goto-char (point-max)) + (if (re-search-backward message-signature-separator nil t) +- (forward-line -1) ++ (newline) + (goto-char (point-max))) + + (let ((from (plist-get original-headers :From)) +-- +1.7.10.4 + -- 2.26.2