From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 09DDC431FBC for ; Tue, 18 Dec 2012 11:28:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, 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 eli1Y5WHE4ja for ; Tue, 18 Dec 2012 11:28:18 -0800 (PST) Received: from mail-we0-f176.google.com (mail-we0-f176.google.com [74.125.82.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 27C66431FBD for ; Tue, 18 Dec 2012 11:28:14 -0800 (PST) Received: by mail-we0-f176.google.com with SMTP id r5so491422wey.21 for ; Tue, 18 Dec 2012 11:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=BAWRiQrBmfRc0j+WJj8WlAptrQN9s42o9FHvwBqGxrY=; b=0cM/EQRKWLmUspcNmvK3ECTDJZwwojsF7vuHGGHXkthcs3SiLi/EZfgTaK9E7Yhii3 kBgxiLKOtezAXO6UebiXDkeq2p2Qh6QCRfCjdp3k/HH4CrGWUNDYVlyKNWQtCsLN1udH x5kdhEFzggIH/nAMDtzSkA4AIBnQuqeayyFk3me8Av3H/IwiYDNPgWjcBabakBxMrHJP VJ0fyV2ZLW3oOBf9exbv4CaaPPXX6z7Uor+IgKkkdoCSbign00xwxmk8i2cfkeYUkCzn 81JUZK1wQMDaFQWrnol1PY8huFUt4zdkrv60xCiDydsY2FSRM0OGZ1vCk8uF6kuUrFlq 0pJA== X-Received: by 10.194.93.40 with SMTP id cr8mr6802149wjb.16.1355858891618; Tue, 18 Dec 2012 11:28:11 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id i6sm17169739wix.5.2012.12.18.11.28.10 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Dec 2012 11:28:10 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v5 1/4] emacs: show: modify insert-part-header to save the button text Date: Tue, 18 Dec 2012 19:27:57 +0000 Message-Id: <1355858880-16329-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1355858880-16329-1-git-send-email-markwalters1009@gmail.com> References: <1355858880-16329-1-git-send-email-markwalters1009@gmail.com> 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, 18 Dec 2012 19:28:20 -0000 This just make notmuch-show-insert-part-header save the basic button text for parts as an attribute. This makes it simpler for the button action (added in a later patch) to reword the label as appropriate (eg append "(not shown)" or not as appropriate). --- emacs/notmuch-show.el | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 4bdd5af..5248fba 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -483,17 +483,17 @@ message at DEPTH in the current thread." (fset 'notmuch-show-part-button-map notmuch-show-part-button-map) (defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment) - (let ((button)) + (let ((button) + (base-label (concat (when name (concat name ": ")) + declared-type + (unless (string-equal declared-type content-type) + (concat " (as " content-type ")")) + comment))) + (setq button (insert-button - (concat "[ " - (if name (concat name ": ") "") - declared-type - (if (not (string-equal declared-type content-type)) - (concat " (as " content-type ")") - "") - (or comment "") - " ]") + (concat "[ " base-label " ]") + :base-label base-label :type 'notmuch-show-part-button-type :notmuch-part nth :notmuch-filename name -- 1.7.9.1