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 4031F431E64
\r
6 for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 15:47:49 -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 B1hpSaMdi2zw for <notmuch@notmuchmail.org>;
\r
16 Mon, 30 Jan 2012 15:47:48 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id AF52F431FBC
\r
20 for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 15:47:48 -0800 (PST)
\r
21 X-AuditID: 1209190d-b7fbf6d0000008ba-db-4f272c248ad6
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 1E.4B.02234.42C272F4; Mon, 30 Jan 2012 18:47:48 -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 q0UNllpT012559;
\r
27 Mon, 30 Jan 2012 18:47:48 -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 q0UNlkDB007614
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Mon, 30 Jan 2012 18:47:47 -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 1Rs0w3-0002V6-OE; Mon, 30 Jan 2012 18:46:55 -0500
\r
37 Date: Mon, 30 Jan 2012 18:46:55 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: David Edmondson <dme@dme.org>
\r
40 Subject: Re: [PATCH 1/2 v2] emacs: Stop the `truncate-string-to-width'
\r
42 Message-ID: <20120130234655.GU17991@mit.edu>
\r
43 References: <1327496913-4946-1-git-send-email-dme@dme.org>
\r
44 <1327918561-16245-1-git-send-email-dme@dme.org>
\r
45 <1327918561-16245-2-git-send-email-dme@dme.org>
\r
47 Content-Type: text/plain; charset=us-ascii
\r
48 Content-Disposition: inline
\r
49 In-Reply-To: <1327918561-16245-2-git-send-email-dme@dme.org>
\r
50 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
51 X-Brightmail-Tracker:
\r
52 H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hTV1lXRUfc3WD+X12LfnS1MFtdvzmR2
\r
53 YPLY9fwvk8ezVbeYA5iiuGxSUnMyy1KL9O0SuDI+37rFXnCAt2JWxz7WBsYNXF2MnBwSAiYS
\r
54 a6f8YYGwxSQu3FvP1sXIxSEksI9Ron/+T1YIZwOjxIf2lVDOSSaJLf+3MUE4SxglDv5ZxAbS
\r
55 zyKgKjG19x/YLDYBDYlt+5czgtgiAooS/7+tYAexmQWkJb79bmYCsYUFAiWWXn8P1ssroCOx
\r
56 9NkPsF4hgXmMEtfnWELEBSVOznzCAtGrJXHj30ugXg6wOcv/cYCYnAI2ElvalUAqRAVUJKac
\r
57 3MY2gVFoFpLmWUiaZyE0L2BkXsUom5JbpZubmJlTnJqsW5ycmJeXWqRrpJebWaKXmlK6iREc
\r
58 1pK8OxjfHVQ6xCjAwajEwyvwSc1fiDWxrLgy9xCjJAeTkijvEXV1fyG+pPyUyozE4oz4otKc
\r
59 1OJDjBIczEoivG9WA5XzpiRWVqUW5cOkpDlYlMR5VbXe+QkJpCeWpGanphakFsFkZTg4lCR4
\r
60 j2kDDRUsSk1PrUjLzClBSDNxcIIM5wEavhikhre4IDG3ODMdIn+KUVFKHCIhAJLIKM2D64Wl
\r
61 nVeM4kCvCPNuBaniAaYsuO5XQIOZgAY/Z1AFGVySiJCSamBczXB006Pb6y4p9pzbV75nbYfh
\r
62 icRvEfPe33p++Lx1uI0eZ0D0nUDe5fU6+/asdrn/M/x3bnHjt7mHtCZN+bpu1r3J1safpu5h
\r
63 6OmrElJ72eF8oadqTqdwE98fy8erLRduP3t26YFIxbr1/u8PKN25eMG4b2r5kRJZHY3qloUT
\r
64 BVr/7OPfV1dxQomlOCPRUIu5qDgRAEzGpDkWAwAA
\r
65 Cc: notmuch@notmuchmail.org
\r
66 X-BeenThere: notmuch@notmuchmail.org
\r
67 X-Mailman-Version: 2.1.13
\r
69 List-Id: "Use and development of the notmuch mail system."
\r
70 <notmuch.notmuchmail.org>
\r
71 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
74 List-Post: <mailto:notmuch@notmuchmail.org>
\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
76 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
77 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
78 X-List-Received-Date: Mon, 30 Jan 2012 23:47:49 -0000
\r
80 LGTM. One comment that you can take or leave.
\r
82 Quoth David Edmondson on Jan 30 at 10:16 am:
\r
83 > There's no need to call `truncate-string-to-width' twice in this code
\r
86 > emacs/notmuch.el | 22 ++++++++++------------
\r
87 > 1 files changed, 10 insertions(+), 12 deletions(-)
\r
89 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
90 > index 72f78ed..d4d6904 100644
\r
91 > --- a/emacs/notmuch.el
\r
92 > +++ b/emacs/notmuch.el
\r
93 > @@ -469,18 +469,16 @@ Complete list of currently available key bindings:
\r
94 > (let ((thread-id (notmuch-search-find-thread-id))
\r
95 > (subject (notmuch-search-find-subject)))
\r
96 > (if (> (length thread-id) 0)
\r
97 > - (notmuch-show thread-id
\r
98 > - (current-buffer)
\r
99 > - notmuch-search-query-string
\r
100 > - ;; name the buffer based on notmuch-search-find-subject
\r
101 > - (if (string-match "^[ \t]*$" subject)
\r
103 > - (truncate-string-to-width
\r
105 > - (truncate-string-to-width subject 32 nil nil t)
\r
110 > + (if (string-match "^[ \t]*$" subject)
\r
111 > + (setq subject "[No Subject]"))
\r
113 > + (notmuch-show thread-id
\r
114 > + (current-buffer)
\r
115 > + notmuch-search-query-string
\r
116 > + ;; Name the buffer based on the subject.
\r
117 > + (concat "*" (truncate-string-to-width subject 30 nil nil t) "*")
\r
118 > + crypto-switch))
\r
119 > (message "End of search results."))))
\r
121 Should this instead be an `error'? It that makes sense, it would also
\r
122 simplify the code, since you could
\r
124 (if (= (length thread-id) 0)
\r
125 (error "End of search results."))
\r
126 <current progn body>
\r
129 > (defun notmuch-search-reply-to-thread (&optional prompt-for-sender)
\r