1 Return-Path: <jani@nikula.org>
\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 8FFEC431FD0
\r
6 for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 12:07:34 -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 jGYJkWL4kQ70 for <notmuch@notmuchmail.org>;
\r
16 Tue, 10 Jan 2012 12:07:34 -0800 (PST)
\r
17 Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com
\r
18 [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 CD585431FB6 for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 12:07:33 -0800
\r
22 Received: by eeke51 with SMTP id e51so601006eek.26
\r
23 for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 12:07:32 -0800 (PST)
\r
24 Received: by 10.213.23.11 with SMTP id p11mr586889ebb.75.1326226051102;
\r
25 Tue, 10 Jan 2012 12:07:31 -0800 (PST)
\r
26 Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.
\r
28 by mx.google.com with ESMTPS id 19sm132228483eew.7.2012.01.10.12.07.27
\r
29 (version=SSLv3 cipher=OTHER); Tue, 10 Jan 2012 12:07:28 -0800 (PST)
\r
30 From: Jani Nikula <jani@nikula.org>
\r
31 To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org
\r
32 Subject: Re: [PATCH] emacs: Improve `notmuch-hello' display on ttys.
\r
33 In-Reply-To: <1326190528-3548-1-git-send-email-dme@dme.org>
\r
34 References: <1326190528-3548-1-git-send-email-dme@dme.org>
\r
35 User-Agent: Notmuch/0.10.2+180~g33b8a00 (http://notmuchmail.org) Emacs/23.3.1
\r
37 Date: Tue, 10 Jan 2012 22:07:26 +0200
\r
38 Message-ID: <8762gjs4n5.fsf@nikula.org>
\r
40 Content-Type: text/plain; charset=us-ascii
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Tue, 10 Jan 2012 20:07:34 -0000
\r
55 On Tue, 10 Jan 2012 10:15:28 +0000, David Edmondson <dme@dme.org> wrote:
\r
56 > Inserting spaces to pad out columns is good, except when the padding
\r
57 > makes the line wider than the window. This looks particularly bad on a
\r
58 > tty where there is no fringe.
\r
60 > Hence, avoid padding the last column on each row.
\r
63 > Thanks to j4ni in #notmuch for spotting this.
\r
65 Thanks for fixing this. This patch works for me.
\r
72 > emacs/notmuch-hello.el | 20 +++++++++++---------
\r
73 > 1 files changed, 11 insertions(+), 9 deletions(-)
\r
75 > diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
\r
76 > index 333d4c1..02017ce 100644
\r
77 > --- a/emacs/notmuch-hello.el
\r
78 > +++ b/emacs/notmuch-hello.el
\r
79 > @@ -299,15 +299,17 @@ should be. Returns a cons cell `(tags-per-line width)'."
\r
80 > :notify #'notmuch-hello-widget-search
\r
81 > :notmuch-search-terms query
\r
83 > - ;; Insert enough space to consume the rest of the
\r
84 > - ;; column. Because the button for the name is `(1+
\r
85 > - ;; (length name))' long (due to the trailing space) we
\r
86 > - ;; can just insert `(- widest (length name))' spaces -
\r
87 > - ;; the column separator is included in the button if
\r
88 > - ;; `(equal widest (length name)'.
\r
89 > - (widget-insert (make-string (max 1
\r
90 > - (- widest (length name)))
\r
92 > + (unless (eq (% count tags-per-line) (1- tags-per-line))
\r
93 > + ;; If this is not the last tag on the line, insert
\r
94 > + ;; enough space to consume the rest of the column.
\r
95 > + ;; Because the button for the name is `(1+ (length
\r
96 > + ;; name))' long (due to the trailing space) we can
\r
97 > + ;; just insert `(- widest (length name))' spaces - the
\r
98 > + ;; column separator is included in the button if
\r
99 > + ;; `(equal widest (length name)'.
\r
100 > + (widget-insert (make-string (max 1
\r
101 > + (- widest (length name)))
\r
103 > (setq count (1+ count))
\r
104 > (if (eq (% count tags-per-line) 0)
\r
105 > (widget-insert "\n")))
\r
109 > _______________________________________________
\r
110 > notmuch mailing list
\r
111 > notmuch@notmuchmail.org
\r
112 > http://notmuchmail.org/mailman/listinfo/notmuch
\r