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 886ED431FDB for ; Thu, 13 Dec 2012 01:12:19 -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 5mbc8wcx42X4 for ; Thu, 13 Dec 2012 01:12:18 -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 A73BD431FC2 for ; Thu, 13 Dec 2012 01:12:13 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id hm9so1344991wib.2 for ; Thu, 13 Dec 2012 01:12:12 -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=5vb6CyBisLOmviPNatjbE5QC/29AGGUx0rviqPS9+xI=; b=gw+ghBqG/UHMzh4zk3F+Lvualvcph79+dFPoch7QTtntcP9Bfxgz1Q4/lhLFVDJTDd w0HTTAez2HkfFDlhuMA/OZkGE9xNjRm2nRL7CAtqojRcLHYLl8X+/owaHOAV4KSNbXsu SA5MTckvpV9wInLFi2YPNGOHn2Aj+Qd8TR6ULS6q8/MsYG4VeomtqDgRmFEGnVHMZmTv mck06LMkgxT9WCTdiB9bAApyzcpe4MmD1kKqUetYcWcoRbp32u2dP+dr+PgFVnIjBryI Yre5w440Wpw2nEeRXLaU+yF8RlknaEk+LYzsURt5ZR2ypApRc7V9jf6ew9gzoGxrJu9a ht0g== Received: by 10.180.104.69 with SMTP id gc5mr27484195wib.13.1355389932510; Thu, 13 Dec 2012 01:12:12 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id b1sm1530620wix.11.2012.12.13.01.12.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Dec 2012 01:12:11 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v2 1/5] emacs: show: modify insert-part-header to save the button text Date: Thu, 13 Dec 2012 09:12:00 +0000 Message-Id: <1355389924-3718-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1355389924-3718-1-git-send-email-markwalters1009@gmail.com> References: <1355389924-3718-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: Thu, 13 Dec 2012 09:12: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 d7fa10e..06f7ca5 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