Re: [PATCH 1/2] test: add emacs_fcc_message that does not use smtp-dummy
[notmuch-archives.git] / 4c / 6b9f688d2505a69e626d5777f15539f694c161
1 Return-Path: <alex.boterolowry@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 194E8431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 00:26:36 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id kqo8Kvv93fUt for <notmuch@notmuchmail.org>;\r
11         Fri, 20 Nov 2009 00:26:35 -0800 (PST)\r
12 Received: from mail-gx0-f221.google.com (mail-gx0-f221.google.com\r
13         [209.85.217.221])\r
14         by olra.theworths.org (Postfix) with ESMTP id 08BE0431FAE\r
15         for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 00:26:34 -0800 (PST)\r
16 Received: by gxk21 with SMTP id 21so2777245gxk.10\r
17         for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 00:26:34 -0800 (PST)\r
18 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
19         h=domainkey-signature:received:received:received:from:to:subject:date\r
20         :message-id:mime-version:content-type;\r
21         bh=iHTsHuix2LBK8/vR0wCnp53HdBz5w3m9zkRqaLQlnhc=;\r
22         b=LlthhjX8MWk9Qa+J+FrL67iUED+wp7/OTF7vyh/FQjDrZ3rs1beu1Z5iKbF6oSG94I\r
23         6VHYSiVc6ydhAbL0iNjFvrigWKYnFkaRI2fHDbGJH6vClR+AMtVXc8Z0fNCi+BPSxaRm\r
24         kDn98mEFB3tAmxJsw6U97eEgGBV6KLXZA/05o=\r
25 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
26         h=from:to:subject:date:message-id:mime-version:content-type;\r
27         b=JOPk3uNbWB49ldjee15FlKQVVLVTti5rwSzdSveL0rzN/BNokX7zaXcW5oKp0+ZAVy\r
28         4+abbImyVf6g9kE1dC4UF8+uOnivYNyoMEJg/YIohTMiOJJGztQ94/91Y/5bwhbMRQZt\r
29         X8Pu9glA3xwF+g+7W/7lchEl08DJoseay/Qdc=\r
30 Received: by 10.150.19.5 with SMTP id 5mr2098693ybs.103.1258705594592;\r
31         Fri, 20 Nov 2009 00:26:34 -0800 (PST)\r
32 Received: from fortitudo (70-36-144-85.dsl.dynamic.sonic.net [70.36.144.85])\r
33         by mx.google.com with ESMTPS id 14sm695028gxk.6.2009.11.20.00.26.32\r
34         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
35         Fri, 20 Nov 2009 00:26:33 -0800 (PST)\r
36 Received: from alexbl (uid 1001) (envelope-from\r
37         alexbl@fortitudo.i-did-not-set--mail-host-address--so-tickle-me)\r
38         id 7053 by fortitudo (DragonFly Mail Agent)\r
39         Fri, 20 Nov 2009 00:26:33 -0800\r
40 From: Alexander Botero-Lowry <alex.boterolowry@gmail.com>\r
41 To: notmuch@notmuchmail.org\r
42 Date: Fri, 20 Nov 2009 00:26:33 -0800\r
43 Message-ID:\r
44  <86ws1lioue.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me>\r
45 MIME-Version: 1.0\r
46 Content-Type: text/plain; charset=us-ascii\r
47 Subject: [notmuch] lots of emacs mode enhancements\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.12\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Fri, 20 Nov 2009 08:26:36 -0000\r
61 \r
62 I've just been diving into the elisp, and have added a bunch of useful\r
63 features.\r
64 \r
65 1) buttonized citation and signature expanders and made them locally\r
66 collapsable instead of globally (this could take some cleanup to remove\r
67 the global key-map binding or make it work again)\r
68 2) fixed an annoying warning about cons not being a face name\r
69 3) made header names bold to make it easier to distingush them from\r
70 their value\r
71 \r
72 My next target is to carry the buttonization through to threads and\r
73 headers, and then I'm going to look into doing better mime-handling in\r
74 general.\r
75 \r
76 also, RFP includes a -p argument that gives a patch :)\r
77 \r
78 alex\r
79 \r
80 ----\r
81 The following changes since commit 9b560fb3eb87b2a4f9d092bc1b124ccb6d11c975:\r
82   Alexander Botero-Lowry (1):\r
83         Checkin some command-only tcsh completions\r
84 \r
85 are available in the git repository at:\r
86 \r
87   git://alexbl.net/notmuch.git master\r
88 \r
89 Alexander Botero-Lowry (5):\r
90       Buttonize citation expander.\r
91       buttonize signatures as well\r
92       fix the message about cons not being a valid face attribute\r
93       Make expanding/collapsing signatures and citations local to them\r
94       make header names bold in show-mode\r
95 \r
96  notmuch.el |   72 +++++++++++++++++++++++++++++++++++++++++++++++------------\r
97  1 files changed, 57 insertions(+), 15 deletions(-)\r
98 \r
99 diff --git a/notmuch.el b/notmuch.el\r
100 index 1fc54c3..bb69aa3 100644\r
101 --- a/notmuch.el\r
102 +++ b/notmuch.el\r
103 @@ -440,6 +440,14 @@ which this thread was originally shown."\r
104         (if last\r
105             (notmuch-show-archive-thread))))))\r
106  \r
107 +(defun notmuch-toggle-invisible-action (cite-button)\r
108 +  (let ((invis-spec (button-get button 'invisibility-spec)))\r
109 +        (if (invisible-p invis-spec)\r
110 +            (remove-from-invisibility-spec invis-spec)\r
111 +          (add-to-invisibility-spec invis-spec)\r
112 +          ))\r
113 +  (goto-char (button-end cite-button)))\r
114 +\r
115  (defun notmuch-show-markup-citations-region (beg end depth)\r
116    (goto-char beg)\r
117    (beginning-of-line)\r
118 @@ -451,25 +459,51 @@ which this thread was originally shown."\r
119           (progn\r
120             (while (looking-at citation)\r
121               (forward-line))\r
122 -           (let ((overlay (make-overlay beg-sub (point))))\r
123 -             (overlay-put overlay 'invisible 'notmuch-show-citation)\r
124 -             (overlay-put overlay 'before-string\r
125 -                          (concat indent\r
126 -                                  "[" (number-to-string (count-lines beg-sub (point)))\r
127 -                                  "-line citation. Press 'c' to show.]\n")))))\r
128 +           (let ((overlay (make-overlay beg-sub (point)))\r
129 +                  (invis-spec (make-symbol "notmuch-citation-region")))\r
130 +              (add-to-invisibility-spec invis-spec)\r
131 +             (overlay-put overlay 'invisible invis-spec)\r
132 +              (let (\r
133 +                    (p (point))\r
134 +                    (cite-button-text\r
135 +                     (concat "["  (number-to-string (count-lines beg-sub (point)))\r
136 +                             "-line citation.]"))\r
137 +                    )\r
138 +                (goto-char (- beg-sub 1))\r
139 +                (insert (concat "\n" indent))\r
140 +                (let ((cite-button (insert-button cite-button-text)))\r
141 +                  (button-put cite-button 'invisibility-spec invis-spec)\r
142 +                  (button-put cite-button 'action 'notmuch-toggle-invisible-action)\r
143 +                  (button-put cite-button 'help-echo\r
144 +                              "mouse-2, RET: Show citation")\r
145 +\r
146 +                  )\r
147 +                (insert "\n")\r
148 +                (goto-char (+ (length cite-button-text) p))\r
149 +              ))))\r
150        (move-to-column depth)\r
151        (if (looking-at notmuch-show-signature-regexp)\r
152           (let ((sig-lines (- (count-lines beg-sub end) 1)))\r
153             (if (<= sig-lines notmuch-show-signature-lines-max)\r
154                 (progn\r
155 -                 (overlay-put (make-overlay beg-sub end)\r
156 -                              'invisible 'notmuch-show-signature)\r
157 -                 (overlay-put (make-overlay beg (- beg-sub 1))\r
158 -                              'after-string\r
159 -                              (concat "\n" indent\r
160 -                                      "[" (number-to-string sig-lines)\r
161 -                                      "-line signature. Press 's' to show.]"))\r
162 -                 (goto-char end)))))\r
163 +                  (let ((invis-spec (make-symbol "notmuch-signature-region")))\r
164 +                    (add-to-invisibility-spec invis-spec)\r
165 +                    (overlay-put (make-overlay beg-sub end)\r
166 +                                 'invisible invis-spec)\r
167 +                  \r
168 +                    (goto-char (- beg-sub 1))\r
169 +                    (insert (concat "\n" indent))\r
170 +                    (let ((sig-button (insert-button \r
171 +                                       (concat "[" (number-to-string sig-lines)\r
172 +                                         "-line signature.]"))))\r
173 +                      (button-put sig-button 'invisibility-spec invis-spec)\r
174 +                      (button-put sig-button 'action\r
175 +                                  'notmuch-toggle-invisible-action)\r
176 +                      (button-put sig-button 'help-echo\r
177 +                                  "mouse-2, RET: Show signature")\r
178 +                      )\r
179 +                    (insert "\n")\r
180 +                    (goto-char end))))))\r
181        (forward-line))))\r
182  \r
183  (defun notmuch-show-markup-part (beg end depth)\r
184 @@ -516,12 +550,20 @@ which this thread was originally shown."\r
185    (let ((beg (point-marker)))\r
186      (end-of-line)\r
187      ; Inverse video for subject\r
188 -    (overlay-put (make-overlay beg (point)) 'face '((cons :inverse-video t)))\r
189 +    (overlay-put (make-overlay beg (point)) 'face '(:inverse-video t))\r
190      (forward-line 2)\r
191      (let ((beg-hidden (point-marker)))\r
192        (re-search-forward notmuch-show-header-end-regexp)\r
193        (beginning-of-line)\r
194        (let ((end (point-marker)))\r
195 +        (goto-char beg)\r
196 +        (forward-line)\r
197 +        (while (looking-at "[A-Za-z][-A-Za-z0-9]*:")\r
198 +          (beginning-of-line)\r
199 +          (overlay-put (make-overlay (point) (re-search-forward ":"))\r
200 +                       'face 'bold)\r
201 +          (forward-line)\r
202 +          )\r
203         (indent-rigidly beg end depth)\r
204         (overlay-put (make-overlay beg-hidden end)\r
205                      'invisible 'notmuch-show-header)\r