Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / fc / 90914a77528f747f647b07f706bb02be7a6363
1 Return-Path: <markwalters1009@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 2634B431FB6\r
6         for <notmuch@notmuchmail.org>; Mon, 17 Dec 2012 13:55:02 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id h6eBOrywJR2K for <notmuch@notmuchmail.org>;\r
18         Mon, 17 Dec 2012 13:55:01 -0800 (PST)\r
19 Received: from mail-we0-f171.google.com (mail-we0-f171.google.com\r
20         [74.125.82.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 898A4431FAF\r
23         for <notmuch@notmuchmail.org>; Mon, 17 Dec 2012 13:55:01 -0800 (PST)\r
24 Received: by mail-we0-f171.google.com with SMTP id u3so3058548wey.16\r
25         for <notmuch@notmuchmail.org>; Mon, 17 Dec 2012 13:55:00 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
28         :references; bh=3q4TkPu39bLZn8dZYlVvn8ffpqefjajpAc0vREhNslc=;\r
29         b=LO0Ux4zGmF+FcsxerIXfhzjT25/ofwlCPmkcQYhNC60jmaeM3ZcLHE/zvirKgw4lHE\r
30         CeVicrPG2fA6beCSDKzcB4/JJRLFrM5EN2bTHHVtzm6uhF4ZfGj2EzN8iYVpJLw2AUEs\r
31         3XVYyoOMmERDSTlzRcrAHql5FVfZFLyegvLgfSGJgNCc7ix9jZm4MZogmyrvf3rxyG1N\r
32         lT6PGmUr+7ed9WkTh3VtxWbJXuZoPOrkm46tpEyZu+HY/TtiyrZ8VG7dFsKdnKaYVi7C\r
33         4UTLMMrKho8vyARaw+VZnV2d34BzYH+qM5utCJ86HhhM62jM695Xkw563qQLv97v7DN8\r
34         YKLQ==\r
35 X-Received: by 10.180.92.74 with SMTP id ck10mr188021wib.9.1355781300413;\r
36         Mon, 17 Dec 2012 13:55:00 -0800 (PST)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPS id s10sm14589242wiw.4.2012.12.17.13.54.59\r
39         (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Mon, 17 Dec 2012 13:54:59 -0800 (PST)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH v4 1/5] emacs: show: modify insert-part-header to save the\r
44         button text\r
45 Date: Mon, 17 Dec 2012 21:54:43 +0000\r
46 Message-Id: <1355781287-6010-2-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1355781287-6010-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1355781287-6010-1-git-send-email-markwalters1009@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Mon, 17 Dec 2012 21:55:02 -0000\r
63 \r
64 This just make notmuch-show-insert-part-header save the basic button\r
65 text for parts as an attribute. This makes it simpler for the button\r
66 action (added in a later patch) to reword the label as appropriate (eg\r
67 append "(not shown)" or not as appropriate).\r
68 ---\r
69  emacs/notmuch-show.el |   18 +++++++++---------\r
70  1 files changed, 9 insertions(+), 9 deletions(-)\r
71 \r
72 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
73 index 7d9f8a9..c39d2fb 100644\r
74 --- a/emacs/notmuch-show.el\r
75 +++ b/emacs/notmuch-show.el\r
76 @@ -483,17 +483,17 @@ message at DEPTH in the current thread."\r
77  (fset 'notmuch-show-part-button-map notmuch-show-part-button-map)\r
78  \r
79  (defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)\r
80 -  (let ((button))\r
81 +  (let ((button)\r
82 +       (base-label (concat (when name (concat name ": "))\r
83 +                           declared-type\r
84 +                           (unless (string-equal declared-type content-type)\r
85 +                             (concat " (as " content-type ")"))\r
86 +                           comment)))\r
87 +\r
88      (setq button\r
89           (insert-button\r
90 -          (concat "[ "\r
91 -                  (if name (concat name ": ") "")\r
92 -                  declared-type\r
93 -                  (if (not (string-equal declared-type content-type))\r
94 -                      (concat " (as " content-type ")")\r
95 -                    "")\r
96 -                  (or comment "")\r
97 -                  " ]")\r
98 +          (concat "[ " base-label " ]")\r
99 +          :base-label base-label\r
100            :type 'notmuch-show-part-button-type\r
101            :notmuch-part nth\r
102            :notmuch-filename name\r
103 -- \r
104 1.7.9.1\r
105 \r