From 99669c2b89f9370487257fb8d6525c48c6e569ba Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Mon, 7 Mar 2016 19:17:00 +0200 Subject: [PATCH] Re: [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations. --- d2/4ec90ce99d0e139f4f3f52b01225a4c1eff057 | 197 ++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 d2/4ec90ce99d0e139f4f3f52b01225a4c1eff057 diff --git a/d2/4ec90ce99d0e139f4f3f52b01225a4c1eff057 b/d2/4ec90ce99d0e139f4f3f52b01225a4c1eff057 new file mode 100644 index 000000000..b87bc219d --- /dev/null +++ b/d2/4ec90ce99d0e139f4f3f52b01225a4c1eff057 @@ -0,0 +1,197 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 637636DE0C5F + for ; Mon, 7 Mar 2016 09:18:13 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.55 +X-Spam-Level: +X-Spam-Status: No, score=-0.55 tagged_above=-999 required=5 tests=[AWL=0.170, + DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, + RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id jrmEbRjBUylY for ; + Mon, 7 Mar 2016 09:18:07 -0800 (PST) +Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com + [74.125.82.52]) by arlo.cworth.org (Postfix) with ESMTPS id 844E86DE021D for + ; Mon, 7 Mar 2016 09:18:06 -0800 (PST) +Received: by mail-wm0-f52.google.com with SMTP id p65so117353470wmp.1 + for ; Mon, 07 Mar 2016 09:18:06 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=nikula-org.20150623.gappssmtp.com; s=20150623; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version; bh=LIUbFU5noZuXk5mCkx6GyWjTUt78Ri+c3y7DHFR4swo=; + b=Jxqp1MwAO9UmiSakFPj4uEHRWjUQlDzTLZWEDV/JSmHaHSfjIVwsFtYnzKwAwZbajh + lECpFdTvIqO7M1k+4QXMs1fyKlCAfOzqJvHYohV6WK4oOmhVr4ABQbcnA66nkMEOBUGG + G2va5xL5YEeTdotNoct6PzbIIvCWMPAVF6oRvGWz0P3K4WseU+tU0uGEX7n405Z3hM7/ + kfYxAIb41b4safX2lNX2S0z7DxAt94vG6ayGqOmK5MZP1u7vlLTOcrwPg+BJu8EMNezu + rGSiG678A9a6aGk5wMNxQzNEoXY76qdCxUR5Egj3VQ18MRZ/ZpTRnGlVssIUiZQ0cbpi + XBsw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version; + bh=LIUbFU5noZuXk5mCkx6GyWjTUt78Ri+c3y7DHFR4swo=; + b=fDawC2binuxuJoh4Di6QUR91+fiA3hehJsKc2gwHgrdez+Kb4Bn6/dTA9CYR/BXEyq + eyMdgIxOT+DTfVymo9bz/MM6PXOWPXnKNsOhZXo2pXUkanrdlRQ1SRiISBN2NHw3Y4tV + OX66yhmqetMaCHJfSY8vOHI72e6R/rVhlgfjnTiAcjKTj0odHygCZxECT7dLOOOP2UzQ + CitfQatj5n4Vplqb6qW5Ff0ZfkUX9JkWqPmsTsoLB/wmrSF/Ao68ukWhaDX3xiy+xS5S + fW0LvlPhbLfX9Cmuh6xntAqZgrDpurOqajBopYLWvWL6UlauyE2+uCBz1EaUcqPXoV+B + Zb5w== +X-Gm-Message-State: + AD7BkJKa4ylDgo95xBjFdp0cC2HQiUG5wDbySzFkvgvfIkFwpu5qQIodRHQWWoaySOFKDA== +X-Received: by 10.28.221.9 with SMTP id u9mr9024627wmg.92.1457371083772; + Mon, 07 Mar 2016 09:18:03 -0800 (PST) +Received: from localhost (mobile-access-bcee39-255.dhcp.inet.fi. + [188.238.57.255]) + by smtp.gmail.com with ESMTPSA id hx10sm18875182wjb.25.2016.03.07.09.18.02 + (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 07 Mar 2016 09:18:02 -0800 (PST) +From: Jani Nikula +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH v6 6/6] emacs/mua: Let user specify which parts get a + header in citations. +In-Reply-To: <1455992680-24978-7-git-send-email-markwalters1009@gmail.com> +References: <1455992680-24978-1-git-send-email-markwalters1009@gmail.com> + <1455992680-24978-7-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.21+73~gf8cc320 (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-pc-linux-gnu) +Date: Mon, 07 Mar 2016 19:17:00 +0200 +Message-ID: <87y49uqkc3.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Mon, 07 Mar 2016 17:18:13 -0000 + +On Sat, 20 Feb 2016, Mark Walters wrote: +> [ text/plain ] + +This patch (or, bisected commit d27d90875dfb emacs/mua: Let user specify +which parts get a header in citations.) causes the above to be added to +all replies. Why? + +I don't understand what "header" the patch is talking about. If it's the +[ text/plain ] above and it's intentional, *shudder*. Who would want +that? + +BR, +Jani. + + +> From: David Edmondson +> +> Add a customizable function specifying which parts get a header when +> replying, and give some sensible possiblities. These are, +> +> 1) all parts except multipart/*. (Subparts of a multipart part do +> receive a header button.) +> +> 2) only included text/* parts. +> +> 3) Exactly as in the show buffer. +> +> 4) None at all. This means the reply contains a mish-mash of all the +> original message's parts. +> +> In the test suite we set the choice to option 4 to match the +> previous behaviour. +> --- +> emacs/notmuch-mua.el | 19 ++++++++++++++++++- +> emacs/notmuch-show.el | 10 ++++++++++ +> test/test-lib.el | 4 ++++ +> 3 files changed, 32 insertions(+), 1 deletion(-) +> +> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +> index ecc5bec..fcb3e95 100644 +> --- a/emacs/notmuch-mua.el +> +++ b/emacs/notmuch-mua.el +> @@ -93,6 +93,23 @@ (defcustom notmuch-mua-cite-function 'message-cite-original +> :link '(custom-manual "(message)Insertion Variables") +> :group 'notmuch-reply) +> +> +(defcustom notmuch-mua-reply-insert-header-p-function +> + 'notmuch-show-reply-insert-header-p-trimmed +> + "Function to decide which parts get a header when replying. +> + +> +This function specifies which parts of a mime message with +> +mutiple parts get a header." +> + :type '(radio (const :tag "All except multipart/* and hidden parts" +> + notmuch-show-reply-insert-header-p-trimmed) +> + (const :tag "Only for included text parts" +> + notmuch-show-reply-insert-header-p-minimal) +> + (const :tag "Exactly as in show view" +> + notmuch-show-insert-header-p) +> + (const :tag "No part headers" +> + notmuch-show-reply-insert-header-p-never) +> + (function :tag "Other")) +> + :group 'notmuch-reply) +> + +> ;; +> +> (defun notmuch-mua-get-switch-function () +> @@ -231,7 +248,7 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all) +> ;; Don't omit long parts. +> (notmuch-show-max-text-part-size 0) +> ;; Insert headers for parts as appropriate for replying. +> - (notmuch-show-insert-header-p-function #'notmuch-show-reply-insert-header-p-never)) +> + (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)) +> (notmuch-show-insert-body original (plist-get original :body) 0) +> (buffer-substring-no-properties (point-min) (point-max))))) +> +> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +> index 2a81ec1..371e62d 100644 +> --- a/emacs/notmuch-show.el +> +++ b/emacs/notmuch-show.el +> @@ -954,6 +954,16 @@ (defun notmuch-show-insert-header-p (part hide) +> (defun notmuch-show-reply-insert-header-p-never (part hide) +> nil) +> +> +(defun notmuch-show-reply-insert-header-p-trimmed (part hide) +> + (let ((mime-type (notmuch-show-mime-type part))) +> + (and (not (notmuch-match-content-type mime-type "multipart/*")) +> + (not hide)))) +> + +> +(defun notmuch-show-reply-insert-header-p-minimal (part hide) +> + (let ((mime-type (notmuch-show-mime-type part))) +> + (and (notmuch-match-content-type mime-type "text/*") +> + (not hide)))) +> + +> (defun notmuch-show-insert-bodypart (msg part depth &optional hide) +> "Insert the body part PART at depth DEPTH in the current thread. +> +> diff --git a/test/test-lib.el b/test/test-lib.el +> index 596a705..02e020c 100644 +> --- a/test/test-lib.el +> +++ b/test/test-lib.el +> @@ -184,6 +184,10 @@ (defmacro notmuch-test-progn (&rest body) +> (setq notmuch-tag-deleted-formats +> '((".*" nil))) +> +> +;; For historical reasonse we don't print part headers when replying +> +;; in the tests suite +> +(setq notmuch-mua-reply-insert-header-p-function 'notmuch-show-reply-insert-header-p-never) +> + +> ;; force a common html renderer, to avoid test variations between +> ;; environments +> +> -- +> 2.1.4 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> https://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2