From d28abf35ca19263beb0df6a41df4ba8d5378e51a Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Thu, 5 Sep 2013 10:19:58 +0100 Subject: [PATCH 1/1] Re: [PATCH 1/1] emacs: fix notmuch-mua-reply point placement when signature involved --- 7e/b702470d6ac73f4a48e46d2c2ec3477c932a15 | 130 ++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 7e/b702470d6ac73f4a48e46d2c2ec3477c932a15 diff --git a/7e/b702470d6ac73f4a48e46d2c2ec3477c932a15 b/7e/b702470d6ac73f4a48e46d2c2ec3477c932a15 new file mode 100644 index 000000000..5b6135eaf --- /dev/null +++ b/7e/b702470d6ac73f4a48e46d2c2ec3477c932a15 @@ -0,0 +1,130 @@ +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 C3C95431FDD + for ; Thu, 5 Sep 2013 02:20:06 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 silFP2Ryx8j5 for ; + Thu, 5 Sep 2013 02:20:02 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id EE766431FDB + for ; Thu, 5 Sep 2013 02:20:01 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1VHVjL-0001qT-VB; Thu, 05 Sep 2013 10:20:00 +0100 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1VHVjL-0000iU-NH; Thu, 05 Sep 2013 10:19:59 +0100 +From: Mark Walters +To: "Tomi.Ollila" , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/1] emacs: fix notmuch-mua-reply point placement when + signature involved +In-Reply-To: <1378322458-30159-1-git-send-email-tomi.ollila@iki.fi> +References: <1378322458-30159-1-git-send-email-tomi.ollila@iki.fi> +User-Agent: Notmuch/0.15.2+269~g01f5508 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Thu, 05 Sep 2013 10:19:58 +0100 +Message-ID: <87ob87r5fl.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 5bc977f7bdd0136418a04253584d5892 (of first 20000 bytes) +X-SpamAssassin-Score: 0.0 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored 0.0 points. Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.0 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +Cc: tomi.ollila@iki.fi +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, 05 Sep 2013 09:20:06 -0000 + + +LGTM +1 + +Best wishes + +Mark + +On Wed, 04 Sep 2013, "Tomi.Ollila" wrote: +> From: Tomi Ollila +> +> When composing a reply, notmuch-mua-reply attempts to cite the +> the original message by inserting it before the user signature, if +> one is present. The existing method used to search the signature +> separator backward from the end of the buffer and then move one +> line up. In case of variable `message-signature-insert-empty-line' +> being nil (and `message-signature-setup-hook' not intervening) this +> caused point to go to the beginning of '--text follows this line--' +> separator line, and citation was inserted there. +> This change checks the value of `message-signature-insert-empty-line' +> and doesn't move point if that is nil. Additional narrowing to +> the body region ensures that point never goes to the separator line +> (or beyond). +> +> Original patch from "Geoffrey H. Ferrari", continued with iterations +> from Jani and Mark. +> --- +> emacs/notmuch-mua.el | 12 ++++++++---- +> 1 file changed, 8 insertions(+), 4 deletions(-) +> +> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +> index 2baae5f..0280c9f 100644 +> --- a/emacs/notmuch-mua.el +> +++ b/emacs/notmuch-mua.el +> @@ -192,10 +192,14 @@ list." +> +> ;; Insert the message body - but put it in front of the signature +> ;; if one is present +> - (goto-char (point-max)) +> - (if (re-search-backward message-signature-separator nil t) +> - (forward-line -1) +> - (goto-char (point-max))) +> + (save-restriction +> + (message-goto-body) +> + (narrow-to-region (point) (point-max)) +> + (goto-char (point-max)) +> + (if (re-search-backward message-signature-separator nil t) +> + (if message-signature-insert-empty-line +> + (forward-line -1)) +> + (goto-char (point-max)))) +> +> (let ((from (plist-get original-headers :From)) +> (date (plist-get original-headers :Date)) +> -- +> 1.8.0 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch + -- 2.26.2