[PATCH 1/3] emacs: show: modify insert-part-header to save the button text
authorMark Walters <markwalters1009@gmail.com>
Tue, 4 Dec 2012 23:27:40 +0000 (23:27 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:29 +0000 (09:51 -0800)
6e/6ac7b6146e127a4ac7c65911a456ca50463e71 [new file with mode: 0644]

diff --git a/6e/6ac7b6146e127a4ac7c65911a456ca50463e71 b/6e/6ac7b6146e127a4ac7c65911a456ca50463e71
new file mode 100644 (file)
index 0000000..704d194
--- /dev/null
@@ -0,0 +1,106 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 613BB431FC0\r
+       for <notmuch@notmuchmail.org>; Tue,  4 Dec 2012 15:27:58 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id arDjycefA+cX for <notmuch@notmuchmail.org>;\r
+       Tue,  4 Dec 2012 15:27:56 -0800 (PST)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+       [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 25114431FD7\r
+       for <notmuch@notmuchmail.org>; Tue,  4 Dec 2012 15:27:51 -0800 (PST)\r
+Received: by mail-wi0-f181.google.com with SMTP id hm9so941359wib.2\r
+       for <notmuch@notmuchmail.org>; Tue, 04 Dec 2012 15:27:50 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=iuitXGF53UPRpadss2ip747DwPd5aymWKHsTCynl3AQ=;\r
+       b=hipOzdO/QpoRn4IhGF0mAueVqQ1T2uFCQ1iCaWsNP0WIQJ6zkbg9ASZnoi5QqZv8hZ\r
+       OHxh9+WlOszEVTQK/n/EUmUYXQoRjwyMqqnZy2c+/sDp3uUo659sn5xP+vxoEJG23KfZ\r
+       OXG9dDZntMVuJc560L+4S7/ffSTvWv5Bu2zUraKuV8wXLii60AjT5HVXEbSq2xKNWPLb\r
+       SUxBn6c/vyGYnA9D0/gmoX3yzJp2GcPJ6bPYRrkswpnqpLOncMDW3TMQThQGQA2uAR4p\r
+       8vjVDJV6kh8GvzlX0+dHb8vTF2M1SlA5R16ctGpxbiHVLsorbhLwioENK+snjKU/Rz3/\r
+       POPQ==\r
+Received: by 10.180.14.162 with SMTP id q2mr14185wic.21.1354663668744;\r
+       Tue, 04 Dec 2012 15:27:48 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id en20sm4002575wid.4.2012.12.04.15.27.47\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 04 Dec 2012 15:27:47 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/3] emacs: show: modify insert-part-header to save the button\r
+       text\r
+Date: Tue,  4 Dec 2012 23:27:40 +0000\r
+Message-Id: <1354663662-20524-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1354663662-20524-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1354663662-20524-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 04 Dec 2012 23:27:58 -0000\r
+\r
+This just make notmuch-show-insert-part-header save the basic button\r
+text for parts as an attribute. This makes it simpler for the button\r
+action (added in a later patch) to reword the label as appropriate (eg\r
+append "(not shown)" or not as appropriate).\r
+---\r
+ emacs/notmuch-show.el |   19 ++++++++++---------\r
+ 1 files changed, 10 insertions(+), 9 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index d7fa10e..f8ce037 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -483,17 +483,18 @@ message at DEPTH in the current thread."\r
+ (fset 'notmuch-show-part-button-map notmuch-show-part-button-map)\r
\r
+ (defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)\r
+-  (let ((button))\r
++  (let ((button)\r
++      (base-label (concat (if name (concat name ": ") "")\r
++                          declared-type\r
++                          (if (not (string-equal declared-type content-type))\r
++                              (concat " (as " content-type ")")\r
++                            "")\r
++                          (or comment ""))))\r
++\r
+     (setq button\r
+         (insert-button\r
+-         (concat "[ "\r
+-                 (if name (concat name ": ") "")\r
+-                 declared-type\r
+-                 (if (not (string-equal declared-type content-type))\r
+-                     (concat " (as " content-type ")")\r
+-                   "")\r
+-                 (or comment "")\r
+-                 " ]")\r
++         (concat "[ " base-label " ]")\r
++         :base-label base-label\r
+          :type 'notmuch-show-part-button-type\r
+          :notmuch-part nth\r
+          :notmuch-filename name\r
+-- \r
+1.7.9.1\r
+\r