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 613BB431FC0 for ; Tue, 4 Dec 2012 15:27:58 -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 arDjycefA+cX for ; Tue, 4 Dec 2012 15:27:56 -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 25114431FD7 for ; Tue, 4 Dec 2012 15:27:51 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id hm9so941359wib.2 for ; Tue, 04 Dec 2012 15:27:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=iuitXGF53UPRpadss2ip747DwPd5aymWKHsTCynl3AQ=; b=hipOzdO/QpoRn4IhGF0mAueVqQ1T2uFCQ1iCaWsNP0WIQJ6zkbg9ASZnoi5QqZv8hZ OHxh9+WlOszEVTQK/n/EUmUYXQoRjwyMqqnZy2c+/sDp3uUo659sn5xP+vxoEJG23KfZ OXG9dDZntMVuJc560L+4S7/ffSTvWv5Bu2zUraKuV8wXLii60AjT5HVXEbSq2xKNWPLb SUxBn6c/vyGYnA9D0/gmoX3yzJp2GcPJ6bPYRrkswpnqpLOncMDW3TMQThQGQA2uAR4p 8vjVDJV6kh8GvzlX0+dHb8vTF2M1SlA5R16ctGpxbiHVLsorbhLwioENK+snjKU/Rz3/ POPQ== Received: by 10.180.14.162 with SMTP id q2mr14185wic.21.1354663668744; Tue, 04 Dec 2012 15:27:48 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id en20sm4002575wid.4.2012.12.04.15.27.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Dec 2012 15:27:47 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 1/3] emacs: show: modify insert-part-header to save the button text Date: Tue, 4 Dec 2012 23:27:40 +0000 Message-Id: <1354663662-20524-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1354663662-20524-1-git-send-email-markwalters1009@gmail.com> References: <1354663662-20524-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, 04 Dec 2012 23:27:58 -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 | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index d7fa10e..f8ce037 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -483,17 +483,18 @@ 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 (if name (concat name ": ") "") + declared-type + (if (not (string-equal declared-type content-type)) + (concat " (as " content-type ")") + "") + (or 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