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 BCEDB431FD0
\r
6 for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 07:37:04 -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 PNtEa0aeUG0L for <notmuch@notmuchmail.org>;
\r
16 Tue, 10 Jan 2012 07:37:04 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 30814431FB6
\r
20 for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 07:37:04 -0800 (PST)
\r
21 X-AuditID: 1209190e-b7f7c6d0000008c3-4b-4f0c5b1c8800
\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])
\r
23 by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id DD.33.02243.C1B5C0F4; Tue, 10 Jan 2012 10:37:00 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q0AFakNn000848;
\r
27 Tue, 10 Jan 2012 10:36:46 -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 q0AFaggH025292
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Tue, 10 Jan 2012 10:36:45 -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 1Rkdko-0000jH-Td; Tue, 10 Jan 2012 10:36:50 -0500
\r
37 Date: Tue, 10 Jan 2012 10:36:50 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: David Edmondson <dme@dme.org>
\r
40 Subject: Re: [PATCH] emacs: Improve `notmuch-hello' display on ttys.
\r
41 Message-ID: <20120110153650.GM20796@mit.edu>
\r
42 References: <1326190528-3548-1-git-send-email-dme@dme.org>
\r
44 Content-Type: text/plain; charset=us-ascii
\r
45 Content-Disposition: inline
\r
46 In-Reply-To: <1326190528-3548-1-git-send-email-dme@dme.org>
\r
47 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
48 X-Brightmail-Tracker:
\r
49 H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IRYrdT0ZWJ5vE3mDnV1GLfnS1MFtdvzmR2
\r
50 YPLY9fwvk8ezVbeYA5iiuGxSUnMyy1KL9O0SuDLW/9nJVPBLsOL8bpcGxqO8XYycHBICJhKT
\r
51 l85mhbDFJC7cW8/WxcjFISSwj1Gi79VVJghnA6NEa+9CKOckk8Tu99OgypYwSqxrWMIG0s8i
\r
52 oCpxrOk+M4jNJqAhsW3/ckYQW0RAUeL/txXsIDazgLTEt9/NTCC2sICLxKMDJ4B2c3DwCuhI
\r
53 TFgYBBIWErCSOL3rF9hIXgFBiZMzn7BAtGpJ3Pj3kgmkHGTM8n8cIGFOAWuJm0uWg5WLCqhI
\r
54 TDm5jW0Co9AsJN2zkHTPQuhewMi8ilE2JbdKNzcxM6c4NVm3ODkxLy+1SNdYLzezRC81pXQT
\r
55 IyioOSX5djB+Pah0iFGAg1GJh/ekBre/EGtiWXFl7iFGSQ4mJVFe5ygefyG+pPyUyozE4oz4
\r
56 otKc1OJDjBIczEoivKzWQDnelMTKqtSifJiUNAeLkjivmtY7PyGB9MSS1OzU1ILUIpisDAeH
\r
57 kgRvKMhQwaLU9NSKtMycEoQ0EwcnyHAeoOF/I0GGFxck5hZnpkPkTzEqSonzhoM0C4AkMkrz
\r
58 4HphSecVozjQK8K8x0OBqniACQuu+xXQYCagwaKi3CCDSxIRUlINjEkvd7C3N804waPE8+nF
\r
59 otM/M/Mvvl5Q+TV+8//fT26+tTor+/QK545f4kuYkq5dX210puCEp+98pojbLBsXrTli9LHx
\r
60 m8MsWWaT2rspv7VNl3+LOrFC7dzW5SrRZ6SFzyofcVogfve/R17BXCEtgY35Ry7kTNKc/XLq
\r
61 LGsxC/eHK05kNDqeT/dUYinOSDTUYi4qTgQASFR16xUDAAA=
\r
62 Cc: notmuch@notmuchmail.org
\r
63 X-BeenThere: notmuch@notmuchmail.org
\r
64 X-Mailman-Version: 2.1.13
\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: Tue, 10 Jan 2012 15:37:04 -0000
\r
77 LGTM, though would it be easier to put this in the else clause of the
\r
78 if after the setq count?
\r
80 Is it possible for a tag in the last column to be just long enough to
\r
81 make the line still wrap? Somehow my current tag set doesn't trigger
\r
82 this bug, so I can't test this case (and I admit I can't follow
\r
83 notmuch-hello-insert-tags well enough to reason this out).
\r
85 Quoth David Edmondson on Jan 10 at 10:15 am:
\r
86 > Inserting spaces to pad out columns is good, except when the padding
\r
87 > makes the line wider than the window. This looks particularly bad on a
\r
88 > tty where there is no fringe.
\r
90 > Hence, avoid padding the last column on each row.
\r
93 > Thanks to j4ni in #notmuch for spotting this.
\r
95 > emacs/notmuch-hello.el | 20 +++++++++++---------
\r
96 > 1 files changed, 11 insertions(+), 9 deletions(-)
\r
98 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
99 > index 333d4c1..02017ce 100644
\r
100 > --- a/emacs/notmuch-hello.el
\r
101 > +++ b/emacs/notmuch-hello.el
\r
102 > @@ -299,15 +299,17 @@ should be. Returns a cons cell `(tags-per-line width)'."
\r
103 > :notify #'notmuch-hello-widget-search
\r
104 > :notmuch-search-terms query
\r
106 > - ;; Insert enough space to consume the rest of the
\r
107 > - ;; column. Because the button for the name is `(1+
\r
108 > - ;; (length name))' long (due to the trailing space) we
\r
109 > - ;; can just insert `(- widest (length name))' spaces -
\r
110 > - ;; the column separator is included in the button if
\r
111 > - ;; `(equal widest (length name)'.
\r
112 > - (widget-insert (make-string (max 1
\r
113 > - (- widest (length name)))
\r
115 > + (unless (eq (% count tags-per-line) (1- tags-per-line))
\r
116 > + ;; If this is not the last tag on the line, insert
\r
117 > + ;; enough space to consume the rest of the column.
\r
118 > + ;; Because the button for the name is `(1+ (length
\r
119 > + ;; name))' long (due to the trailing space) we can
\r
120 > + ;; just insert `(- widest (length name))' spaces - the
\r
121 > + ;; column separator is included in the button if
\r
122 > + ;; `(equal widest (length name)'.
\r
123 > + (widget-insert (make-string (max 1
\r
124 > + (- widest (length name)))
\r
126 > (setq count (1+ count))
\r
127 > (if (eq (% count tags-per-line) 0)
\r
128 > (widget-insert "\n")))
\r