From: Tad Fisher <tadfisher@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: vtable: Add column weights feature
Date: Sat, 8 Oct 2022 14:11:13 -0700 [thread overview]
Message-ID: <CA+BndftG5NJ3tJYqig1e4regjzs4xB-U_aSfVgadBL7HuFuG9A@mail.gmail.com> (raw)
In-Reply-To: <87k05atqg5.fsf@gnus.org>
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Tad Fisher <tadfisher@gmail.com> writes:
>
>> This is a patch to allow allocating the full window width to vtable
>> columns, in proportion to a new `weight' slot value.
>
> Thanks, the code looks good.
>
> But I'm not quite sure how the "weight" concept interacts with
> percentage widths? That is, when would it be preferable to add width
> specs to columns instead of just using percentages? (And an explanation
> for this should be added to the manual.)
In my mind, "percentage of window width" specs aren't useful to begin
with, because they interact poorly with fixed-width columns. If your
goal is to have the vtable occupy a particular width of the window (e.g.
100%), this goal becomes difficult/impossible as soon as a fixed-width
column is added.
So in the case you want the vtable to occupy 100% of the window width,
weights are the strictly superior option. In case you want the vtable to
occupy, say, 80% of the window width, then the only option is to assign
percentages to all columns and strictly avoid fixed-width specs.
Ideally, you'd have a constraint on the vtable itself---as in, "I want
the vtable to occupy 80% of the window width", and that value is used
instead of (window-width nil t) when calculating column widths.
And I do think that defining these concepts as "constraints" is the
better approach in the long run; as in, the "width", "min-width", and
"max-width" slots become part of an enumerated "constraint" type,
so the API limits the possible values to those that make sense. Then
the vtable--column-widths function solves those constraints to obtain
the final width values. Does this make sense? My experience is mostly
from Android UIs where this is a common way to define layouts, and my
understanding is that the CSS "flexbox" model is similar.
next prev parent reply other threads:[~2022-10-08 21:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-08 1:51 vtable: Add column weights feature Tad Fisher
2022-10-08 13:06 ` Lars Ingebrigtsen
2022-10-08 21:11 ` Tad Fisher [this message]
2022-10-09 14:26 ` Lars Ingebrigtsen
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://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+BndftG5NJ3tJYqig1e4regjzs4xB-U_aSfVgadBL7HuFuG9A@mail.gmail.com \
--to=tadfisher@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.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://git.savannah.gnu.org/cgit/emacs.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).