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 EA0A66DE173B for ; Mon, 7 Mar 2016 11:14:47 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.299 X-Spam-Level: X-Spam-Status: No, score=-0.299 tagged_above=-999 required=5 tests=[AWL=0.271, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] 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 D_Kib-nJgqya for ; Mon, 7 Mar 2016 11:14:45 -0800 (PST) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id 65FC36DE1715 for ; Mon, 7 Mar 2016 11:14:45 -0800 (PST) Received: by mail-wm0-f66.google.com with SMTP id n186so12509730wmn.0 for ; Mon, 07 Mar 2016 11:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version; bh=mRyrXm67pvmymKERiJMrdtvl4UZFexVn2CG52YAEcF4=; b=v21MFF71ysRZ4mE7mIHLisejBrxUxYXRtb0GFGIG7/o224+W5raOE9Z71sRBNu0kcU UoywAAmTvozzbyWJQaAOHr7FeoLD052rEA9w/PpbYntX1uW3p/vpmuIVUGoAQGEIHrBb lPd5gsCnk+95o8QH6wVt8dhcdZpQUxeSH2bNLZwP1gPZPBaYaYEuFKx6nmPMcLie+QQI kqDsSQxz2INtepKnpKrBiZFCR2XZxAPel2hB04MR2tFPkjBB8MF+rEhm26XY4iSzOdQ6 lD0P2A1pR/SrudLFe7qROzZfCIRktJQzB4jyKu1aSmarfCzMpDeOaffYb6o6ISo5ch+O n7LA== 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=mRyrXm67pvmymKERiJMrdtvl4UZFexVn2CG52YAEcF4=; b=GIDxpkAv0Ev0mmCQAshUCMC96NRdO6W+641g+mBvOHKJkngHRtkxMs9GbSnW9JXEPB /ZCpCVERZtrpKnVnj1+TDnQYU3emTXOP0AT+k4RPHW7jnX7FaLSXp8GAw5NuUXv6xU7O V4HBaKWlUoib6xtG6ZQxt4P9bOWhSFIlv3tpfWpGWCN9GfnZgCsHWojbxkQa2QuKh9UH 59ZoUtxgJ+BoOZgXSDXUTBZcqOtsOXk9j68GIv2lz6BMhQRSdd9mX2qknsFvjfKHzkcB ToTLZEQB6xsjRZG0jo+bXTqlT12PSzT0YzfTElyojWJ8XPUKQNsGjnSccRhunbRjPd1U REhg== X-Gm-Message-State: AD7BkJIQEIA+OmaRPNNiTbLJCp5w6T3txndnAZL6Dqf9WOpKTboxl0AzSZTA1a5w5Hv0gg== X-Received: by 10.194.23.37 with SMTP id j5mr23714102wjf.171.1457378084081; Mon, 07 Mar 2016 11:14:44 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id 82sm14992855wmd.4.2016.03.07.11.14.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Mar 2016 11:14:43 -0800 (PST) From: Mark Walters To: David Edmondson , Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH v6 6/6] emacs/mua: Let user specify which parts get a header in citations. In-Reply-To: References: <1455992680-24978-1-git-send-email-markwalters1009@gmail.com> <1455992680-24978-7-git-send-email-markwalters1009@gmail.com> <87y49uqkc3.fsf@nikula.org> User-Agent: Notmuch/0.21+69~gd27d908 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Mon, 07 Mar 2016 19:14:42 +0000 Message-ID: <874mciyual.fsf@qmul.ac.uk> 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 19:14:48 -0000 Hi On Mon, 07 Mar 2016, David Edmondson wrote: > On Mon, Mar 07 2016, Jani Nikula wrote: >> 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? > > We definitely argued about it ages ago (and Mark pointed out as much in > his introduction to the patch series), but I don't remember which > position I took then :-) > > Seeing it now, I suspect that `notmuch-show-insert-header-p' is a better > default. This is customisable: notmuch-mua-reply-insert-header-p-function I like "No part headers". Dme liked having pdf parts (for example) mentioned. It sounds like the help text here needs to be improved. I don't have any strong preferences on the default. Best wishes Mark > >> 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 >> _______________________________________________ >> notmuch mailing list >> notmuch@notmuchmail.org >> https://notmuchmail.org/mailman/listinfo/notmuch