From: David Edmondson Date: Mon, 6 Feb 2012 15:39:08 +0000 (+0000) Subject: [PATCH v3 3/3] emacs: Don't insert a part header if it's the first part and text/*. X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=26fb7dd82c0fc2e6f6bcd23d05b47c2823831529;p=notmuch-archives.git [PATCH v3 3/3] emacs: Don't insert a part header if it's the first part and text/*. --- diff --git a/87/535bccf106f737e0de90b47d52727d482fb10f b/87/535bccf106f737e0de90b47d52727d482fb10f new file mode 100644 index 000000000..b26dd000b --- /dev/null +++ b/87/535bccf106f737e0de90b47d52727d482fb10f @@ -0,0 +1,92 @@ +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 B719A431FBF + for ; Mon, 6 Feb 2012 07:39:16 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +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 dqBt5ZwrZEaj for ; + Mon, 6 Feb 2012 07:39:16 -0800 (PST) +Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com + [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D5302431FAE + for ; Mon, 6 Feb 2012 07:39:15 -0800 (PST) +Received: by wibhi8 with SMTP id hi8so4927727wib.26 + for ; Mon, 06 Feb 2012 07:39:13 -0800 (PST) +Received: by 10.180.92.229 with SMTP id cp5mr11094796wib.8.1328542752991; + Mon, 06 Feb 2012 07:39:12 -0800 (PST) +Received: from hotblack-desiato.hh.sledj.net + (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) + by mx.google.com with ESMTPS id y1sm47465370wiw.6.2012.02.06.07.39.10 + (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 06 Feb 2012 07:39:11 -0800 (PST) +Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) + id 53BC3A0E85; Mon, 6 Feb 2012 15:39:09 +0000 (GMT) +From: David Edmondson +To: notmuch@notmuchmail.org +Subject: [PATCH v3 3/3] emacs: Don't insert a part header if it's the first + part and text/*. +Date: Mon, 6 Feb 2012 15:39:08 +0000 +Message-Id: <1328542748-19530-5-git-send-email-dme@dme.org> +X-Mailer: git-send-email 1.7.8.3 +In-Reply-To: <1328542748-19530-1-git-send-email-dme@dme.org> +References: <1327052612-1040-1-git-send-email-dme@dme.org> + <1328542748-19530-1-git-send-email-dme@dme.org> +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: Mon, 06 Feb 2012 15:39:16 -0000 + +Previously this logic applied only to text/plain. Allow it for other +text/* parts as well. +--- + emacs/notmuch-show.el | 9 ++++----- + 1 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index ce79762..c60e613 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -412,7 +412,9 @@ CONTENT-TYPE parts." + (defun notmuch-show-insert-part-header (nth content-type declared-type + &optional name comment + &rest button-parameters) +- (unless (notmuch-show-hidden-part-header content-type) ++ (unless (or (notmuch-show-hidden-part-header content-type) ++ (and (= nth 1) ++ (string-match "text/*" content-type))) + (apply #'insert-button + (concat "[ " + (if name (concat name ": ") "") +@@ -703,10 +705,7 @@ current buffer, if possible." + + (defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type) + (let ((start (point))) +- ;; If this text/plain part is not the first part in the message, +- ;; insert a header to make this clear. +- (if (> nth 1) +- (notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename))) ++ (notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename)) + (insert (notmuch-show-get-bodypart-content msg part nth)) + (save-excursion + (save-restriction +-- +1.7.8.3 +