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 3098941ED6B for ; Tue, 24 Jan 2012 04:54:02 -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 1ngNjOlXNMfu for ; Tue, 24 Jan 2012 04:54:01 -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 21BE8421198 for ; Tue, 24 Jan 2012 04:54:01 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id hi8so1525144wib.26 for ; Tue, 24 Jan 2012 04:54:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.106.33 with SMTP id gr1mr20425298wib.6.1327409640746; Tue, 24 Jan 2012 04:54:00 -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 n5sm33231879wiw.7.2012.01.24.04.53.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jan 2012 04:53:59 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id F013E9FD4A; Tue, 24 Jan 2012 12:53:55 +0000 (GMT) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH 3/3] emacs: Don't insert a part header if it's the first part and text/*. Date: Tue, 24 Jan 2012 12:53:40 +0000 Message-Id: <1327409620-10133-4-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1327409620-10133-1-git-send-email-dme@dme.org> References: <1327052612-1040-1-git-send-email-dme@dme.org> <1327409620-10133-1-git-send-email-dme@dme.org> X-Gm-Message-State: ALoCoQlnvUhs7BGQmPMpDNekSo32fldBZw0va1praCEMwBLYOKBnrRpy2n2fmB7e/MIqnlSA8Ihl 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: Tue, 24 Jan 2012 12:54:02 -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 a0a2873..23bf1f4 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -370,7 +370,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 ": ") "") @@ -660,10 +662,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