From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tad Fisher Newsgroups: gmane.emacs.devel Subject: Re: vtable: Add column weights feature Date: Sat, 8 Oct 2022 14:11:13 -0700 Message-ID: References: <87k05atqg5.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32619"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 08 23:12:38 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohH7d-000883-SJ for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Oct 2022 23:12:37 +0200 Original-Received: from localhost ([::1]:54576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohH7c-0005dg-Gh for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Oct 2022 17:12:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohH6L-0004x7-P9 for emacs-devel@gnu.org; Sat, 08 Oct 2022 17:11:17 -0400 Original-Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:44720) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohH6K-0000SM-4J for emacs-devel@gnu.org; Sat, 08 Oct 2022 17:11:17 -0400 Original-Received: by mail-pl1-x633.google.com with SMTP id x6so7337337pll.11 for ; Sat, 08 Oct 2022 14:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=xA/CTAs0UAA7V40XHqj9gU35tCto7jLaoGleq9mnOGg=; b=fD3nTmfMePyR1BZKcWg1l7pYDr8FUTMbC98/n7gBS4rnWYTjSBokSQ+KXDCPDOgogd YdJvQcOA8QaUOMu0FEoBoMcKsT8ElTG4t4398euzFWiH+JHkQgEts0h5ZldeuomM2an3 +EU2kSt2tbP/Ok7p8h0toKhxjkS7ZHmnj9TszAZZPDUSopLhJJzg+j79N2p+oqgFAvh0 rPlsBAZfxvD6Fi2zvUrrQAd2myoNiGjEs5zdWQXCVbLWUbuNfPYoGEggvz1zOGEwpJjF +q1QQzqo+nzHm9G3Nw+SHtKCxgIN9yKmOBHmQe1zmql8p9xSKvVO36I1RfjbVigszUcw uXcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xA/CTAs0UAA7V40XHqj9gU35tCto7jLaoGleq9mnOGg=; b=TcaKBWfBbf48Sl0hfjnXqiF1D2MscQyDG4rBWi9maLEWP+SmtbSG2mSLk7yAZkM0zG rQa54nVONC6b8uPNFyXfrDhxm0NU+qbJD+4oBxfVttmFzfYIarFy8PMG3oWl3O5tDF8J gzzeETIeitjLWY1/p1bElB4qvhfpsz03es2PW0jzkAHjNmdgSVn/UAMjyKzBj0GPiYU4 GAGLjjblAKGbC2jKfgtlwZc1AbblX3Gm9Z94tYa+7iAgNJmcnEUTCOSv+8cTNwPdAUIJ 23Vyam/V+IomAPYZ6pwZ8wyv58GqKBKA31yoXs3Y2n70/oRfEuKewT6qPKG2OvuNDCfl wBNQ== X-Gm-Message-State: ACrzQf39Bjg/ed8Sp7bSWloEOohPpqkt8oAwnQIuPVl0TS/PHUV4Jcyl xwjPoIwTrnlMm+H7uDmNc5EgbuBOnJtg9Dlma0CM3i5a X-Google-Smtp-Source: AMsMyM4bHo040gjJ349e3r6XR1LKBmcOkpudjY/C41DJt7UWBHaVOwYVLqI+nEjFaOAmZwS0AqlIL+KlQ/fnmdOex4g= X-Received: by 2002:a17:902:e748:b0:180:b0d:7b43 with SMTP id p8-20020a170902e74800b001800b0d7b43mr8853582plf.12.1665263474566; Sat, 08 Oct 2022 14:11:14 -0700 (PDT) Original-Received: from 723958793001 named unknown by gmailapi.google.com with HTTPREST; Sat, 8 Oct 2022 14:11:13 -0700 In-Reply-To: <87k05atqg5.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=tadfisher@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297224 Archived-At: Lars Ingebrigtsen writes: > Tad Fisher 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.