[PATCH 2/2] emacs: slightly cleanup the reply code
authorJani Nikula <jani@nikula.org>
Wed, 28 Aug 2013 19:34:22 +0000 (22:34 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:44 +0000 (09:56 -0800)
2a/df5edb8cfc9b0287f9dabe4bb6330821e85de6 [new file with mode: 0644]

diff --git a/2a/df5edb8cfc9b0287f9dabe4bb6330821e85de6 b/2a/df5edb8cfc9b0287f9dabe4bb6330821e85de6
new file mode 100644 (file)
index 0000000..3bec808
--- /dev/null
@@ -0,0 +1,127 @@
+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 2CDDA431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Aug 2013 12:34:34 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\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 g4aN0dtpoMRC for <notmuch@notmuchmail.org>;\r
+       Wed, 28 Aug 2013 12:34:28 -0700 (PDT)\r
+Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com\r
+ [74.125.83.42])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 63F4D431FC4   for <notmuch@notmuchmail.org>; Wed, 28 Aug 2013 12:34:28 -0700\r
+ (PDT)\r
+Received: by mail-ee0-f42.google.com with SMTP id b45so3177631eek.15\r
+       for <notmuch@notmuchmail.org>; Wed, 28 Aug 2013 12:34:27 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+       :references:in-reply-to:references;\r
+       bh=TRDiVDDQCp6662WBQOOA0WoquVwqrGGsTCyo69NQkhg=;\r
+       b=R73PMtFTx/I3w18ZTMGBYWjS7sS1uWbNDSwfFbDc2/BJ3pB/8M8IjSSKfxxIPSfQDL\r
+       qVH1Gw5XX0LOBHg7cYlGUGPf8SKBV9xNUyIhGyDCYmpbMBAAGypIR3cggc04z0dlirwP\r
+       2DT80gFp9LOWxKi6Wwr700VaEcO7Hha8JDE4pyXtu5zZWHjh2+Y2Tu+NFM+YdpynHJRA\r
+       MbybKx/qH0nE5W6gq+1NO70RD0guYEnG56yC7FJF1tfk+gBHZUWajCGhURBf4VRfGJGI\r
+       LgiHcEHGHYiKQSqmS0mTdrStV0+vIktsho0uUboySIvnoMYeKFb5HiqHztDGiP2ArHDr\r
+       46+w==\r
+X-Gm-Message-State:\r
+ ALoCoQmYSbXz5wVxbg0ptfPuHhG62epQ2S4Qry0HgoqF1ucwqBtVGugpjjjpV87oEM/i0uGPeFTm\r
+X-Received: by 10.14.207.132 with SMTP id n4mr2451531eeo.102.1377718467248;\r
+       Wed, 28 Aug 2013 12:34:27 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91])\r
+       by mx.google.com with ESMTPSA id m54sm40026815eex.2.1969.12.31.16.00.00\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Wed, 28 Aug 2013 12:34:26 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] emacs: slightly cleanup the reply code\r
+Date: Wed, 28 Aug 2013 22:34:22 +0300\r
+Message-Id:\r
+ <d06cb294c7bc815cad1171bfec994832401e285f.1377718199.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1377718199.git.jani@nikula.org>\r
+References: <cover.1377718199.git.jani@nikula.org>\r
+In-Reply-To: <cover.1377718199.git.jani@nikula.org>\r
+References: <cover.1377718199.git.jani@nikula.org>\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>,\r
+       Geoffrey 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: Wed, 28 Aug 2013 19:34:34 -0000\r
+\r
+Since the starting point for the original message can now be found\r
+with the simple (message-goto-body), there's no need to save\r
+point. Drop the extra let block. No functional changes.\r
+---\r
+ emacs/notmuch-mua.el |   35 +++++++++++++++++------------------\r
+ 1 file changed, 17 insertions(+), 18 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index a4be394..c800250 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -193,24 +193,23 @@ list."\r
+       ;; Move point to the beginning of the message body.\r
+       (message-goto-body)\r
\r
+-      (let ((from (plist-get original-headers :From))\r
+-          (date (plist-get original-headers :Date))\r
+-          (start (point)))\r
+-\r
+-      ;; message-cite-original constructs a citation line based on the From and Date\r
+-      ;; headers of the original message, which are assumed to be in the buffer.\r
+-      (insert "From: " from "\n")\r
+-      (insert "Date: " date "\n\n")\r
+-\r
+-      ;; Get the parts of the original message that should be quoted; this includes\r
+-      ;; all the text parts, except the non-preferred ones in a multipart/alternative.\r
+-      (let ((quotable-parts (notmuch-mua-get-quotable-parts (plist-get original :body))))\r
+-        (mapc (apply-partially 'notmuch-mua-insert-quotable-part original) quotable-parts))\r
+-\r
+-      (set-mark (point))\r
+-      (goto-char start)\r
+-      ;; Quote the original message according to the user's configured style.\r
+-      (message-cite-original))))\r
++      ;; message-cite-original constructs a citation line based on the\r
++      ;; From and Date headers of the original message, which are\r
++      ;; assumed to be in the buffer.\r
++      (insert "From: " (plist-get original-headers :From) "\n")\r
++      (insert "Date: " (plist-get original-headers :Date) "\n\n")\r
++\r
++      ;; Get the parts of the original message that should be quoted;\r
++      ;; this includes all the text parts, except the non-preferred\r
++      ;; ones in a multipart/alternative.\r
++      (let ((quotable-parts (notmuch-mua-get-quotable-parts (plist-get original :body))))\r
++      (mapc (apply-partially 'notmuch-mua-insert-quotable-part original) quotable-parts))))\r
++\r
++  ;; Quote the original message according to the user's configured\r
++  ;; style.\r
++  (set-mark (point))\r
++  (message-goto-body)\r
++  (message-cite-original)\r
\r
+   (goto-char (point-max))\r
+   (push-mark)\r
+-- \r
+1.7.10.4\r
+\r