Re: [PATCH v2 5/5] compact: provide user more information on after-compaction failures
[notmuch-archives.git] / 20 / bf5bf224f463e16ec2e4a25810fe21de51dc22
1 Return-Path: <dme@dme.org>\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 68B5C421198\r
6         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 02:33:12 -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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id DB2LxKdKC19b for <notmuch@notmuchmail.org>;\r
16         Mon, 23 Jan 2012 02:33:11 -0800 (PST)\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
18         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 87FF0429E54\r
21         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 02:33:11 -0800 (PST)\r
22 Received: by wibhi8 with SMTP id hi8so489155wib.26\r
23         for <notmuch@notmuchmail.org>; Mon, 23 Jan 2012 02:33:10 -0800 (PST)\r
24 MIME-Version: 1.0\r
25 Received: by 10.180.92.101 with SMTP id cl5mr12179219wib.21.1327314790449;\r
26         Mon, 23 Jan 2012 02:33:10 -0800 (PST)\r
27 Received: from hotblack-desiato.hh.sledj.net\r
28         (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])\r
29         by mx.google.com with ESMTPS id dr5sm39705841wib.0.2012.01.23.02.33.08\r
30         (version=TLSv1/SSLv3 cipher=OTHER);\r
31         Mon, 23 Jan 2012 02:33:08 -0800 (PST)\r
32 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)\r
33         id AC787A0950; Mon, 23 Jan 2012 10:33:06 +0000 (GMT)\r
34 From: David Edmondson <dme@dme.org>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH 1/3 v2] emacs: Don't return the button from\r
37         `notmuch-show-insert-part-header'.\r
38 Date: Mon, 23 Jan 2012 10:33:02 +0000\r
39 Message-Id: <1327314784-22555-1-git-send-email-dme@dme.org>\r
40 X-Mailer: git-send-email 1.7.8.3\r
41 In-Reply-To: <cun39b66avm.fsf@hotblack-desiato.hh.sledj.net>\r
42 References: <cun39b66avm.fsf@hotblack-desiato.hh.sledj.net>\r
43 X-Gm-Message-State:\r
44  ALoCoQn36l3v5NpW85JkBvovLi6eUNRmM/oE5/mc/NMH2wGGnzuQXC3BXM6d6sI7jfVl3FFACjtZ\r
45 X-BeenThere: notmuch@notmuchmail.org\r
46 X-Mailman-Version: 2.1.13\r
47 Precedence: list\r
48 List-Id: "Use and development of the notmuch mail system."\r
49         <notmuch.notmuchmail.org>\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
53 List-Post: <mailto:notmuch@notmuchmail.org>\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
57 X-List-Received-Date: Mon, 23 Jan 2012 10:33:12 -0000\r
58 \r
59 Instead, allow the caller to specify some parameters for the\r
60 button. Rework `notmuch-show-insert-part-multipart/signed' and\r
61 `notmuch-show-insert-part-multipart/encrypted' accordingly.\r
62 ---\r
63 \r
64 Removed the merge of multipart/signed and multipart/encrypted.\r
65 \r
66  emacs/notmuch-show.el |   84 +++++++++++++++++++++++++-----------------------\r
67  1 files changed, 44 insertions(+), 40 deletions(-)\r
68 \r
69 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
70 index 03c1f6b..9144484 100644\r
71 --- a/emacs/notmuch-show.el\r
72 +++ b/emacs/notmuch-show.el\r
73 @@ -285,24 +285,23 @@ message at DEPTH in the current thread."\r
74    'follow-link t\r
75    'face 'message-mml)\r
76  \r
77 -(defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment)\r
78 -  (let ((button))\r
79 -    (setq button\r
80 -         (insert-button\r
81 -          (concat "[ "\r
82 -                  (if name (concat name ": ") "")\r
83 -                  declared-type\r
84 -                  (if (not (string-equal declared-type content-type))\r
85 -                      (concat " (as " content-type ")")\r
86 -                    "")\r
87 -                  (or comment "")\r
88 -                  " ]")\r
89 -          :type 'notmuch-show-part-button-type\r
90 -          :notmuch-part nth\r
91 -          :notmuch-filename name))\r
92 -    (insert "\n")\r
93 -    ;; return button\r
94 -    button))\r
95 +(defun notmuch-show-insert-part-header (nth content-type declared-type\r
96 +                                           &optional name comment\r
97 +                                           &rest button-parameters)\r
98 +  (apply #'insert-button\r
99 +        (concat "[ "\r
100 +                (if name (concat name ": ") "")\r
101 +                declared-type\r
102 +                (if (not (string-equal declared-type content-type))\r
103 +                    (concat " (as " content-type ")")\r
104 +                  "")\r
105 +                (or comment "")\r
106 +                " ]")\r
107 +        :type 'notmuch-show-part-button-type\r
108 +        :notmuch-part nth\r
109 +        :notmuch-filename name\r
110 +        button-parameters)\r
111 +  (insert "\n"))\r
112  \r
113  ;; Functions handling particular MIME parts.\r
114  \r
115 @@ -460,15 +459,18 @@ current buffer, if possible."\r
116    t)\r
117  \r
118  (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth declared-type)\r
119 -  (let ((button (notmuch-show-insert-part-header nth declared-type content-type nil)))\r
120 -    (button-put button 'face 'notmuch-crypto-part-header)\r
121 -    ;; add signature status button if sigstatus provided\r
122 -    (if (plist-member part :sigstatus)\r
123 -       (let* ((from (notmuch-show-get-header :From msg))\r
124 -              (sigstatus (car (plist-get part :sigstatus))))\r
125 -         (notmuch-crypto-insert-sigstatus-button sigstatus from))\r
126 -      ;; if we're not adding sigstatus, tell the user how they can get it\r
127 -      (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic mime parts.")))\r
128 +  ;; Add signature status button if sigstatus provided.\r
129 +  (if (plist-member part :sigstatus)\r
130 +      (let ((from (notmuch-show-get-header :From msg))\r
131 +           (sigstatus (car (plist-get part :sigstatus))))\r
132 +       (notmuch-show-insert-part-header nth declared-type content-type nil nil \r
133 +                                        'face 'notmuch-crypto-part-header)\r
134 +       (notmuch-crypto-insert-sigstatus-button sigstatus from))\r
135 +\r
136 +    ;; If we're not adding sigstatus, tell the user how to enable it.\r
137 +    (notmuch-show-insert-part-header nth declared-type content-type nil nil \r
138 +                                    'face 'notmuch-crypto-part-header\r
139 +                                    'help-echo "Set notmuch-crypto-process-mime to process cryptographic mime parts."))\r
140  \r
141    (let ((inner-parts (plist-get part :content))\r
142         (start (point)))\r
143 @@ -482,19 +484,21 @@ current buffer, if possible."\r
144    t)\r
145  \r
146  (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth declared-type)\r
147 -  (let ((button (notmuch-show-insert-part-header nth declared-type content-type nil)))\r
148 -    (button-put button 'face 'notmuch-crypto-part-header)\r
149 -    ;; add encryption status button if encstatus specified\r
150 -    (if (plist-member part :encstatus)\r
151 -       (let ((encstatus (car (plist-get part :encstatus))))\r
152 -         (notmuch-crypto-insert-encstatus-button encstatus)\r
153 -         ;; add signature status button if sigstatus specified\r
154 -         (if (plist-member part :sigstatus)\r
155 -             (let* ((from (notmuch-show-get-header :From msg))\r
156 -                    (sigstatus (car (plist-get part :sigstatus))))\r
157 -               (notmuch-crypto-insert-sigstatus-button sigstatus from))))\r
158 -      ;; if we're not adding encstatus, tell the user how they can get it\r
159 -      (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic mime parts.")))\r
160 +  ;; Add encryption status button if encstatus provided.\r
161 +  (if (plist-member part :encstatus)\r
162 +      (let ((encstatus (car (plist-get part :encstatus))))\r
163 +       (notmuch-show-insert-part-header nth declared-type content-type nil nil \r
164 +                                        'face 'notmuch-crypto-part-header)\r
165 +       (notmuch-crypto-insert-encstatus-button encstatus)\r
166 +       ;; add signature status button if sigstatus specified\r
167 +       (if (plist-member part :sigstatus)\r
168 +           (let* ((from (notmuch-show-get-header :From msg))\r
169 +                  (sigstatus (car (plist-get part :sigstatus))))\r
170 +             (notmuch-crypto-insert-sigstatus-button sigstatus from))))\r
171 +    ;; If we're not adding encstatus, tell the user how to enable it.\r
172 +    (notmuch-show-insert-part-header nth declared-type content-type nil nil \r
173 +                                    'face 'notmuch-crypto-part-header\r
174 +                                    'help-echo "Set notmuch-crypto-process-mime to process cryptographic mime parts."))\r
175  \r
176    (let ((inner-parts (plist-get part :content))\r
177         (start (point)))\r
178 -- \r
179 1.7.8.3\r
180 \r