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 E71986DE0231 for ; Tue, 9 Feb 2016 14:36:03 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.225 X-Spam-Level: X-Spam-Status: No, score=-0.225 tagged_above=-999 required=5 tests=[AWL=0.345, 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 vWpkkzGE-gZf for ; Tue, 9 Feb 2016 14:36:01 -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 75B176DE01D3 for ; Tue, 9 Feb 2016 14:36:01 -0800 (PST) Received: by mail-wm0-f66.google.com with SMTP id c200so528109wme.0 for ; Tue, 09 Feb 2016 14:36:01 -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:content-type; bh=UPVD4E22bC6pyZoFr8O6/msntaRyc7QfhOtp2vcDk1k=; b=rCPsD94mYuJAVzpJaBkVEdT/JHHEK1YEjazVFgRtiWg7hIOAlPgtcNOhm5MvgeAiIr lBkVYRZY0/luKFq4YeF4Z9x3+qn+GUREWxI81pwhDwH+/Kx1WHJdoAalUSn8QIHfZh+R OpdBgTXv7kzaM7C8DW8n6CLEwVhD69otN7NAgndYEnM3oA9D03TBivnD+szCV1aceQc4 A5SZhyeAlZfasadqd19U+uLLcvkvJv4A3x1ZvlLaLi8IWWgBTlusb0iQCc9S4Vffzf6z qZXl9K2I30XiUyQJ9rqnCrQHnYl5jbYdpFhvjkffd5d7QQ8yGwGiKMlvvEgzADQUKeJS 8+ag== 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:content-type; bh=UPVD4E22bC6pyZoFr8O6/msntaRyc7QfhOtp2vcDk1k=; b=bRE/EeGqy2BdVhdWk+XFBPdLdxYAvHhoGDyUq2xroPLXRvTGxZjHZTo22F6Yf2J15t Gx7RBeGUE14mGIGBe2pVXafIFtgv2UooDuVSTShnv9JchtMQWRKcK+RCSmdO2Ny6OHBZ 6KWUkpZFs5PVJRULP1pzTEJ4aVo2awyuDc57n2eJjw2013yJnvjLJWdHUslCH2ZztsJr ZitiCFhfGO8VISUNB5fgvt8OH0l7hDZ5BiZKwal5LhKlhdNwiQUkFzfHrXpsAF967LRe HL1Ot0HN2dErfAm8qaXesokMJxmIsgBQMnc824UviwS1c+BHK9N7Hq6XWgfLRQaJI8JJ m2jg== X-Gm-Message-State: AG10YOSARhJUkNsQ/lYpBg8xAbMJDxk8pMenJagcE8OZTUddv9PlOAOtXqe9hPNA0fkOkA== X-Received: by 10.28.184.137 with SMTP id i131mr7014886wmf.96.1455057360115; Tue, 09 Feb 2016 14:36:00 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id uo9sm126876wjc.49.2016.02.09.14.35.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2016 14:35:59 -0800 (PST) From: Mark Walters To: David Edmondson , notmuch@notmuchmail.org Subject: Re: [PATCH v4 6/7] emacs/mua: Let user specify which parts get a header in citations. In-Reply-To: References: <1446894276-7814-1-git-send-email-markwalters1009@gmail.com> <1446894276-7814-7-git-send-email-markwalters1009@gmail.com> User-Agent: Notmuch/0.18.1+485~gca076ce (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Tue, 09 Feb 2016 22:35:58 +0000 Message-ID: <87twlh5x69.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: Tue, 09 Feb 2016 22:36:04 -0000 On Tue, 09 Feb 2016, David Edmondson wrote: > On Sat, Nov 07 2015, Mark Walters wrote: >> 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. >> --- >> emacs/notmuch-mua.el | 30 ++++++++++++++++++++++++++---- >> emacs/notmuch-show.el | 13 +++++++++++++ >> 2 files changed, 39 insertions(+), 4 deletions(-) >> >> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el >> index 2f7abb0..a675f47 100644 >> --- a/emacs/notmuch-mua.el >> +++ b/emacs/notmuch-mua.el >> @@ -91,6 +91,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) >> + > > These are all functions - should we be `declare-function'ing them, given > that they come from elsewhere? Presumably the compiler is not clever > enough to complain if we don't. Hi, The compiler doesn't seem to complain. But I don't know if we should have the declare functions anyway? Any thoughts? Best wishes Mark > >> ;; >> >> (defun notmuch-mua-get-switch-function () >> @@ -221,10 +238,15 @@ (defun notmuch-mua-reply (query-string &optional sender reply-all) >> (insert "Date: " date "\n\n") >> >> (insert (with-temp-buffer >> - ;; Don't attempt to clean up messages, excerpt >> - ;; citations, etc. in the original message before >> - ;; quoting. >> - (let ((notmuch-show-insert-text/plain-hook nil)) >> + (let >> + ;; Don't attempt to clean up messages, excerpt >> + ;; citations, etc. in the original message before >> + ;; quoting. >> + ((notmuch-show-insert-text/plain-hook nil) >> + ;; 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-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 f4a65cc..7ff9ed5 100644 >> --- a/emacs/notmuch-show.el >> +++ b/emacs/notmuch-show.el >> @@ -959,6 +959,19 @@ (defun notmuch-show-insert-header-p (part hide) >> (not (and (string= mime-type "text/plain") >> (<= (plist-get part :id) 1))))) >> >> +(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. >> >> -- >> 2.1.4