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 E2C8A429E4E for ; Sat, 15 Dec 2012 00:15:51 -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 Soyd-+YTyNTq for ; Sat, 15 Dec 2012 00:15:50 -0800 (PST) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 6BA1E429E28 for ; Sat, 15 Dec 2012 00:15:46 -0800 (PST) Received: by mail-wg0-f47.google.com with SMTP id dq11so1718343wgb.2 for ; Sat, 15 Dec 2012 00:15:45 -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=0IOzS6XELkjSaszewzWvz2ealvuSP15gnwfe5q2RpFDOV4nQ2mTBSzvUwPTLvgiW52 vjVPcJL0Zw8ktlUWC/4cuQ8S/tq87+s4XG9P3Fr/RTsnfUZLxKNyJLn9anPJljrRgWoN dAvCCyVYHYl9KdmKMmaCABQ+g3KKJxnxZriYzSQq3FAA70Ibe0H66dmlKkF8ldq9rXMR VJemtJwG5Ln0PKFrsfpwL3by/Zzf4fbp0+2O9oHdF+3/WAYBLls9AJfn3OLMZxlsU857 hvMRZUl/aaQ344HbFCqeqM/sEWXoZXqJPGfFulQANeXdgqKVs4hqzWYq4K3+hf9btePg mBjQ== Received: by 10.194.5.74 with SMTP id q10mr7571431wjq.13.1355559344048; Sat, 15 Dec 2012 00:15:44 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id w5sm947169wif.11.2012.12.15.00.15.42 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2012 00:15:43 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v3 1/5] emacs: show: modify insert-part-header to save the button text Date: Sat, 15 Dec 2012 08:15:33 +0000 Message-Id: <1355559338-14313-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1355559338-14313-1-git-send-email-markwalters1009@gmail.com> References: <1355559338-14313-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: Sat, 15 Dec 2012 08:15:53 -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