From: Jani Nikula <jani@nikula.org>
To: David Edmondson <dme@dme.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: Improve `notmuch-hello' display on ttys.
Date: Tue, 10 Jan 2012 22:07:26 +0200 [thread overview]
Message-ID: <8762gjs4n5.fsf@nikula.org> (raw)
In-Reply-To: <1326190528-3548-1-git-send-email-dme@dme.org>
On Tue, 10 Jan 2012 10:15:28 +0000, David Edmondson <dme@dme.org> wrote:
> Inserting spaces to pad out columns is good, except when the padding
> makes the line wider than the window. This looks particularly bad on a
> tty where there is no fringe.
>
> Hence, avoid padding the last column on each row.
> ---
>
> Thanks to j4ni in #notmuch for spotting this.
Thanks for fixing this. This patch works for me.
BR,
j4ni.
>
> emacs/notmuch-hello.el | 20 +++++++++++---------
> 1 files changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> index 333d4c1..02017ce 100644
> --- a/emacs/notmuch-hello.el
> +++ b/emacs/notmuch-hello.el
> @@ -299,15 +299,17 @@ should be. Returns a cons cell `(tags-per-line width)'."
> :notify #'notmuch-hello-widget-search
> :notmuch-search-terms query
> formatted-name)
> - ;; Insert enough space to consume the rest of the
> - ;; column. Because the button for the name is `(1+
> - ;; (length name))' long (due to the trailing space) we
> - ;; can just insert `(- widest (length name))' spaces -
> - ;; the column separator is included in the button if
> - ;; `(equal widest (length name)'.
> - (widget-insert (make-string (max 1
> - (- widest (length name)))
> - ? ))))
> + (unless (eq (% count tags-per-line) (1- tags-per-line))
> + ;; If this is not the last tag on the line, insert
> + ;; enough space to consume the rest of the column.
> + ;; Because the button for the name is `(1+ (length
> + ;; name))' long (due to the trailing space) we can
> + ;; just insert `(- widest (length name))' spaces - the
> + ;; column separator is included in the button if
> + ;; `(equal widest (length name)'.
> + (widget-insert (make-string (max 1
> + (- widest (length name)))
> + ? )))))
> (setq count (1+ count))
> (if (eq (% count tags-per-line) 0)
> (widget-insert "\n")))
> --
> 1.7.7.3
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
next prev parent reply other threads:[~2012-01-10 20:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-10 10:15 [PATCH] emacs: Improve `notmuch-hello' display on ttys David Edmondson
2012-01-10 15:36 ` Austin Clements
2012-01-10 15:47 ` David Edmondson
2012-01-10 16:05 ` Austin Clements
2012-01-10 16:18 ` David Edmondson
[not found] ` <87zkdvffxu.fsf@nikula.org>
2012-01-10 20:45 ` Jani Nikula
2012-01-11 8:27 ` David Edmondson
2012-01-11 18:25 ` Ivy Foster
2012-01-10 20:07 ` Jani Nikula [this message]
2012-01-11 22:46 ` Xavier Maillard
2012-01-13 2:51 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8762gjs4n5.fsf@nikula.org \
--to=jani@nikula.org \
--cc=dme@dme.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).