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 2634B431FB6 for ; Mon, 17 Dec 2012 13:55:02 -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 h6eBOrywJR2K for ; Mon, 17 Dec 2012 13:55:01 -0800 (PST) Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 898A4431FAF for ; Mon, 17 Dec 2012 13:55:01 -0800 (PST) Received: by mail-we0-f171.google.com with SMTP id u3so3058548wey.16 for ; Mon, 17 Dec 2012 13:55:00 -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=3q4TkPu39bLZn8dZYlVvn8ffpqefjajpAc0vREhNslc=; b=LO0Ux4zGmF+FcsxerIXfhzjT25/ofwlCPmkcQYhNC60jmaeM3ZcLHE/zvirKgw4lHE CeVicrPG2fA6beCSDKzcB4/JJRLFrM5EN2bTHHVtzm6uhF4ZfGj2EzN8iYVpJLw2AUEs 3XVYyoOMmERDSTlzRcrAHql5FVfZFLyegvLgfSGJgNCc7ix9jZm4MZogmyrvf3rxyG1N lT6PGmUr+7ed9WkTh3VtxWbJXuZoPOrkm46tpEyZu+HY/TtiyrZ8VG7dFsKdnKaYVi7C 4UTLMMrKho8vyARaw+VZnV2d34BzYH+qM5utCJ86HhhM62jM695Xkw563qQLv97v7DN8 YKLQ== X-Received: by 10.180.92.74 with SMTP id ck10mr188021wib.9.1355781300413; Mon, 17 Dec 2012 13:55:00 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id s10sm14589242wiw.4.2012.12.17.13.54.59 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Dec 2012 13:54:59 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v4 1/5] emacs: show: modify insert-part-header to save the button text Date: Mon, 17 Dec 2012 21:54:43 +0000 Message-Id: <1355781287-6010-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1355781287-6010-1-git-send-email-markwalters1009@gmail.com> References: <1355781287-6010-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: Mon, 17 Dec 2012 21:55:02 -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 7d9f8a9..c39d2fb 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