Re: database error
[notmuch-archives.git] / 56 / c8eff361715db84a832457f3b8ab787eb7e960
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 42F3A431FAF\r
6         for <notmuch@notmuchmail.org>; Sun, 13 Oct 2013 08:28:19 -0700 (PDT)\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 w+1eOzSN2UCo for <notmuch@notmuchmail.org>;\r
16         Sun, 13 Oct 2013 08:28:13 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu\r
18         [18.7.68.37])\r
19         by olra.theworths.org (Postfix) with ESMTP id 27562431FAE\r
20         for <notmuch@notmuchmail.org>; Sun, 13 Oct 2013 08:28:13 -0700 (PDT)\r
21 X-AuditID: 12074425-b7f1c8e0000009c7-d7-525abc0b03b3\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 4E.F2.02503.B0CBA525; Sun, 13 Oct 2013 11:28:11 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id r9DFSAkF030346; \r
27         Sun, 13 Oct 2013 11:28:11 -0400\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.8/8.12.4) with ESMTP id r9DFS8VL006714\r
32         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
33         Sun, 13 Oct 2013 11:28:09 -0400\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 1VVNaR-0001Ns-9s; Sun, 13 Oct 2013 11:28:07 -0400\r
37 Date: Sun, 13 Oct 2013 11:28:06 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH v2] emacs: show: use interactive instead of\r
41         current-prefix-arg\r
42 Message-ID: <20131013152806.GF10539@mit.edu>\r
43 References: <1381649952-23122-1-git-send-email-markwalters1009@gmail.com>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 In-Reply-To: <1381649952-23122-1-git-send-email-markwalters1009@gmail.com>\r
48 User-Agent: Mutt/1.5.21 (2010-09-15)\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IR4hRV1uXeExVk8PmUvsXquTwW12/OZHZg\r
51         8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Mq7NvcZYcFO1YuGBSewNjHPluhg5OSQETCRO\r
52         X1nDCGGLSVy4t56ti5GLQ0hgH6PE5zlzGSGcjYwSS/8/ZIZwTjNJbNy1ixXCWcIo8XbtCTaQ\r
53         fhYBVYnHMxaAzWIT0JDYtn85mC0ioCNx+9ACdhCbWUBa4tvvZiYQW1ggRKJ/4mkwmxeo5sXC\r
54         LWC2kICnxPPD05gh4oISJ2c+YYHo1ZK48e8lUA0H2Jzl/zhATE4BL4kZu5VBKkQFVCSmnNzG\r
55         NoFRaBaS5llImmchNC9gZF7FKJuSW6Wbm5iZU5yarFucnJiXl1qka6GXm1mil5pSuokRFNTs\r
56         Lqo7GCccUjrEKMDBqMTDe+B8ZJAQa2JZcWXuIUZJDiYlUV73XVFBQnxJ+SmVGYnFGfFFpTmp\r
57         xYcYJTiYlUR4WTKBcrwpiZVVqUX5MClpDhYlcd5bHPZBQgLpiSWp2ampBalFMFkZDg4lCV6O\r
58         3UCNgkWp6akVaZk5JQhpJg5OkOE8QMM1QGp4iwsSc4sz0yHypxgVpcR51UASAiCJjNI8uF5Y\r
59         0nnFKA70ijCvIkgVDzBhwXW/AhrMBDT459sIkMEliQgpqQZGU2en0xcmu0/YzN+02UDBfu/s\r
60         qJwH7+uOTJ4V/Fv709L47TrTE1+LtnuETH760fjH67d3VJbsqRXZ72Vp3Fyy/Bjb+RX/9ZI/\r
61         R3EtnLhpme21C05ep7RVrMLeSebs/lle72DSpLA1Yq3HgT4m9xe/1t8oOqf1V13Q6KP0UR+N\r
62         LdXB3ZdvT3kUpsRSnJFoqMVcVJwIAFQojB0VAwAA\r
63 Cc: notmuch@notmuchmail.org\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.13\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68         <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Sun, 13 Oct 2013 15:28:19 -0000\r
77 \r
78 LGTM.\r
79 \r
80 Quoth Mark Walters on Oct 13 at  8:39 am:\r
81 > Currently notmuch-show looks at the prefix-arg directly via\r
82 > current-prefix-arg. This changes it to use the interactive\r
83 > specification.\r
84\r
85 > One test (for elide-toggle functionality) set the prefix arg\r
86 > directly. Update this test to set the new argument directly.\r
87 > ---\r
88\r
89 > This is version 2 of the patches at\r
90 > id:1381348886-5673-1-git-send-email-markwalters1009@gmail.com The\r
91 > changes are in fixes in response to Austin's review\r
92 > id:20131013033157.GE10539@mit.edu and his comments on irc.\r
93\r
94 > Specifically, this updates the doc string for elide-toggle in\r
95 > notmuch-show and folds the test fix in (so the tests should always\r
96 > pass)\r
97\r
98 > I can also confirm that C-u RET on an id:-button link does work as\r
99 > expected (and as currently): opening the appropriate message with\r
100 > inverted elide behaviour.\r
101\r
102 > Best wishes \r
103\r
104 > Mark\r
105\r
106\r
107\r
108 >  emacs/notmuch-show.el |   12 +++++++-----\r
109 >  emacs/notmuch.el      |    5 +++--\r
110 >  test/emacs-show       |    3 +--\r
111 >  3 files changed, 11 insertions(+), 9 deletions(-)\r
112\r
113 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
114 > index 5d7e24b..3189dda 100644\r
115 > --- a/emacs/notmuch-show.el\r
116 > +++ b/emacs/notmuch-show.el\r
117 > @@ -1080,15 +1080,17 @@ buttons for a corresponding notmuch search."\r
118 >       (make-text-button (first link) (second link)\r
119 >                         :type 'notmuch-button-type\r
120 >                         'action `(lambda (arg)\r
121 > -                                  (notmuch-show ,(third link)))\r
122 > +                                  (notmuch-show ,(third link) current-prefix-arg))\r
123 >                         'follow-link t\r
124 >                         'help-echo "Mouse-1, RET: search for this message"\r
125 >                         'face goto-address-mail-face)))))\r
126 >  \r
127 >  ;;;###autoload\r
128 > -(defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name)\r
129 > +(defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-context buffer-name)\r
130 >    "Run \"notmuch show\" with the given thread ID and display results.\r
131 >  \r
132 > +ELIDE-TOGGLE, if non-nil, inverts the default elide behavior.\r
133 > +\r
134 >  The optional PARENT-BUFFER is the notmuch-search buffer from\r
135 >  which this notmuch-show command was executed, (so that the\r
136 >  next thread from that buffer can be show when done with this\r
137 > @@ -1102,7 +1104,7 @@ The optional BUFFER-NAME provides the name of the buffer in\r
138 >  which the message thread is shown. If it is nil (which occurs\r
139 >  when the command is called interactively) the argument to the\r
140 >  function is used."\r
141 > -  (interactive "sNotmuch show: ")\r
142 > +  (interactive "sNotmuch show: \nP")\r
143 >    (let ((buffer-name (generate-new-buffer-name\r
144 >                     (or buffer-name\r
145 >                         (concat "*notmuch-" thread-id "*")))))\r
146 > @@ -1112,9 +1114,9 @@ function is used."\r
147 >      (setq notmuch-show-process-crypto notmuch-crypto-process-mime)\r
148 >      ;; Set the default value for\r
149 >      ;; `notmuch-show-elide-non-matching-messages' in this buffer. If\r
150 > -    ;; there is a prefix argument, invert the default.\r
151 > +    ;; elide-toggle is set, invert the default.\r
152 >      (setq notmuch-show-elide-non-matching-messages notmuch-show-only-matching-messages)\r
153 > -    (if current-prefix-arg\r
154 > +    (if elide-toggle\r
155 >       (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages)))\r
156 >  \r
157 >      (setq notmuch-show-thread-id thread-id\r
158 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
159 > index 0ff248b..7124d0a 100644\r
160 > --- a/emacs/notmuch.el\r
161 > +++ b/emacs/notmuch.el\r
162 > @@ -486,13 +486,14 @@ If BARE is set then do not prefix with \"thread:\""\r
163 >    "Return a list of authors for the current region"\r
164 >    (notmuch-search-properties-in-region :subject beg end))\r
165 >  \r
166 > -(defun notmuch-search-show-thread ()\r
167 > +(defun notmuch-search-show-thread (&optional elide-toggle)\r
168 >    "Display the currently selected thread."\r
169 > -  (interactive)\r
170 > +  (interactive "P")\r
171 >    (let ((thread-id (notmuch-search-find-thread-id))\r
172 >       (subject (notmuch-search-find-subject)))\r
173 >      (if (> (length thread-id) 0)\r
174 >       (notmuch-show thread-id\r
175 > +                   elide-toggle\r
176 >                     (current-buffer)\r
177 >                     notmuch-search-query-string\r
178 >                     ;; Name the buffer based on the subject.\r
179 > diff --git a/test/emacs-show b/test/emacs-show\r
180 > index ae70053..fb23db4 100755\r
181 > --- a/test/emacs-show\r
182 > +++ b/test/emacs-show\r
183 > @@ -91,8 +91,7 @@ test_begin_subtest "notmuch-show: elide non-matching messages (w/ prefix arg to\r
184 >  test_emacs '(let ((notmuch-show-only-matching-messages nil))\r
185 >       (notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")\r
186 >       (notmuch-test-wait)\r
187 > -     (let ((current-prefix-arg t))\r
188 > -       (notmuch-search-show-thread))\r
189 > +     (notmuch-search-show-thread t)\r
190 >       (notmuch-test-wait)\r
191 >       (test-visible-output))'\r
192 >  test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-elide-non-matching-messages-on\r