Re: [PATCH 1/1] emacs: fix notmuch-mua-reply point placement when signature involved
authorJani Nikula <jani@nikula.org>
Thu, 5 Sep 2013 14:11:19 +0000 (16:11 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:58 +0000 (09:56 -0800)
ea/f24b39af66f2af3068a1cf41bab014f000bac3 [new file with mode: 0644]

diff --git a/ea/f24b39af66f2af3068a1cf41bab014f000bac3 b/ea/f24b39af66f2af3068a1cf41bab014f000bac3
new file mode 100644 (file)
index 0000000..cd3797a
--- /dev/null
@@ -0,0 +1,136 @@
+Return-Path: <jani@nikula.org>\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 1F04C431FDD\r
+       for <notmuch@notmuchmail.org>; Thu,  5 Sep 2013 07:11:36 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[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 29aQ+Tc1CBSp for <notmuch@notmuchmail.org>;\r
+       Thu,  5 Sep 2013 07:11:28 -0700 (PDT)\r
+Received: from mail-we0-f176.google.com (mail-we0-f176.google.com\r
+       [74.125.82.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id BFC1C431FDB\r
+       for <notmuch@notmuchmail.org>; Thu,  5 Sep 2013 07:11:27 -0700 (PDT)\r
+Received: by mail-we0-f176.google.com with SMTP id u56so1770029wes.7\r
+       for <notmuch@notmuchmail.org>; Thu, 05 Sep 2013 07:11:26 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:cc:subject:in-reply-to:references\r
+       :user-agent:date:message-id:mime-version:content-type;\r
+       bh=4HWZEFPntxflgkxmTXydijjqRv/QcW6Rll1HM5o91zI=;\r
+       b=T96K0czwy8Pzag+ErPAWTKZ0DVSEw1MZasA53DQPmJ0xnYNGidPG2fEXqzp2VXstBO\r
+       ig09/al9vY9NO3vSr7SvbH/GCWWTilCxHm1DYIQMwKqXJlk0/yCVaZPJXLTWzKwm2aw1\r
+       l3DT7VLg0A3idwyAutudEHqzDYEPNyJHGbLHDzYWAJHOLusxKX8QQjpGQPCrm1ERSGDr\r
+       XcQ9EqpnixytebqlUhaBNh69C/3o6iOajVRQgRHpm/tw+46XaLs66ywlcOgKnVLYWLuD\r
+       kgTw+WlNOnJI+SBWN2QDFgagw79EL+QZB7Vkvj96hGXMjedDWJyGtuRY/AZl0dsCZ3NE\r
+       Bw9A==\r
+X-Gm-Message-State:\r
+ ALoCoQk7PC7Ds7uvA8Q340LqrnJ927CNwzIL5KlVzhh9OvswaVanXD1LVQQ6XfpQxt1obGmeMC7T\r
+X-Received: by 10.194.109.35 with SMTP id hp3mr1481343wjb.55.1378390286583;\r
+       Thu, 05 Sep 2013 07:11:26 -0700 (PDT)\r
+Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
+       by mx.google.com with ESMTPSA id fz8sm12053385wic.0.1969.12.31.16.00.00\r
+       (version=TLSv1.1 cipher=RC4-SHA bits=128/128);\r
+       Thu, 05 Sep 2013 07:11:25 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: "Tomi.Ollila" <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/1] emacs: fix notmuch-mua-reply point placement when\r
+       signature involved\r
+In-Reply-To: <1378322458-30159-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1378322458-30159-1-git-send-email-tomi.ollila@iki.fi>\r
+User-Agent: Notmuch/0.15.2+177~gb1ba76c (http://notmuchmail.org) Emacs/23.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Thu, 05 Sep 2013 16:11:19 +0200\r
+Message-ID: <87d2one4u0.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\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: Thu, 05 Sep 2013 14:11:36 -0000\r
+\r
+On Wed, 04 Sep 2013, "Tomi.Ollila" <tomi.ollila@iki.fi> wrote:\r
+> From: Tomi Ollila <tomi.ollila@iki.fi>\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 (and `message-signature-setup-hook' not intervening) this\r
+> caused point to go to the beginning of '--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
+>\r
+> Original patch from "Geoffrey H. Ferrari", continued with iterations\r
+> from Jani and Mark.\r
+\r
+Hi Tomi, I don't think you've sufficiently convinced me why we need all\r
+this complexity instead of just doing [1]. And if you do get me\r
+convinced, I'd like the reason to be in the commit message and in a\r
+comment above the piece of code in question.\r
+\r
+Cheers,\r
+Jani.\r
+\r
+\r
+[1] id:cover.1377718199.git.jani@nikula.org\r
+\r
+\r
+\r
+\r
+> ---\r
+>  emacs/notmuch-mua.el | 12 ++++++++----\r
+>  1 file changed, 8 insertions(+), 4 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+> index 2baae5f..0280c9f 100644\r
+> --- a/emacs/notmuch-mua.el\r
+> +++ b/emacs/notmuch-mua.el\r
+> @@ -192,10 +192,14 @@ list."\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
+> +      (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
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r