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