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 69C3D431FB6
\r
6 for <notmuch@notmuchmail.org>; Fri, 27 Jan 2012 21:10:45 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 yb5NoeL-3oo6 for <notmuch@notmuchmail.org>;
\r
16 Fri, 27 Jan 2012 21:10:44 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id BE036431FAE
\r
20 for <notmuch@notmuchmail.org>; Fri, 27 Jan 2012 21:10:44 -0800 (PST)
\r
21 X-AuditID: 12074423-b7f9c6d0000008c3-13-4f238353ad1d
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id C5.1B.02243.353832F4; Sat, 28 Jan 2012 00:10:43 -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 q0S5AgIX029389;
\r
27 Sat, 28 Jan 2012 00:10:43 -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 q0S5AfbL007759
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Sat, 28 Jan 2012 00:10:42 -0500 (EST)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1Rr0Y2-000502-PU; Sat, 28 Jan 2012 00:09:58 -0500
\r
37 Date: Sat, 28 Jan 2012 00:09:58 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: David Edmondson <dme@dme.org>
\r
40 Subject: Re: [PATCH 1/3] emacs: Stop the `truncate-string-to-width' madness.
\r
41 Message-ID: <20120128050958.GA17991@mit.edu>
\r
42 References: <1327496913-4946-1-git-send-email-dme@dme.org>
\r
43 <1327499314-7887-1-git-send-email-dme@dme.org>
\r
44 <1327499314-7887-2-git-send-email-dme@dme.org>
\r
46 Content-Type: text/plain; charset=us-ascii
\r
47 Content-Disposition: inline
\r
48 In-Reply-To: <1327499314-7887-2-git-send-email-dme@dme.org>
\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
50 X-Brightmail-Tracker:
\r
51 H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IR4hTV1g1uVvY3WNQsb7HvzhYmi+s3ZzI7
\r
52 MHnsev6XyePZqlvMAUxRXDYpqTmZZalF+nYJXBn3jr9kLJjKW9HauIalgfEPZxcjJ4eEgIlE
\r
53 84vdjBC2mMSFe+vZuhi5OIQE9jFKPN44iwnC2cAo0dW4GSpzkkni18dWVghnCaPE5vvT2bsY
\r
54 OThYBFQljj6zBhnFJqAhsW3/crCxIgKKEv+/rWAHsZkFpCW+/W5mArGFBXwk3p5cwAJi8wro
\r
55 SEzsP8sCMXMOo8TbP0uYIBKCEidnPmGBaNaSuPHvJRPILpBBy/9xgIQ5Bawl5nScAZsvKqAi
\r
56 MeXkNrYJjEKzkHTPQtI9C6F7ASPzKkbZlNwq3dzEzJzi1GTd4uTEvLzUIl0zvdzMEr3UlNJN
\r
57 jKDAZndR3sH456DSIUYBDkYlHt4Lr5T8hVgTy4orcw8xSnIwKYnyZjYo+wvxJeWnVGYkFmfE
\r
58 F5XmpBYfYpTgYFYS4b3jpegvxJuSWFmVWpQPk5LmYFES59XQeucnJJCeWJKanZpakFoEk5Xh
\r
59 4FCS4J3SBDRUsCg1PbUiLTOnBCHNxMEJMpwHaPgckBre4oLE3OLMdIj8KUZFKXHeXSAJAZBE
\r
60 RmkeXC8s8bxiFAd6RZh3EUgVDzBpwXW/AhrMBDQ44irI1cUliQgpqQZGt/D2mCts6dz7Vk36
\r
61 8GL+9cWvwrkTI/taVyb+dPt6hePs3Uw11cDT9T/OJatXclovY/f7ayex1+rf85KNUfaJczwb
\r
62 PypFZXb9+beHWaWh6LKPyuXP7NPzKyMEneSY9zEI20zeteNsns1/Xr2Hk/fl31BTZzS+eLwr
\r
63 pS236VOSU+2tuvuXrooqsRRnJBpqMRcVJwIAP2VizhcDAAA=
\r
64 Cc: notmuch@notmuchmail.org
\r
65 X-BeenThere: notmuch@notmuchmail.org
\r
66 X-Mailman-Version: 2.1.13
\r
68 List-Id: "Use and development of the notmuch mail system."
\r
69 <notmuch.notmuchmail.org>
\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
73 List-Post: <mailto:notmuch@notmuchmail.org>
\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
76 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
77 X-List-Received-Date: Sat, 28 Jan 2012 05:10:45 -0000
\r
79 Quoth David Edmondson on Jan 25 at 1:48 pm:
\r
80 > There's no need to call `truncate-string-to-width' twice in this code
\r
83 LGTM if what I point out below is okay. Technically this changes the
\r
84 behavior of this code, but what it did before was obviously wrong (if
\r
85 you do roll a new version, I'd mention this in the commit message; but
\r
86 no need to do that just for this).
\r
89 > emacs/notmuch.el | 14 ++++++--------
\r
90 > 1 files changed, 6 insertions(+), 8 deletions(-)
\r
92 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
93 > index 3ec0816..3f6b977 100644
\r
94 > --- a/emacs/notmuch.el
\r
95 > +++ b/emacs/notmuch.el
\r
96 > @@ -441,18 +441,16 @@ Complete list of currently available key bindings:
\r
98 > (let ((thread-id (notmuch-search-find-thread-id))
\r
99 > (subject (notmuch-search-find-subject)))
\r
101 > + (if (string-match "^[ \t]*$" subject)
\r
102 > + (setq subject "[No Subject]"))
\r
105 Is subject necessarily a string at this point? Previously this only
\r
106 ran if the code determined there was a thread at point.
\r
108 > (if (> (length thread-id) 0)
\r
109 > (notmuch-show thread-id
\r
111 > notmuch-search-query-string
\r
112 > - ;; name the buffer based on notmuch-search-find-subject
\r
113 > - (if (string-match "^[ \t]*$" subject)
\r
115 > - (truncate-string-to-width
\r
117 > - (truncate-string-to-width subject 32 nil nil t)
\r
120 > + ;; Name the buffer based on the subject.
\r
121 > + (concat "*" (truncate-string-to-width subject 30 nil nil t) "*")
\r
123 > (message "End of search results."))))
\r