Re: [PATCH 1/2] Add Google Inc. to AUTHORS as a contributor.
[notmuch-archives.git] / 4b / 8b6934dfccdd8233e1a59ffe899655bce53f30
1 Return-Path: <amdragon@mit.edu>\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 28338431FC2\r
6         for <notmuch@notmuchmail.org>; Fri, 14 Dec 2012 21:45:34 -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 p752ZQtKG4gB for <notmuch@notmuchmail.org>;\r
16         Fri, 14 Dec 2012 21:45:33 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id 7557F431FC0\r
20         for <notmuch@notmuchmail.org>; Fri, 14 Dec 2012 21:45:33 -0800 (PST)\r
21 X-AuditID: 12074422-b7fe46d0000008d2-90-50cc0e7c3051\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
23         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 12.D1.02258.C7E0CC05; Sat, 15 Dec 2012 00:45:32 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id qBF5jWke031896; \r
27         Sat, 15 Dec 2012 00:45:32 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qBF5jU0l013664\r
32         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
33         Sat, 15 Dec 2012 00:45:32 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1TjkZ0-0007By-Oi; Sat, 15 Dec 2012 00:45:30 -0500\r
37 From: Austin Clements <aclements@csail.mit.edu>\r
38 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
39 Subject: Re: [PATCH v2 3/5] emacs: show: add invisibility button action\r
40 In-Reply-To: <1355389924-3718-4-git-send-email-markwalters1009@gmail.com>\r
41 References: <1355389924-3718-1-git-send-email-markwalters1009@gmail.com>\r
42         <1355389924-3718-4-git-send-email-markwalters1009@gmail.com>\r
43 User-Agent: Notmuch/0.14+159~g6895fee (http://notmuchmail.org) Emacs/23.4.1\r
44         (i486-pc-linux-gnu)\r
45 Date: Sat, 15 Dec 2012 00:45:30 -0500\r
46 Message-ID: <876243oolh.fsf@awakening.csail.mit.edu>\r
47 MIME-Version: 1.0\r
48 Content-Type: text/plain; charset=us-ascii\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsUixCmqrVvDdybA4E6XocXquTwW12/OZHZg\r
51         8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Mm7/3sNScEmuYs+ps6wNjP8luhg5OSQETCSW\r
52         bu1ih7DFJC7cW88GYgsJ7GOU+HsqHsLewChx/oFcFyMXkH2RSaLx/1NmCGcJo8TZrUeZQarY\r
53         BPQlVqydxApiiwi4Sjz99hksLizgLvHw2DqgqRwcnAKeEifW+UH0tjJKPOtcxQ4SFxWIl5h9\r
54         zgeknEVAVeL/qwmsIGFeoOPebGMECfMKCEqcnPmEBcRmFtCSuPHvJdMERoFZSFKzkKQWMDKt\r
55         YpRNya3SzU3MzClOTdYtTk7My0st0jXVy80s0UtNKd3ECApFdhelHYw/DyodYhTgYFTi4d0R\r
56         cTpAiDWxrLgy9xCjJAeTkihvH++ZACG+pPyUyozE4oz4otKc1OJDjBIczEoivGJbgMp5UxIr\r
57         q1KL8mFS0hwsSuK811Ju+gsJpCeWpGanphakFsFkZTg4lCR4J4AMFSxKTU+tSMvMKUFIM3Fw\r
58         ggznARreDVLDW1yQmFucmQ6RP8WoKCXOmwOSEABJZJTmwfXCUsUrRnGgV4R500CqeIBpBq77\r
59         FdBgJqDBcZeOgwwuSURISTUweqTf1QwRyVb/6jIv0r98v/EL2/8X73/T3ZZ09dze1uyfkfkZ\r
60         i36uMnswe/nHj8GSjH0ybOc5+09ej7axdNz/9se/+Wd3M1Ze3/BN07vrYur+U6ZTrk9nj5YQ\r
61         5GwqjX/dvvv+pKd3Arm8fvjxVHJN6jw+5TYbD8cDh0hbr7XOAVfvfGe9v2JVnBJLcUaioRZz\r
62         UXEiAMWNQBXwAgAA\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Sat, 15 Dec 2012 05:45:34 -0000\r
76 \r
77 On Thu, 13 Dec 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
78 > This adds a button action to show hidden parts. In this version "t"\r
79 > toggles the visibility of a part. In addition "RET" on a non-shown\r
80 > part shows it.\r
81 >\r
82 > The button is used to hide parts when appropriate (eg text/html in\r
83 > multipart/alternative).\r
84 > ---\r
85 >  emacs/notmuch-show.el |   36 ++++++++++++++++++++++++++++++++++--\r
86 >  1 files changed, 34 insertions(+), 2 deletions(-)\r
87 >\r
88 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
89 > index 3f2f277..202258f 100644\r
90 > --- a/emacs/notmuch-show.el\r
91 > +++ b/emacs/notmuch-show.el\r
92 > @@ -478,6 +478,7 @@ message at DEPTH in the current thread."\r
93 >      (define-key map "v" 'notmuch-show-part-button-view)\r
94 >      (define-key map "o" 'notmuch-show-part-button-interactively-view)\r
95 >      (define-key map "|" 'notmuch-show-part-button-pipe)\r
96 > +    (define-key map "t" 'notmuch-show-toggle-invisible-part-action)\r
97 \r
98 Do we actually need this?  Isn't it redundant with RET in all cases\r
99 where t would be meaningful?\r
100 \r
101 >      map)\r
102 >    "Submap for button commands")\r
103 >  (fset 'notmuch-show-part-button-map notmuch-show-part-button-map)\r
104 > @@ -554,6 +555,28 @@ message at DEPTH in the current thread."\r
105 >      (let ((handle (mm-make-handle (current-buffer) (list content-type))))\r
106 >        (mm-pipe-part handle))))\r
107 >  \r
108 > +;; This is taken from notmuch-wash: maybe it should be unified?\r
109 > +(defun notmuch-show-toggle-invisible-part-action (&optional button)\r
110 \r
111 notmuch-show-toggle-part-invisibility?\r
112 \r
113 > +  (interactive)\r
114 > +  (let* ((button (or button (button-at (point))))\r
115 > +      (overlay (button-get button 'overlay))\r
116 > +      (invis-spec (button-get button 'invisibility-spec))\r
117 > +      (show (invisible-p invis-spec)))\r
118 > +    (when overlay\r
119 > +      (if show\r
120 > +       (remove-from-invisibility-spec invis-spec)\r
121 > +     (add-to-invisibility-spec invis-spec))\r
122 > +      (let* ((new-start (button-start button))\r
123 > +          (button-label (button-get button :base-label))\r
124 > +          (old-point (point))\r
125 > +          (inhibit-read-only t))\r
126 > +     (goto-char new-start)\r
127 > +     (insert "[ " button-label (if show " ]" " (hidden) ]"))\r
128 > +     (let ((old-end (button-end button)))\r
129 > +       (move-overlay button new-start (point))\r
130 > +       (delete-region (point) old-end))\r
131 > +     (goto-char (min old-point (1- (button-end button))))))))\r
132 > +\r
133 >  (defun notmuch-show-multipart/*-to-list (part)\r
134 >    (mapcar (lambda (inner-part) (plist-get inner-part :content-type))\r
135 >         (plist-get part :content)))\r
136 > @@ -863,7 +886,13 @@ message at DEPTH in the current thread."\r
137 >                              (cons invis-spec (overlay-get inner 'invisible)))))\r
138 >  \r
139 >       (button-put button 'invisibility-spec invis-spec)\r
140 > -     (button-put button 'overlay overlay)))))\r
141 > +     (button-put button 'overlay overlay))\r
142 > +\r
143 > +      ;; We toggle the button for hidden parts as that gets the\r
144 > +      ;; button label right.\r
145 > +      (save-excursion\r
146 > +     (when hide\r
147 > +       (notmuch-show-toggle-invisible-part-action button))))))\r
148 >  \r
149 >  (defun notmuch-show-insert-bodypart (msg part depth &optional hide)\r
150 >    "Insert the body part PART at depth DEPTH in the current thread.\r
151 > @@ -1992,7 +2021,10 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')."\r
152 >  \r
153 >  (defun notmuch-show-part-button-default (&optional button)\r
154 >    (interactive)\r
155 > -  (notmuch-show-part-button-internal button notmuch-show-part-button-default-action))\r
156 > +  (let ((button (or button (button-at (point)))))\r
157 > +    (if (button-get button 'invisibility-spec)\r
158 > +     (notmuch-show-toggle-invisible-part-action button)\r
159 > +      (notmuch-show-part-button-internal button notmuch-show-part-button-default-action))))\r
160 >  \r
161 >  (defun notmuch-show-part-button-save (&optional button)\r
162 >    (interactive)\r
163 > -- \r
164 > 1.7.9.1\r
165 >\r
166 > _______________________________________________\r
167 > notmuch mailing list\r
168 > notmuch@notmuchmail.org\r
169 > http://notmuchmail.org/mailman/listinfo/notmuch\r