GNU logs - #69454, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Eric Marsden <eric.marsden@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 28 Feb 2024 14:54:02 +0000
Resent-Message-ID: <handler.69454.B.170913203520050 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 69454 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.170913203520050
          (code B ref -1); Wed, 28 Feb 2024 14:54:02 +0000
Received: (at submit) by debbugs.gnu.org; 28 Feb 2024 14:53:55 +0000
Received: from localhost ([127.0.0.1]:45418 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rfLJj-0005DF-2W
	for submit <at> debbugs.gnu.org; Wed, 28 Feb 2024 09:53:55 -0500
Received: from lists.gnu.org ([209.51.188.17]:51948)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eric.marsden@HIDDEN>)
 id 1rfLJg-0005Cr-Rs
 for submit <at> debbugs.gnu.org; Wed, 28 Feb 2024 09:53:53 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eric.marsden@HIDDEN>)
 id 1rfLAb-0001gE-9l
 for bug-gnu-emacs@HIDDEN; Wed, 28 Feb 2024 09:44:29 -0500
Received: from mail.risk-engineering.org ([2a01:4f8:c0c:a3f8::1])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eric.marsden@HIDDEN>)
 id 1rfLAZ-0004pl-ED
 for bug-gnu-emacs@HIDDEN; Wed, 28 Feb 2024 09:44:29 -0500
DKIM-Signature: a=rsa-sha256; bh=jd0GLd/Yp+GN+SglCTEctZ3gNjwnnCMjPhZ9+i5tMRw=; 
 c=relaxed/relaxed; d=risk-engineering.org;
 h=Subject:Subject:Sender:To:To:Cc:From:From:Date:Date:MIME-Version:MIME-Version:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Reply-To:In-Reply-To:Message-Id:Message-Id:References:Autocrypt:Openpgp;
 i=@risk-engineering.org; s=default; t=1709130552; v=1; x=1709562552;
 b=MKTHRryzB8eOXVIJthEKz0/aFT0+2HVRGpv0dIrm6sEQACL7sEzbECDAj2gSubm3jw5xOsR9
 WqD0sSnIt/zEFpMHGy7YcCZzFZ0A6AdCqWXPdtnk7ZMu0lAyJPyeh9TfGq0owApmBx241gemwc1
 4ZZWiMhkSuRzcBciYLzprknpcVCTFlZwoJmHz00C3A1lbwfVhZ046N6PYOKuIzRNtJ+0YMsvaU0
 UW0/M3ZcMPzlLWkOwnHlrEGhj+NPyht5vS4U7LCxGmwF6zQRdDld/yP7QB7rSRajJ/ejXS1eoiH
 6kHMazlMwy6hozQCk9HeBQQl710ytr5bmdqFWmPh8CVAg==
Received: by mail.risk-engineering.org (envelope-sender
 <eric.marsden@HIDDEN>) with ESMTPS id 435dd840; Wed, 28 Feb
 2024 15:29:12 +0100
Message-ID: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
Date: Wed, 28 Feb 2024 15:29:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
From: Eric Marsden <eric.marsden@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a01:4f8:c0c:a3f8::1;
 envelope-from=eric.marsden@HIDDEN;
 helo=mail.risk-engineering.org
X-Spam_score_int: -16
X-Spam_score: -1.7
X-Spam_bar: -
X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1,
 DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

Hello,

The following generates an error. It seems to me that it would be 
preferable to insert the header line and show zero rows for the vtable.

    (require 'vtable)
    (make-vtable :columns '("tweedle" "dum") :objects (list))

Debugger entered--Lisp error: (wrong-number-of-arguments #<subr max> 0)
   max()
   apply(max nil)
   seq-max(nil)
   #f(compiled-function (column index) #<bytecode 
-0x1c8aa8d5280f387a>)(#s(vtable-column :name "tweedle" :width nil 
:min-width nil :max-width nil :primary nil :align right :getter nil 
:formatter nil :displayer nil :-numerical t) 0)
   #f(compiled-function (elt) #<bytecode 
-0x13aa50143314c409>)(#s(vtable-column :name "tweedle" :width nil 
:min-width nil :max-width nil :primary nil :align right :getter nil 
:formatter nil :displayer nil :-numerical t))
   mapcar(#f(compiled-function (elt) #<bytecode -0x13aa50143314c409>) 
(#s(vtable-column :name "tweedle" :width nil :min-width nil :max-width 
nil :primary nil :align right :getter nil :formatter nil :displayer nil 
:-numerical t) #s(vtable-column :name "dum" :width nil :min-width nil 
:max-width nil :primary nil :align right :getter nil :formatter nil 
:displayer nil :-numerical t)))
   #f(compiled-function #'sequence #<bytecode 
0x1843ad21c7e878b4>)(#f(compiled-function (elt) #<bytecode 
-0x13aa50143314c409>) (#s(vtable-column :name "tweedle" :width nil 
:min-width nil :max-width nil :primary nil :align right :getter nil 
:formatter nil :displayer nil :-numerical t) #s(vtable-column :name 
"dum" :width nil :min-width nil :max-width nil :primary nil :align right 
:getter nil :formatter nil :displayer nil :-numerical t)))
   apply(#f(compiled-function #'sequence #<bytecode 0x1843ad21c7e878b4>) 
#f(compiled-function (elt) #<bytecode -0x13aa50143314c409>) 
(#s(vtable-column :name "tweedle" :width nil :min-width nil :max-width 
nil :primary nil :align right :getter nil :formatter nil :displayer nil 
:-numerical t) #s(vtable-column :name "dum" :width nil :min-width nil 
:max-width nil :primary nil :align right :getter nil :formatter nil 
:displayer nil :-numerical t)) nil)
   seq-map(#f(compiled-function (elt) #<bytecode -0x13aa50143314c409>) 
(#s(vtable-column :name "tweedle" :width nil :min-width nil :max-width 
nil :primary nil :align right :getter nil :formatter nil :displayer nil 
:-numerical t) #s(vtable-column :name "dum" :width nil :min-width nil 
:max-width nil :primary nil :align right :getter nil :formatter nil 
:displayer nil :-numerical t)))
   seq-map-indexed(#f(compiled-function (column index) #<bytecode 
-0x1c8aa8d5280f387a>) (#s(vtable-column :name "tweedle" :width nil 
:min-width nil :max-width nil :primary nil :align right :getter nil 
:formatter nil :displayer nil :-numerical t) #s(vtable-column :name 
"dum" :width nil :min-width nil :max-width nil :primary nil :align right 
:getter nil :formatter nil :displayer nil :-numerical t)))
   vtable--compute-widths(#<vtable vtable-158e2cf53118> nil)
   vtable--recompute-cache(#<vtable vtable-158e2cf53118>)
   vtable--ensure-cache(#<vtable vtable-158e2cf53118>)
   vtable-insert(#<vtable vtable-158e2cf53118>)
   make-vtable(:columns ("tweedle" "dum") :objects nil)
   (progn (make-vtable :columns '("tweedle" "dum") :objects (list)))
   elisp--eval-last-sexp(t)
   eval-last-sexp(t)
   eval-print-last-sexp(nil)


GNU Emacs 29.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, 
cairo version 1.18.0) of 2024-02-27, modified by Debian






Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Eric Marsden <eric.marsden@HIDDEN>
Subject: bug#69454: Acknowledgement (Not possible to insert an empty vtable)
Message-ID: <handler.69454.B.170913203520050.ack <at> debbugs.gnu.org>
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
X-Gnu-PR-Message: ack 69454
X-Gnu-PR-Package: emacs
Reply-To: 69454 <at> debbugs.gnu.org
Date: Wed, 28 Feb 2024 14:54:03 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 69454 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
69454: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D69454
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 09 Mar 2024 08:56:02 +0000
Resent-Message-ID: <handler.69454.B69454.170997452614426 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eric Marsden <eric.marsden@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>, Adam Porter <adam@HIDDEN>
Cc: 69454 <at> debbugs.gnu.org
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.170997452614426
          (code B ref 69454); Sat, 09 Mar 2024 08:56:02 +0000
Received: (at 69454) by debbugs.gnu.org; 9 Mar 2024 08:55:26 +0000
Received: from localhost ([127.0.0.1]:60605 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1risUI-0003kc-8N
	for submit <at> debbugs.gnu.org; Sat, 09 Mar 2024 03:55:26 -0500
Received: from eggs.gnu.org ([209.51.188.92]:40526)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1risUG-0003kN-6p
 for 69454 <at> debbugs.gnu.org; Sat, 09 Mar 2024 03:55:24 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1risTd-0000KE-7n; Sat, 09 Mar 2024 03:54:45 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=wOsHP6/UZuQFIMT7YwPnw4vHwh9k0UkO5kXw+aQuPvc=; b=j5gQiLCu18fIX6LI6G+e
 V2Ipo/yYSjJfDKtef9uwyvGqb3z4iBpkGHipz6eWgwAvM5sOOK4Sf8dIvkLSmND+4YZSrpAdWZYtM
 rlMqRTIv0shJBHT9rLogAb9c+X/lecG7Tqzp1RlH2Xdt1w0xM0Q/oit6JhVe5yHQ+MFTpy8V2swKC
 +9HgD5X8JUqfwN1UNVj4ikdodPi6caJtb4D4AEtli4dsbakgCSJ3n5+ODeZ0hCnLikOvOrRIeY57K
 OX3p7XARwmmtVWvNnNQxSEC41onkNAbxiq3F/D18rSsv6GDzc0pTZ9EzUPU5G3Ryv4fGzSJ/pwLav
 V4rnLWGUC4F4ZA==;
Date: Sat, 09 Mar 2024 10:54:43 +0200
Message-Id: <86plw3yecs.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 (message from Eric Marsden on Wed, 28 Feb 2024 15:29:11 +0100)
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Wed, 28 Feb 2024 15:29:11 +0100
> From: Eric Marsden <eric.marsden@HIDDEN>
> 
> Hello,
> 
> The following generates an error. It seems to me that it would be 
> preferable to insert the header line and show zero rows for the vtable.
> 
>     (require 'vtable)
>     (make-vtable :columns '("tweedle" "dum") :objects (list))
> 
> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr max> 0)
>    max()
>    apply(max nil)
>    seq-max(nil)

I'm not sure we want to support zero-size vtables.  A better error
message would be nice, though.  What do others think?

P.S. Adam, I took the liberty of adding you to this discussion, since
you seem lately to be interested in vtable.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Adam Porter <adam@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 11 Mar 2024 19:59:01 +0000
Resent-Message-ID: <handler.69454.B69454.171018708926055 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>, Eric Marsden <eric.marsden@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>
Cc: 69454 <at> debbugs.gnu.org
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171018708926055
          (code B ref 69454); Mon, 11 Mar 2024 19:59:01 +0000
Received: (at 69454) by debbugs.gnu.org; 11 Mar 2024 19:58:09 +0000
Received: from localhost ([127.0.0.1]:41342 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rjlmi-0006mA-Gd
	for submit <at> debbugs.gnu.org; Mon, 11 Mar 2024 15:58:08 -0400
Received: from heron.birch.relay.mailchannels.net ([23.83.209.82]:47975)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <adam@HIDDEN>) id 1rjlmf-0006m0-61
 for 69454 <at> debbugs.gnu.org; Mon, 11 Mar 2024 15:58:07 -0400
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id A95EC7617F8;
 Mon, 11 Mar 2024 19:57:29 +0000 (UTC)
Received: from pdx1-sub0-mail-a311.dreamhost.com (unknown [127.0.0.6])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 099CB7616F9;
 Mon, 11 Mar 2024 19:57:28 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1710187048; a=rsa-sha256;
 cv=none;
 b=G7m/nw6MGLWh98GgMfgscvRQwSrRWmxKXBC88TbGwuv/lzVfCG57cDdJDJc2PitUXPuxMX
 GMHQjWZXVc3mG8sYCv9uTcg1/Nx0kk0tZFuAZaPNAgAF8Oru1RuGpOTgeP/xvJWy11tfW6
 2Uzlans+qMbEK45pYnY7ifmOzBbdQLVY3DK7TyrmPnCV5iqLV8rNKT24DyY5api8+yH6Hz
 3aCLKKQJxCR8pQmr3ceggpSzCAnZqX2ev2X+mN3dcVs3vVqFCdO/SrtfpZDLlDPp01/+G+
 TcAWC7Ucbwn26MCnk9Wqi57ugHZ5Rxaz7/9i1hYmKcFEq9lxddxXf47PXMVglg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1710187048;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=a8dwhueUA8a1fK7yS7I23AqqcshLo9Jik6kB3rKLEII=;
 b=ykzvyzVKW4tBNmmhMZjCLP5DQfVdpQvclZgBEpCFfRpuTbMv0Go3yqNKARJUKTVbF5HsgE
 UpoMXHTIYieKVgyV1AXKb1Gl325fpZ+SRj4G8XuqfuJEDEohgqaJqI15jndJAhyZ+CWUxi
 x/KLgw79KGQ+kOUbkOCYo0pR19SjUpF+noxIu/FZMu4lJisuR9kaXToxDTjNfIP8HI8G2s
 yPQJ59PURWlJhwZvGZSFHtBqXiGWSGUrLtbsYuFN+5dR23oZstQgCIgYYgZhOp5BLnClhC
 W9IIxgVT6ENhXxhzF9ZMMn0eY19wx6n7tmmA45PLH8fpc8CGKfCC8x9bcPcRdg==
ARC-Authentication-Results: i=1; rspamd-5db57bc4b6-v7clm;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@HIDDEN
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|adam@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Arithmetic-Army: 103fa8495d20be1b_1710187048369_2443385048
X-MC-Loop-Signature: 1710187048369:2758609228
X-MC-Ingress-Time: 1710187048368
Received: from pdx1-sub0-mail-a311.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.126.245.200 (trex/6.9.2); Mon, 11 Mar 2024 19:57:28 +0000
Received: from [10.66.7.46] (unknown [91.193.232.98])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: adam@HIDDEN)
 by pdx1-sub0-mail-a311.dreamhost.com (Postfix) with ESMTPSA id 4TtncR1m1xz8S; 
 Mon, 11 Mar 2024 12:57:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net;
 s=dreamhost; t=1710187047;
 bh=a8dwhueUA8a1fK7yS7I23AqqcshLo9Jik6kB3rKLEII=;
 h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding;
 b=VxLc5XZcAf473SbruESokzhEtpQrVvDRPmsehYPT2ao+LQEr/q0jR87TutEkiXbVB
 4mk1AQkk7777c+vJWk9BOL/QB0WIgcnlJttCMj02x0txUP/al3EyhJ9P82YmnSfFWr
 DcfgEpDHMPeJHCg1qKvFeCH3MwyAmGyedC+ltujgcbgBQSegsqVlbjcRcbzD+LIgST
 deIDE3N7oEBXyQ48NAiRwgBW7ihgihZgJ62MyuPE9LPzZlJS2d55FBZf0GjZw15JTC
 MbYX40ZEYQPFwUY/3i6CO/7nD0ZDhYvVTQ+6gIbuX/QW9GGOVeR4Vl7hKxuSl/uuzg
 aCBwkF1CDaiCw==
Message-ID: <f4afce38-24db-4932-b3de-b947dd805323@HIDDEN>
Date: Mon, 11 Mar 2024 14:57:20 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
Content-Language: en-US
From: Adam Porter <adam@HIDDEN>
In-Reply-To: <86plw3yecs.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.6 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

Hi Eli,

 > P.S. Adam, I took the liberty of adding you to this discussion, since
 > you seem lately to be interested in vtable.

Thanks for adding me.  Indeed, I've found vtable to be very useful in my 
new listen.el package.

On 3/9/24 02:54, Eli Zaretskii wrote:
>> Date: Wed, 28 Feb 2024 15:29:11 +0100
>> From: Eric Marsden <eric.marsden@HIDDEN>
>>
>> Hello,
>>
>> The following generates an error. It seems to me that it would be
>> preferable to insert the header line and show zero rows for the vtable.
>>
>>      (require 'vtable)
>>      (make-vtable :columns '("tweedle" "dum") :objects (list))
>>
>> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr max> 0)
>>     max()
>>     apply(max nil)
>>     seq-max(nil)
> 
> I'm not sure we want to support zero-size vtables.  A better error
> message would be nice, though.  What do others think?

I tend to agree with Eric that it would be helpful if vtable could 
handle having an empty objects collection value to insert, because it 
saves the application from having to wrap the rather large `make-vtable' 
form in a `when' block, like here:

https://github.com/alphapapa/listen.el/blob/e9ea67350cf3b6cd870561c5e52d4b5255b04d34/listen-queue.el#L135

Also, it's possible that, after inserting a vtable, the collection of 
objects may be modified so that the collection is empty--then if the the 
vtable is reverted, it should be able to handle the case of the 
collection being empty.

AFAICT there's not much the application could do to avoid errors in that 
case, other than working outside of vtable's revert API and calling the 
function that tested the collection and conditionally inserted the 
vtable in the first place--in which case the vtable revert API would 
seem useless.

So IMO, when inserting or reverting a vtable, vtable ought to check 
whether the collection is empty; and if so, handle it gracefully, 
meaning that an "empty vtable" (whatever that would mean; maybe just one 
line of text saying that it's an empty collection) would still be 
inserted, and that if the collection became non-nil, it could be 
reverted and displayed properly.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 14 Mar 2024 09:39:02 +0000
Resent-Message-ID: <handler.69454.B69454.17104091117867 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Adam Porter <adam@HIDDEN>
Cc: larsi@HIDDEN, 69454 <at> debbugs.gnu.org, eric.marsden@HIDDEN
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.17104091117867
          (code B ref 69454); Thu, 14 Mar 2024 09:39:02 +0000
Received: (at 69454) by debbugs.gnu.org; 14 Mar 2024 09:38:31 +0000
Received: from localhost ([127.0.0.1]:48356 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rkhXi-00022p-TH
	for submit <at> debbugs.gnu.org; Thu, 14 Mar 2024 05:38:31 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34724)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rkhXh-00022c-9d
 for 69454 <at> debbugs.gnu.org; Thu, 14 Mar 2024 05:38:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1rkhX1-00024e-5s; Thu, 14 Mar 2024 05:37:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=WoUCHENKTgLCK8JRpVEz1N9UeEoPrCsNzIpqwcysyXQ=; b=GfgkdPAUPBd/mgX+pFr3
 VX3q+JSehkIGr6EU5Zg70KiSzy8e9FuFa9YxFjHKeSCFZ7qFu+djFDJToHPf4HQ9Aq/8e4Ub9+78N
 5o6Bt2avs08tZTZY4cGPe5ZzsGYFMo2JgSQ9v48x11JCgB61JC0a6ErUniLGvRdxncfd6MLKQokWh
 YYweixRsjm/E73kXm3CGs4UmCmWF1F7fjJCZRRCG5RpX8sgoLTYSvzWYb3XNczjQUxliqXW4if7sJ
 tlQjxRWquWTJMwobabWAl5lGhd1nQMxpKMb2rdEAm91wAjzi3mW/0tWUNi2SG20Hwes+rpL3wiU4y
 3FGpzzCNP8cntg==;
Date: Thu, 14 Mar 2024 11:37:21 +0200
Message-Id: <864jd9b1da.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <f4afce38-24db-4932-b3de-b947dd805323@HIDDEN> (message
 from Adam Porter on Mon, 11 Mar 2024 14:57:20 -0500)
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN> <f4afce38-24db-4932-b3de-b947dd805323@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 11 Mar 2024 14:57:20 -0500
> Cc: 69454 <at> debbugs.gnu.org
> From: Adam Porter <adam@HIDDEN>
> 
> Hi Eli,
> 
>  > P.S. Adam, I took the liberty of adding you to this discussion, since
>  > you seem lately to be interested in vtable.
> 
> Thanks for adding me.  Indeed, I've found vtable to be very useful in my 
> new listen.el package.
> 
> On 3/9/24 02:54, Eli Zaretskii wrote:
> >> Date: Wed, 28 Feb 2024 15:29:11 +0100
> >> From: Eric Marsden <eric.marsden@HIDDEN>
> >>
> >> Hello,
> >>
> >> The following generates an error. It seems to me that it would be
> >> preferable to insert the header line and show zero rows for the vtable.
> >>
> >>      (require 'vtable)
> >>      (make-vtable :columns '("tweedle" "dum") :objects (list))
> >>
> >> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr max> 0)
> >>     max()
> >>     apply(max nil)
> >>     seq-max(nil)
> > 
> > I'm not sure we want to support zero-size vtables.  A better error
> > message would be nice, though.  What do others think?
> 
> I tend to agree with Eric that it would be helpful if vtable could 
> handle having an empty objects collection value to insert, because it 
> saves the application from having to wrap the rather large `make-vtable' 
> form in a `when' block, like here:
> 
> https://github.com/alphapapa/listen.el/blob/e9ea67350cf3b6cd870561c5e52d4b5255b04d34/listen-queue.el#L135
> 
> Also, it's possible that, after inserting a vtable, the collection of 
> objects may be modified so that the collection is empty--then if the the 
> vtable is reverted, it should be able to handle the case of the 
> collection being empty.
> 
> AFAICT there's not much the application could do to avoid errors in that 
> case, other than working outside of vtable's revert API and calling the 
> function that tested the collection and conditionally inserted the 
> vtable in the first place--in which case the vtable revert API would 
> seem useless.
> 
> So IMO, when inserting or reverting a vtable, vtable ought to check 
> whether the collection is empty; and if so, handle it gracefully, 
> meaning that an "empty vtable" (whatever that would mean; maybe just one 
> line of text saying that it's an empty collection) would still be 
> inserted, and that if the collection became non-nil, it could be 
> reverted and displayed properly.

Thanks.  Would you or Eric like to submit a patch along these lines?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Adam Porter <adam@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 16 Mar 2024 00:16:02 +0000
Resent-Message-ID: <handler.69454.B69454.171054811419475 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: larsi@HIDDEN, 69454 <at> debbugs.gnu.org, eric.marsden@HIDDEN
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171054811419475
          (code B ref 69454); Sat, 16 Mar 2024 00:16:02 +0000
Received: (at 69454) by debbugs.gnu.org; 16 Mar 2024 00:15:14 +0000
Received: from localhost ([127.0.0.1]:53895 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rlHhh-000543-Ly
	for submit <at> debbugs.gnu.org; Fri, 15 Mar 2024 20:15:14 -0400
Received: from butterfly.birch.relay.mailchannels.net ([23.83.209.27]:42715)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <adam@HIDDEN>) id 1rlHhb-00053p-QB
 for 69454 <at> debbugs.gnu.org; Fri, 15 Mar 2024 20:15:12 -0400
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id CEBC9C2556;
 Sat, 16 Mar 2024 00:14:29 +0000 (UTC)
Received: from pdx1-sub0-mail-a277.dreamhost.com (unknown [127.0.0.6])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id 68189C0FF1;
 Sat, 16 Mar 2024 00:14:29 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1710548069; a=rsa-sha256;
 cv=none;
 b=U3vjpoweoRruquEMWL77IftPQX0wDXQEQoUuHdubjCDWRZKT4Lo8nz8EERUtfCipb7MpPL
 ODKVGLmo7XMNON7u9pq6wEw3sO0D+8EQ+GRjjKmh0hazlpS8S8cRDrHcAXqrZqmYl7vWgf
 G/mMsicqUvrVeSM0heQul1swI27sZlmfoBDg9rUrc3AfQL8dTGSrh8wBlWHDVeh8Y9wO5Q
 U75H825bqdMFMge9QUfywj9RMRsMok04ypZ0f9ugx8KzRF0xPZn0eHtelcr0qZKFSWzw7J
 wQwsGhg+tmK9SCo7N+FaCGguq98H3mP/5XTXdLwDSyglKqHV4iX6P6mepwRexA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1710548069;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=EwptVStL4SL6szUryMJ6Tfve8k0lpgAHo83RKNLvJ50=;
 b=rfJhNDZCs3iL9ERh28uLQ+lWuOg7P3Ak3RclFF8YgmvqfYIqbyYvoRZVrPPuV1rX0LdEV7
 3sHzyuVvhtmihL0vQgprrYxKDINZ+QFLf2mLuQbY5+oP5UINs+Qgh4sf5WqRR2ACSEQqUE
 /g8UoFhHeDIjBYhvgD4rhyGfIT1/O08GQZvOFSCllJgPrZ0OYxlFkXN1thSEbNdn7C3Izy
 Ga9dFZ47cjKxiPRBEEybr82n10fcQ53omTcTZdQkp/f5ktknb7dPQAOTUqQFKKeXOCqx4d
 e6SKJZkUk4n70v9x6PvkFhzdZl2F1z/BU2MOQ1QduoTKMCmOnJjoSYfJMg3tdw==
ARC-Authentication-Results: i=1; rspamd-76c7995f89-bsttq;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@HIDDEN
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|adam@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Thoughtful-Gusty: 0cdda49b3ab30acb_1710548069679_2351406609
X-MC-Loop-Signature: 1710548069679:286769728
X-MC-Ingress-Time: 1710548069678
Received: from pdx1-sub0-mail-a277.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.105.100.41 (trex/6.9.2); Sat, 16 Mar 2024 00:14:29 +0000
Received: from [10.43.0.18] (unknown [193.56.116.15])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: adam@HIDDEN)
 by pdx1-sub0-mail-a277.dreamhost.com (Postfix) with ESMTPSA id 4TxM776zCZzxr; 
 Fri, 15 Mar 2024 17:14:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net;
 s=dreamhost; t=1710548069;
 bh=EwptVStL4SL6szUryMJ6Tfve8k0lpgAHo83RKNLvJ50=;
 h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding;
 b=GXFGlpdEWbqJhX2it3/X0VV/QSQcgMdRRODzuCKYus8nmrfgADmMCmkxAozgopRZ1
 c2BFXetADf+mNtiJgOg7u8Ch8N6UJjOaT5sDgZs+V8l/0y/E+q7bCUHjlRaYPiDzA5
 wdt3buM5OnJMpWTInCLdBIXgiJEI4J4kEIjF3IVze75Swg3AjSqGfyuz5s/855z62q
 +nNQlOsKCTOxnd14p/aTK6LTPl8+Z8oyuAGwXr90BeL7KwSADfeRgzGtZpw3TNPRN5
 lUyex+mwpHXaec8XjqxZrg8LfeAVRt91GmMDj2E4AmtSzuT2yQZV7NcuO37LguW9t6
 s69uIfH/Gv6zA==
Message-ID: <00326f1b-9b06-4ee8-ac3e-5b6a110ef7db@HIDDEN>
Date: Fri, 15 Mar 2024 19:14:25 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN> <f4afce38-24db-4932-b3de-b947dd805323@HIDDEN>
 <864jd9b1da.fsf@HIDDEN>
From: Adam Porter <adam@HIDDEN>
In-Reply-To: <864jd9b1da.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.6 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

On 3/14/24 04:37, Eli Zaretskii wrote:

>> So IMO, when inserting or reverting a vtable, vtable ought to check
>> whether the collection is empty; and if so, handle it gracefully,
>> meaning that an "empty vtable" (whatever that would mean; maybe just one
>> line of text saying that it's an empty collection) would still be
>> inserted, and that if the collection became non-nil, it could be
>> reverted and displayed properly.
> 
> Thanks.  Would you or Eric like to submit a patch along these lines?

I'll put it on my Emacs to-do list, but I don't think I'll be able to 
make time for it anytime soon.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Joost Kremers <joostkremers@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 30 Apr 2024 09:12:02 +0000
Resent-Message-ID: <handler.69454.B69454.171446826923347 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Adam Porter <adam@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>, 69454 <at> debbugs.gnu.org, Eric Marsden <eric.marsden@HIDDEN>
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171446826923347
          (code B ref 69454); Tue, 30 Apr 2024 09:12:02 +0000
Received: (at 69454) by debbugs.gnu.org; 30 Apr 2024 09:11:09 +0000
Received: from localhost ([127.0.0.1]:59245 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1jW0-00064V-F3
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 05:11:08 -0400
Received: from fout8-smtp.messagingengine.com ([103.168.172.151]:33733)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joostkremers@HIDDEN>) id 1s1jVv-000648-2Y
 for 69454 <at> debbugs.gnu.org; Tue, 30 Apr 2024 05:11:06 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailfout.nyi.internal (Postfix) with ESMTP id 6C0C21380914;
 Tue, 30 Apr 2024 05:10:37 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute6.internal (MEProxy); Tue, 30 Apr 2024 05:10:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm3; t=1714468237;
 x=1714554637; bh=A6dQNEYqiz98gTlTYauHjNElctjpWt6gvF7Eco+3TWc=; b=
 3zrznqa0yZnZSrKgGxMyJcudfakIIor9dyBR71q/J9OMbOGMZkyx4aRebONL6jFp
 W0wyi0hakmsd4xH6zBQguxOickd7HSMe1kOtLGpbq5QcaMvm2OJ5HHO1Ejq9McoR
 6oBJDW3AIP747u+fzIPDN1JeMbffxbBnuNR7bT0FDtVdXdO2jVhlzMXGa3FI41A/
 +IIxYqgOT41SgdrdY3ahOMZ4rs62VKSoj5gjdfjN1JWEXxCDt+bjseetfN1y/EhM
 7d9BLiVqjLxatwjscffx53Vn22TqBJn2FcKojCw1+RRhFR3TFT9NPvMhKIY4iW4P
 pfH6Z2fAJzQxsVKF8Necqg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714468237; x=
 1714554637; bh=A6dQNEYqiz98gTlTYauHjNElctjpWt6gvF7Eco+3TWc=; b=O
 tX2m+T94AJBc2WYzhJuJjSOc4ZAITYeMLmWPzCSZd4YJkZ03NPT/R7bkWuE2ikc3
 b5NypaEqECzW9aJIDEYJRfScurk6s82MppVALCvmV1+fY8fbqVe+HV9vMu+cJR0m
 q92n5llR1GFlhHQGClAz9K+KDp//JtX/8VjBEKpu06Q08f4L6wfpv1bAC+o750/E
 PQFJWMTY/gTDdz4w3ML7JijxcEE+A9O+tLLExHwYyeVYSN1j7SA6Gw/8P1LACPab
 ChEVaH22bJ1V37/pUiKMWpHesgFZ3Xkq9KwsP3Yucauh7WR8YlxQsDwxFTT4KEjw
 i6KVHII7S0aX6KmTXF92g==
X-ME-Sender: <xms:jbUwZlpCbsczo_dmSw3Nk96MvUdspUoI0plDVhGHx1Uvx-_bWlZSOQ>
 <xme:jbUwZno4fXim_NNodUSoPBmT_wDEnEGhrXmKn7yNN39TyQqCy8_2_nlo5nvsri6FK
 wneTWHuq1xU5Q>
X-ME-Received: <xmr:jbUwZiMA56GRVhpBOU52ARVDg5wg7VyTCNA8d2ZUo5MMwgUhXi_jY_NuvI5kPLd2XFZ2BK86d3w83hrYpttXU2Dp6YGX6h4DLHlXSO6mPzW5PgKl6Aoh2SNjh7k6QkWH-FBqJ61cTd8NYnJ1o49gNv24jufcPVIoKuHFYQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddufedgudefucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvvefujghffgffkfggtgfgsehtqhertddtreejnecuhfhrohhmpeflohho
 shhtucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfh
 hmqeenucggtffrrghtthgvrhhnpeetteekvddvffefuefhkeetveejieejkeevgfdvtdej
 tedvjeeiteekteeitdejhfenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluh
 hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoohhsthhkrhgv
 mhgvrhhssehfrghsthhmrghilhdrfhhm
X-ME-Proxy: <xmx:jbUwZg7toTgJICzO1OF2LnGjFk77uJLAWUsw_fznkzh5Oxt88PpJhA>
 <xmx:jbUwZk5HGIFZBbds91Rp0B1kOll3bFuZb6S-4Qca4gh3We_J1Mk_Rw>
 <xmx:jbUwZogMNajo0t7fWmdhuVrGmC3T1gg-9VSKKEo6MYQcAlk4tRI_TA>
 <xmx:jbUwZm4X1jd40xaQVImO5bV-VIOULq1jc0u5gTIIBqizTAeqql-btA>
 <xmx:jbUwZuQwQUzbeczt5qb1bqVh85UCWL64lTl9udo2lvB-O1ltooTgVjJF>
Feedback-ID: ie15541ac:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 30 Apr 2024 05:10:35 -0400 (EDT)
From: Joost Kremers <joostkremers@HIDDEN>
In-Reply-To: <86plw3yecs.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 09 Mar
 2024 10:54:43 +0200")
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
User-Agent: mu4e 1.12.2; emacs 29.3
Date: Tue, 30 Apr 2024 11:10:32 +0200
Message-ID: <86jzkfcj1z.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Sat, Mar 09 2024, Eli Zaretskii wrote:
>> Date: Wed, 28 Feb 2024 15:29:11 +0100
>> From: Eric Marsden <eric.marsden@HIDDEN>
>>=20
>> Hello,
>>=20
>> The following generates an error. It seems to me that it would be=20
>> preferable to insert the header line and show zero rows for the vtable.
>>=20
>>  =C2=A0=C2=A0 (require 'vtable)
>>  =C2=A0=C2=A0 (make-vtable :columns '("tweedle" "dum") :objects (list))
>>=20
>> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr max> 0)
>>  =C2=A0 max()
>>  =C2=A0 apply(max nil)
>>  =C2=A0 seq-max(nil)
>

I ran into this same problem myself, trying to use vtable for my package
Ebib[1]. I did some digging and found that the cause of the problem is not =
that
the vtable is empty, but rather that the column widths cannot be determined=
. If
you pass explicit widths for each column, `make-vtable` (or rather
`vtable-insert`) works just fine with an empty table:

```
(make-vtable :columns '((:name "tweedle" :width 30) (:name "dum" :width 10))
             :objects (list))
```

The error occurs in `vtable--compute-widths`, which returns a vector with t=
he
widths of each column. For columns that don't have their width set explicit=
ly,
the width is computed on the basis of the elements in the column, but if th=
ere
are no elements, that fails.

> I'm not sure we want to support zero-size vtables.  A better error
> message would be nice, though.  What do others think?

For my purpose (i.e., Ebib), support for empty vtables would be a big plus.=
 I
wouldn't even want to display some sort of text or warning, just the header=
 and
nothing else. (I guess this could be made configurable, though. Something l=
ike
an :if-empty slot specifying a function to call if the table is empty. This
function could then display some text, give a warning in the minibuffer, ra=
ise
an error, or do nothing at all.)

In order to support empty vtables, the column width issue would have to be
resolved, of course. My suggestion (again coming from my use-case) would be=
 that
if some columns have no :width slot, the remaining available width (i.e., t=
he
window width minus the explicit column widths) is divided evenly between th=
em.

Of course, that may turn out to be suboptimal once objects are added to the
vtable, but I don't think it's unreasonable to expect the programmer to take
that into account when using vtable.el. And the user always has the option =
of
regenerating the table. (There's `vtable-revert-command`, after all.)

For me, the reason why this would be useful is that the data that I want to
display in a vtable has one field that can be very long, while the others a=
re
usually fairly short. In my current, custom table implementation, this long
field is the right-most column and can thus use the full width of the windo=
w to
display its data. This works fine with vtable, except if the table is empty.


Footnotes:
[1]  https://github.com/joostkremers/ebib/tree/devel/vtable

--=20
Joost Kremers
Life has its moments




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 30 Apr 2024 12:16:02 +0000
Resent-Message-ID: <handler.69454.B69454.171447933810210 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: adam@HIDDEN, Joost Kremers <joostkremers@HIDDEN>
Cc: larsi@HIDDEN, 69454 <at> debbugs.gnu.org, eric.marsden@HIDDEN
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171447933810210
          (code B ref 69454); Tue, 30 Apr 2024 12:16:02 +0000
Received: (at 69454) by debbugs.gnu.org; 30 Apr 2024 12:15:38 +0000
Received: from localhost ([127.0.0.1]:59415 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1mOX-0002ec-OS
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 08:15:38 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36886)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s1mOV-0002eV-01
 for 69454 <at> debbugs.gnu.org; Tue, 30 Apr 2024 08:15:35 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s1mO4-0007nO-6J; Tue, 30 Apr 2024 08:15:08 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=z0BvG5yrz253w6z64HU1vKxTSsbD6uoPh687o0v7/Dc=; b=b+fxBU7cJeVh
 L/5p/4oOzqW/idLTc7pzSVXUkuotvFyQgwL4ZpFswTwaXWSs1+Oj/8BkKF41H+k/fKmW7rMhVzOgd
 +v1keyOfm4yj5a0fHKE6N/8nKdrSyyIr/qaQCx1QbQlRzLKLyW3xiI9stUABuJCeQPFlKG01JkQOw
 WJZ4HtDMpoz1FMFg0vP9ky/ziCbhxpHwYGZobh3rdUtShLvLticX/YNzPFeXRricUjmJlS5OltSeq
 YA+PVI4ehArlqpc/n9d9Bf2gygfIGjNNxYC6/3hvzGFH9o3zTuG1WPeQkDCMWNchBhznwkucQjbPd
 H8TC/SGJS+65K6/GKwUXOQ==;
Date: Tue, 30 Apr 2024 15:14:43 +0300
Message-Id: <865xvzqc7g.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <86jzkfcj1z.fsf@HIDDEN>
 (message from Joost Kremers on Tue, 30 Apr 2024 11:10:32 +0200)
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Joost Kremers <joostkremers@HIDDEN>
> Cc: Eric Marsden <eric.marsden@HIDDEN>,  Lars Ingebrigtsen
>  <larsi@HIDDEN>,  Adam Porter <adam@HIDDEN>,
>   69454 <at> debbugs.gnu.org
> Date: Tue, 30 Apr 2024 11:10:32 +0200
> 
> In order to support empty vtables, the column width issue would have to be
> resolved, of course. My suggestion (again coming from my use-case) would be that
> if some columns have no :width slot, the remaining available width (i.e., the
> window width minus the explicit column widths) is divided evenly between them.

Sounds reasonable, but I don't use vtables.  Adam, WDYT?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 01 May 2024 11:56:01 +0000
Resent-Message-ID: <handler.69454.B69454.171456450612019 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Adam Porter <adam@HIDDEN>
Cc: joostkremers@HIDDEN, larsi@HIDDEN, 69454 <at> debbugs.gnu.org, eric.marsden@HIDDEN
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171456450612019
          (code B ref 69454); Wed, 01 May 2024 11:56:01 +0000
Received: (at 69454) by debbugs.gnu.org; 1 May 2024 11:55:06 +0000
Received: from localhost ([127.0.0.1]:37067 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s28YE-00037n-0C
	for submit <at> debbugs.gnu.org; Wed, 01 May 2024 07:55:06 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46442)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s28YA-00037N-FB
 for 69454 <at> debbugs.gnu.org; Wed, 01 May 2024 07:55:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s28Xi-0001pi-OU; Wed, 01 May 2024 07:54:34 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=YyFdIVvCZ25WFC1fCSCvp6amwA/2haDHJnoHQ7b7lDE=; b=XpPlLga12/yu
 JMJbeczZCfm3JWbFQMXErc4ir4UxLSlnuLLjbEXm3NnpeF2G/fwyeGtcvoYT+YrkPN5mplu+UZtkF
 2STU1pL/UJikRbRDMIR/ORut/eMh8FQbUJZD7mDePbS2HB4J25Wi1ir4xx8hgo0bW6zQ3VPHI1ayQ
 fIBuCfFNr14/niTt/5MDLy2qpSX6vt3PDATKBqEOHhMf/cxUZY/f6WdI3AidXjDT9VIb/qXElLz6x
 WWidXAh0/wf/xexQMLX18rjpc4+nLh5jcq3OZ+xAmK8rsjAJ0yZ8HpNWZcHb8woo6QqP7mdrHbMzV
 FWLUC6OjWW/c4gtrMNkYqw==;
Date: Wed, 01 May 2024 14:54:31 +0300
Message-Id: <86cyq5px1k.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <8f5fb814-5d88-4ad3-b12a-8246325d5d21@HIDDEN> (message
 from Adam Porter on Tue, 30 Apr 2024 18:20:36 -0500)
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
 <865xvzqc7g.fsf@HIDDEN> <8f5fb814-5d88-4ad3-b12a-8246325d5d21@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 30 Apr 2024 18:20:36 -0500
> Cc: eric.marsden@HIDDEN, larsi@HIDDEN, 69454 <at> debbugs.gnu.org
> From: Adam Porter <adam@HIDDEN>
> 
> >> In order to support empty vtables, the column width issue would have to be
> >> resolved, of course. My suggestion (again coming from my use-case) would be that
> >> if some columns have no :width slot, the remaining available width (i.e., the
> >> window width minus the explicit column widths) is divided evenly between them.
> > 
> > Sounds reasonable, but I don't use vtables.  Adam, WDYT?
> 
> Well, I'm not sure how useful it would be to calculate the widths of 
> columns and show them if there are no data objects to render in them; 
> especially, if the columns have to be recalculated and the table has to 
> be re-rendered as soon as objects are shown in it.  It would seem to 
> merely serve as confirmation of which columns are defined in the vtable.
> 
> IOW, it seems that, if there are no objects to show, it might be just as 
> good to short-circuit the columns and just insert some kind of "[no 
> objects]" string.

That's also reasonable.

> I don't have a strong opinion on this, though.  I think I would 
> generally favor whichever approach required the smallest change to the code.

Agreed.  Patches welcome.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Joost Kremers <joostkremers@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 02 May 2024 07:32:02 +0000
Resent-Message-ID: <handler.69454.B69454.17146351007905 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Adam Porter <adam@HIDDEN>
Cc: 69454 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>, larsi@HIDDEN, eric.marsden@HIDDEN
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.17146351007905
          (code B ref 69454); Thu, 02 May 2024 07:32:02 +0000
Received: (at 69454) by debbugs.gnu.org; 2 May 2024 07:31:40 +0000
Received: from localhost ([127.0.0.1]:42100 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s2Qul-00023R-15
	for submit <at> debbugs.gnu.org; Thu, 02 May 2024 03:31:40 -0400
Received: from fout4-smtp.messagingengine.com ([103.168.172.147]:48921)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joostkremers@HIDDEN>) id 1s2Qui-00023L-5P
 for 69454 <at> debbugs.gnu.org; Thu, 02 May 2024 03:31:33 -0400
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailfout.nyi.internal (Postfix) with ESMTP id 5395613803AD;
 Thu,  2 May 2024 03:31:05 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Thu, 02 May 2024 03:31:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm3; t=1714635065;
 x=1714721465; bh=RBq9U5Aa2/KbNkUfcQ49b6envzq4sCr9HVqQ0J445XY=; b=
 JsIiJrD2Dvy1Q33+0KecFInGtSH1//q7NKpG6o+clDDDaiNaBTL35Cad2y8L9J3N
 o9LzUr4GWxK0BwbReTcMvTILUFN4C9Uqv5JDnBhoUy/j6SvIGI4PZumIzqEUChMq
 gztjBS+mxVgcY6pud6gmlqx7ALCwiXIw/oBGRHmIS7VGgkA/GsoUYr5NARD58ldq
 eoqeqk2drufBMGsgYlQTjzDUUNk92f7tefjWwMcAqdkSxZzgVpdxDcqm2thS09QW
 ysLdFpJmOhUkQodsEcFNw97lwEGpD+i+nJtlRgoTc3m/Ec/dj/Xb4EYs1d0k+Myd
 I1hmYwUx4G66MJboKDX/Ag==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714635065; x=
 1714721465; bh=RBq9U5Aa2/KbNkUfcQ49b6envzq4sCr9HVqQ0J445XY=; b=H
 vykSeY5fij+wn6GD+izs2uN/tBC02X0Tk4p0fDtWITHJMQOsE7FQ4q65JpAkDy9K
 5HfWUY1XxaW/Z0MsBjApp3J8ALi7IYCi7WqlADX+RuVwHtizOuhpQRCXwfSNl7bq
 zX2E2nNZE3IOtTtv6qY2W/8whCyPJ3aih1abpLZrpkmj6tiJnru3bpY0OL3YRf0E
 sE8gV4+hHfJU7Xbl17tlSRFASpZMMk295k3v+FncSUWtfidIC60/JoxHR4qViDpt
 m1rt8A4pAlfoQD71087whsFCkqI7cPuMza7g9aNHW65pUpsYIDpgQOzKUmUn4JTY
 lbpBIIl8K0a7HFfxOIElg==
X-ME-Sender: <xms:OEEzZv1VgV5AUZfcCM_W5WKhnITGX6J57j19j5BI_M4ZX_ifIZRiJg>
 <xme:OEEzZuEGhWO3BbPELQx-bfxfa7I1AGGFEMaQA38IPOj0OauBNDUC2__ZmU6pMm_tc
 AEVZhUcb0tUtg>
X-ME-Received: <xmr:OEEzZv5rnlBNNmVpYURNrtQVdc6VxZkb1_p68P4ZBwoaNopbDHbZrpAIGw2NKhUiOUT_GaVnxQaK_bitj7KzrF_ULEdHvNv3VLFncY7gDVFeyUFQvlmVKQz-YCzb9o0txc1PVmgOw-yWyN-OcS1LtZl68YL7leDWmPAP>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddujedguddulecutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd
 enucfjughrpefhvfevufgjfhgffffkgggtgfesthhqredttderjeenucfhrhhomheplfho
 ohhsthcumfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrd
 hfmheqnecuggftrfgrthhtvghrnhepleegieehudeuleegvedufeegtdffjeduteevuddt
 hfekjeetgeehveekuedtgfdvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe
 hmrghilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhm
X-ME-Proxy: <xmx:OEEzZk2bhb-AA-4SNqT-nnOgTgfGgzC3g169_jX8a6XyGEYuIUxyVQ>
 <xmx:OEEzZiESqsKT7BnqPtxL9O19yzhO5X1qys7rl-ICmw5bnG-MAM5GdA>
 <xmx:OEEzZl_6BYQIhF5WVdDTJQTWaYRHOw3Qc5tgKE0Ay9M6nQTbzGYPCA>
 <xmx:OEEzZvmFrjnr5OUNXMK1WgWbE3plDFJ2TJQiIwt7PF9YPzr5Nrdv7Q>
 <xmx:OUEzZvO6MAF-4SDkoiFQ4zs3FKeN00o5Op4ZHFxSIqx8vCBWm0LftEHD>
Feedback-ID: ie15541ac:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 2 May 2024 03:31:03 -0400 (EDT)
From: Joost Kremers <joostkremers@HIDDEN>
In-Reply-To: <8f5fb814-5d88-4ad3-b12a-8246325d5d21@HIDDEN> (Adam
 Porter's message of "Tue, 30 Apr 2024 18:20:36 -0500")
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
 <865xvzqc7g.fsf@HIDDEN>
 <8f5fb814-5d88-4ad3-b12a-8246325d5d21@HIDDEN>
User-Agent: mu4e 1.12.2; emacs 29.3
Date: Thu, 02 May 2024 09:31:01 +0200
Message-ID: <86frv0u0ui.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Adam,

On Tue, Apr 30 2024, Adam Porter wrote:
> Well, I'm not sure how useful it would be to calculate the widths of colu=
mns and
> show them if there are no data objects to render in them; especially, if =
the
> columns have to be recalculated and the table has to be re-rendered as so=
on as
> objects are shown in it.

Yes, that's what I meant when I said the code using vtable.el would have to=
 take
that into consideration. In my case, I do that by leaving only the last col=
umn's
width undefined.

>  It would seem to merely serve as confirmation of which
> columns are defined in the vtable.

Yup, that is exactly right, but I think there are circumstances in which th=
at
may be useful. Specifically, cases where the data being displayed is genera=
ted
by the user. (Think database front-end, even though I realise vtable.el isn=
't
suitable for displaying extremely large amounts of data. In my use-case, the
amount of data is manageable, though.)

> IOW, it seems that, if there are no objects to show, it might be just as =
good to
> short-circuit the columns and just insert some kind of "[no objects]" str=
ing.
>
> I don't have a strong opinion on this, though.  I think I would generally=
 favor
> whichever approach required the smallest change to the code.

In that case, go with your suggestion, because mine certainly would require
bigger changes. =F0=9F=98=80=20


--=20
Joost Kremers
Life has its moments




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Joost Kremers <joostkremers@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 05 May 2024 12:16:02 +0000
Resent-Message-ID: <handler.69454.B69454.171491134517031 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Adam Porter <adam@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>, 69454 <at> debbugs.gnu.org, Eric Marsden <eric.marsden@HIDDEN>
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171491134517031
          (code B ref 69454); Sun, 05 May 2024 12:16:02 +0000
Received: (at 69454) by debbugs.gnu.org; 5 May 2024 12:15:45 +0000
Received: from localhost ([127.0.0.1]:59409 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s3amO-0004Qd-Ui
	for submit <at> debbugs.gnu.org; Sun, 05 May 2024 08:15:45 -0400
Received: from wfout6-smtp.messagingengine.com ([64.147.123.149]:51785)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joostkremers@HIDDEN>) id 1s3amL-0004QX-BU
 for 69454 <at> debbugs.gnu.org; Sun, 05 May 2024 08:15:42 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailfout.west.internal (Postfix) with ESMTP id A6E021C000E7;
 Sun,  5 May 2024 08:15:11 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Sun, 05 May 2024 08:15:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 cc:cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm3; t=1714911311;
 x=1714997711; bh=BSFlBPe48dUPGhDWwr59/P2oMwDG4FC8e2NaSrfr868=; b=
 Zx5JL8zzM+UhvQ0cyV4Sg+y5H+6LFm6IthmxzqQEwSIls5yb22alRbTHXfivN6O3
 j8pFQdDxqYAywH97UNX3oBzDG4mksfPhC+uxORY4W95rY3dooL4VMnwcCmVJf738
 prDqTqkm3WJh1dEHW/JuB+/CGul6z8aGiButUG3ulaBSvM52bABkMe9of4SrdhdU
 cd0us+aCaqfSaLx3XJ8j+7C1uOsUcKRqz/7KxJNLrVU4oNjEs4DPiOpjlXIj8ujx
 jexwaVpyjzmKJy8hzv8TTqjS253dCpI7+Z8/yiE5/7upU6i3H2HZy7TzkEknuCuJ
 KjfvM6vwc7YiNHgRJwAk3g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714911311; x=
 1714997711; bh=BSFlBPe48dUPGhDWwr59/P2oMwDG4FC8e2NaSrfr868=; b=B
 pYyzHiWIKgWOxN2O2Ytdgqa/TXI88WlvmiuCJuBG6pHVreKCLqRiDjErYwa0HNQd
 WNrTWvr2xoh6OEKkJSSQWMakGYqusV5yJt0ZlO59YWSZCWE7XEVSoN/elvdqFSRp
 DDaXhG2bH5sJmU9PDjtNAI6/WOVJsBTO974qkMIkDsODAkCOqCCWCZAubUbpJ7ez
 j8JBtKtAhoWV/CRmTsSlQUIrX+JRD2keOTE3ryr9JcVmmf0LyPtNzV6up/wMdEIo
 SLz4FsOGkNYzYugoSOj4pX8Ly1yP6D9rFcQKaGZJoSuvF1mbyofMJegk/mtdkYLT
 lgW9oyGin5DIOXf5rlnAg==
X-ME-Sender: <xms:Tng3ZiHcPLnTWfp9WS2CV3Vrm4-pY08PvZhwWTogNWCyGiQrXi5-pw>
 <xme:Tng3ZjV8EWFAzXW3nS-jXCIxV7SDXeF9uuYl8G-uYucZHaMQfo8FFZrSnYjExB5IF
 qugo_l7E8x9UQ>
X-ME-Received: <xmr:Tng3ZsLYRXhq0VjKiIq66Dv6jpZYvoYKYUhqnzP-wo3hSOKNHFw-Am6Ph-IOm18WB4c7jk7rwImji3ZkLyD0Jz6kiPP0TxX-Z_tW-A>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvgedgheduucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvvefujghffgffkfggtgfgsehtqhertddtreejnecuhfhrohhmpeflohho
 shhtucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfh
 hmqeenucggtffrrghtthgvrhhnpeelgeeiheduueelgeevudefgedtffejudetvedutdfh
 keejteegheevkeeutdfgvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh
 grihhlfhhrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh
X-ME-Proxy: <xmx:Tng3ZsECN0p3C3bmc6j1xcvyNXj5IJkBJacDfF_TLnZHD4eyFQ393Q>
 <xmx:Tng3ZoVWFSoGzO-Y4LnqB7FYUAc1WN3E-qvyZooE-VqYY-UxE6KilA>
 <xmx:Tng3ZvPwU7BcQ4I4lAiJjznwsSA5KU0Ruia7eJK2irucA0aqT1Sidw>
 <xmx:Tng3Zv162cqUcWR7SlgBHCun04GWUOc37wL4Y27OpzI7bPA9am-xhg>
 <xmx:T3g3ZifIk7LDKWg8o8AGD6bXM8LaKzgP9ErgTE342VyMdvRTdeLF5yEg>
Feedback-ID: ie15541ac:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 5 May 2024 08:15:09 -0400 (EDT)
From: Joost Kremers <joostkremers@HIDDEN>
In-Reply-To: <86jzkfcj1z.fsf@HIDDEN>
 (Joost Kremers's message of "Tue, 30 Apr 2024 11:10:32 +0200")
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
User-Agent: mu4e 1.12.2; emacs 29.3
Date: Sun, 05 May 2024 14:15:06 +0200
Message-ID: <86ikzstpyt.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Tue, Apr 30 2024, Joost Kremers wrote:
> On Sat, Mar 09 2024, Eli Zaretskii wrote:
>>> Date: Wed, 28 Feb 2024 15:29:11 +0100
>>> From: Eric Marsden <eric.marsden@HIDDEN>
>>>=20
>>> Hello,
>>>=20
>>> The following generates an error. It seems to me that it would be=20
>>> preferable to insert the header line and show zero rows for the vtable.
>>>=20
>>>  =C2=A0=C2=A0 (require 'vtable)
>>>  =C2=A0=C2=A0 (make-vtable :columns '("tweedle" "dum") :objects (list))
>>>=20
>>> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr max> 0)
>>>  =C2=A0 max()
>>>  =C2=A0 apply(max nil)
>>>  =C2=A0 seq-max(nil)
>>
> I ran into this same problem myself, trying to use vtable for my package
> Ebib[1]. I did some digging and found that the cause of the problem is no=
t that
> the vtable is empty, but rather that the column widths cannot be determin=
ed.

As I just realised, the problem is actually bigger than that: given the cur=
rent
implementation of vtable-insert-object, it's not possible to add objects to=
 an
empty vtable. (Specifically, it uses nconc twice, once on the list of objec=
ts
and once the cache, both of which fail silently if those are nil, and it us=
es
setcar on the cache, which yields an error if the cache is nil.)

Just wanted to mention that here for completeness' sake, if anyone ever dec=
ides
to fix these issues. For now, the easiest thing to do is probably do disall=
ow
empty vtables altogether.

--=20
Joost Kremers
Life has its moments




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Joost Kremers <joostkremers@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 May 2024 21:41:02 +0000
Resent-Message-ID: <handler.69454.B69454.17171052543899 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Adam Porter <adam@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>, 69454 <at> debbugs.gnu.org, Eric Marsden <eric.marsden@HIDDEN>
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.17171052543899
          (code B ref 69454); Thu, 30 May 2024 21:41:02 +0000
Received: (at 69454) by debbugs.gnu.org; 30 May 2024 21:40:54 +0000
Received: from localhost ([127.0.0.1]:52671 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sCnW1-00010o-IH
	for submit <at> debbugs.gnu.org; Thu, 30 May 2024 17:40:54 -0400
Received: from fhigh3-smtp.messagingengine.com ([103.168.172.154]:57619)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joostkremers@HIDDEN>) id 1sCnVz-00010a-5l
 for 69454 <at> debbugs.gnu.org; Thu, 30 May 2024 17:40:52 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailfhigh.nyi.internal (Postfix) with ESMTP id 1D13D114014B;
 Thu, 30 May 2024 17:40:35 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Thu, 30 May 2024 17:40:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 cc:cc:content-type:content-type:date:date:from:from:in-reply-to
 :in-reply-to:message-id:mime-version:references:reply-to:subject
 :subject:to:to; s=fm1; t=1717105235; x=1717191635; bh=zOO8CPDWxl
 KIPemMisv5FLCnuDn3al+x1vHoHpc92wo=; b=m001C856ABVIZ1WbaY4a5Gjsce
 pvvxvTgjDUJHTqb/trmybC0PQe5pQWxxOx/ToupU75id78ecEfIzsORM/CI6gc+J
 SOUcqmDE8NpWxcZrOnzOBxTL4LZAbrHQ1gtR8d87j3m+Q4k2OYIDTPyReW9sOH58
 ra397CXzc77Ouv4rQtjU61eJ0vfzcvNr1kBa7uKr43kPM8PCdV3if+mZ2m1d1R34
 Lp2hKQGOfUTpSkEDZoEYGawESn81K7cn5wI1WYt59coEw3Ftna4wwKHEo54ckpzI
 qa4EvGPdOzExZ0JqHGmyp80Pmf4AoTag5pdiFHASIV+XcYNT6W7/VIkWur7g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; t=1717105235; x=1717191635; bh=zOO8CPDWxlKIPemMisv5FLCnuDn3
 al+x1vHoHpc92wo=; b=Tsbf1AEeyY+t/lU7ZeBb9bMrm2pdj4o4dXHi6PnDnYKO
 wFvR2XggLJAE4DvW19OFJ72TmMkP636z5igL6LSnaZ2vTo9YK4dSolUfbIn0BUmJ
 oGAHh8LxeteV378GwdJ8+isOW4ltxiBxMsyFBIl7Yhrp39hJ2w4awnmucpFWt0Dh
 E4dtk8EJFNDLZOmCuqYTQchv2NOQJieAKDhuKAGZASXd1pmvBz8cczJRJT+npCpC
 UzkXvEt+hvlvX30ZEBsIx0ALcXotNtEoZWcxwDR2OF0Of4KZnB89OVWznCUctsiI
 6n9sOzmP3T0uzOFhdIVBMVudB0YHurPx50Kdn+VJTw==
X-ME-Sender: <xms:UvJYZpK7zaUJ2yzeoMC7zM8YT1yhSc6FAR-YauGFis9iUSDoHSH5tA>
 <xme:UvJYZlIlrD2FZnbQad6iSg565SAqUlgobcmPSDZ-8OJOXW9jhDyVxNUFque3cRtFY
 -k3qAL8igfuag>
X-ME-Received: <xmr:UvJYZhvoy2aUSawxsrwYhoXmkg_ovTv6VxQ1jea1GMAg1RQbDPfcHVh5Mtg6Ig19VIXCcbLeNP9rZifYqsAKWf1nQhBqrJyqkcKWtQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdekhecutefuodetggdotefrodftvfcurf
 hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr
 ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug
 hrpefhvfevufgjfhffkfggtgesmhdtreertddtjeenucfhrhhomheplfhoohhsthcumfhr
 vghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmheqnecugg
 ftrfgrthhtvghrnhepgfefueelvedutdetgefgudeuhfdtledvtedufffggfegteekkedt
 leeigffhjeetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh
 homhepjhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhm
X-ME-Proxy: <xmx:UvJYZqaBIZ-SbiHSkoBfuptsWGPoPe6Yi3ILCq4B69JeE1mj9zpBow>
 <xmx:UvJYZgYcC5HtSMuMOxSktObdslgtFsI8qjkaG6KzduRVv-ErK9bsIQ>
 <xmx:UvJYZuDuVkfp-qvhv8d-p681yL2tNLddJSXh1t-cvvnC6hrVTkqeLA>
 <xmx:UvJYZuaGvmM8wRvNiN22mG99kh-K0dQhChjoHiPObQ86h3NTGs9Bmw>
 <xmx:U_JYZvwhqFSkRerrIhXqLcSEROVUA2oVVDFuWLhWY-xuzzJ01rTnlz5d>
Feedback-ID: ie15541ac:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 30 May 2024 17:40:32 -0400 (EDT)
From: Joost Kremers <joostkremers@HIDDEN>
In-Reply-To: <86ikzstpyt.fsf@HIDDEN> (Joost Kremers's message of "Sun, 05
 May 2024 14:15:06 +0200")
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
 <86ikzstpyt.fsf@HIDDEN>
Date: Thu, 30 May 2024 23:40:29 +0200
Message-ID: <86sexz6ks2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi all,

>>>> Date: Wed, 28 Feb 2024 15:29:11 +0100
>>>> From: Eric Marsden <eric.marsden@HIDDEN>
>>>>=20
>>>> Hello,
>>>>=20
>>>> The following generates an error. It seems to me that it would be=20
>>>> preferable to insert the header line and show zero rows for the vtable.
>>>>=20
>>>>  =C2=A0=C2=A0 (require 'vtable)
>>>>  =C2=A0=C2=A0 (make-vtable :columns '("tweedle" "dum") :objects (list))
>>>>=20
>>>> Debugger entered--Lisp error: (wrong-number-of-arguments #<subr max> 0)
>>>>  =C2=A0 max()
>>>>  =C2=A0 apply(max nil)
>>>>  =C2=A0 seq-max(nil)

I did some work on fixing this, and would like to suggest the attached patc=
hes.
There are three, which I could also squash into a single patch if preferred=
, but
although related, they are conceptually separate, I think. They are:

0001-Allow-empty-vtable.patch

This fixes the problem that if `make-vtable` is called without any objects =
and
the widths of (some of) the columns aren't specified, `vtable--compute-widt=
hs`
would error out. With the patch, columns without an explicit width get assi=
gned
equal parts of the remaining window width.


0002-Fix-recomputing-of-vtable-column-alignment.patch

This one fixes what I believe to be another bug: `vtable--compute-columns`
should be able to recompute the columns, including setting the alignment
property. It didn't actually do the latter, though.


0003-Enable-inserting-new-objects-into-empty-vtable.patch

This patch makes it possible to insert an object into an empty vtable. It d=
oes
this by simply recreating and redisplaying the table, which I think makes t=
he
most sense.

Comments?

TIA

--=20
Joost Kremers
Life has its moments


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=0001-Allow-empty-vtable.patch

From 45a84160d5557ee2004fa7e045f52854b9c8e3c5 Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Thu, 30 May 2024 13:28:00 +0200
Subject: [PATCH 1/3] Allow empty vtable

* lisp/emacs-lisp/vtable.el (vtable--compute-widths): Set default width
  for columns that have no explicit width and no data.
---
 lisp/emacs-lisp/vtable.el | 67 ++++++++++++++++++++++++---------------
 1 file changed, 41 insertions(+), 26 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index cb7ea397314..07ef7d20020 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -850,32 +850,47 @@ vtable--compute-width
     (error "Invalid spec: %s" spec))))
 
 (defun vtable--compute-widths (table cache)
-  "Compute the display widths for TABLE."
-  (seq-into
-   (seq-map-indexed
-    (lambda (column index)
-      (let ((width
-             (or
-              ;; Explicit widths.
-              (and (vtable-column-width column)
-                   (vtable--compute-width table (vtable-column-width column)))
-              ;; Compute based on the displayed widths of
-              ;; the data.
-              (seq-max (seq-map (lambda (elem)
-                                  (nth 1 (elt (cdr elem) index)))
-                                cache)))))
-        ;; Let min-width/max-width specs have their say.
-        (when-let ((min-width (and (vtable-column-min-width column)
-                                   (vtable--compute-width
-                                    table (vtable-column-min-width column)))))
-          (setq width (max width min-width)))
-        (when-let ((max-width (and (vtable-column-max-width column)
-                                   (vtable--compute-width
-                                    table (vtable-column-max-width column)))))
-          (setq width (min width max-width)))
-        width))
-    (vtable-columns table))
-   'vector))
+  "Compute the display widths for TABLE.
+CACHE is TABLE's cache data as returned by `vtable--compute-cache'."
+  (let ((widths (seq-map-indexed
+                 (lambda (column index)
+                   (let ((width
+                          (or
+                           ;; Explicit widths.
+                           (and (vtable-column-width column)
+                                (vtable--compute-width table (vtable-column-width column)))
+                           ;; If the vtable is empty and no explicit width is given,
+                           ;; set its width to 0 and deal with it below.
+                           (if (null cache)
+                               0)
+                           ;; Otherwise, compute based on the displayed widths of the
+                           ;; data.
+                           (seq-max (seq-map (lambda (elem)
+                                               (nth 1 (elt (cdr elem) index)))
+                                             cache)))))
+                     ;; Let min-width/max-width specs have their say.
+                     (when-let ((min-width (and (vtable-column-min-width column)
+                                                (vtable--compute-width
+                                                 table (vtable-column-min-width column)))))
+                       (setq width (max width min-width)))
+                     (when-let ((max-width (and (vtable-column-max-width column)
+                                                (vtable--compute-width
+                                                 table (vtable-column-max-width column)))))
+                       (setq width (min width max-width)))
+                     width))
+                 (vtable-columns table))))
+    ;; If there are any zero-width columns, divide the remaining window
+    ;; width evenly over them.
+    (when (member 0 widths)
+      (let* ((combined-width (apply #'+ widths))
+             (n-0cols (length (seq-keep #'zerop widths)))
+             (default-width (/ (- (window-width nil t) combined-width) n-0cols)))
+        (setq widths (mapcar (lambda (width)
+                               (if (zerop width)
+                                   default-width
+                                 width))
+                             widths))))
+    (seq-into widths 'vector)))
 
 (defun vtable--compute-cache (table)
   (seq-map
-- 
2.45.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0002-Fix-recomputing-of-vtable-column-alignment.patch

From 34d179d791c10f1e7b8244542e4b59c58715ed47 Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Thu, 30 May 2024 23:17:37 +0200
Subject: [PATCH 2/3] Fix recomputing of vtable column alignment

* lisp/emacs-lisp/vtable.el (vtable--compute-columns): Store new
  alignment.
---
 lisp/emacs-lisp/vtable.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index 07ef7d20020..b97eaf0e3f3 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -485,11 +485,10 @@ vtable--compute-columns
     (seq-map-indexed
      (lambda (column index)
        ;; This is used when displaying.
-       (unless (vtable-column-align column)
-         (setf (vtable-column-align column)
-               (if (elt numerical index)
-                   'right
-                 'left)))
+       (setf (vtable-column-align column)
+             (if (elt numerical index)
+                 'right
+               'left))
        ;; This is used for sorting.
        (setf (vtable-column--numerical column)
              (elt numerical index))
-- 
2.45.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0003-Enable-inserting-new-objects-into-empty-vtable.patch

From 3c9a3dd95a7a82102bf721843ada3963144636fd Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Thu, 30 May 2024 23:20:00 +0200
Subject: [PATCH 3/3] Enable inserting new objects into empty vtable

* lisp/emacs-lisp/vtable.el (vtable-insert-object): If the vtable is
  empty, add the new object and recreate + redisplay the table.
---
 lisp/emacs-lisp/vtable.el | 151 +++++++++++++++++++-------------------
 1 file changed, 77 insertions(+), 74 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index b97eaf0e3f3..5d152d2d284 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -368,86 +368,89 @@ vtable-insert-object
 case.
 
 This also updates the displayed table."
-  ;; FIXME: Inserting an object into an empty vtable currently isn't
-  ;; possible. `nconc' fails silently (twice), and `setcar' on the cache
-  ;; raises an error.
+  ;; If the vtable is empty, just add the object and regenerate the
+  ;; table.
   (if (null (vtable-objects table))
-      (error "[vtable] Cannot insert object into empty vtable"))
-  ;; First insert into the objects.
-  (let ((pos (if location
-                 (if (integerp location)
-                     (prog1
-                         (nthcdr location (vtable-objects table))
-                       ;; Do not prepend if index is too large:
-                       (setq before nil))
-                   (or (memq location (vtable-objects table))
-                       ;; Prepend if `location' is not found and
-                       ;; `before' is non-nil:
-                       (and before (vtable-objects table))))
-               ;; If `location' is nil and `before' is non-nil, we
-               ;; prepend the new object.
-               (if before (vtable-objects table)))))
-    (if (or before  ; If `before' is non-nil, `pos' should be, as well.
-            (and pos (integerp location)))
-        ;; Add the new object before.
-        (let ((old-object (car pos)))
-          (setcar pos object)
-          (setcdr pos (cons old-object (cdr pos))))
-      ;; Otherwise, add the object after.
-      (if pos
-          ;; Splice the object into the list.
-          (setcdr pos (cons object (cdr pos)))
-        ;; Otherwise, append the object.
-        (nconc (vtable-objects table) (list object)))))
-  ;; Then adjust the cache and display.
-  (save-excursion
-    (vtable-goto-table table)
-    (let* ((cache (vtable--cache table))
-           (inhibit-read-only t)
-           (keymap (get-text-property (point) 'keymap))
-           (ellipsis (if (vtable-ellipsis table)
-                         (propertize (truncate-string-ellipsis)
-                                     'face (vtable-face table))
-                       ""))
-           (ellipsis-width (string-pixel-width ellipsis))
-           (elem (if location  ; This binding mirrors the binding of `pos' above.
-                     (if (integerp location)
-                         (nth location (car cache))
-                       (or (assq location (car cache))
-                           (and before (caar cache))))
-                   (if before (caar cache))))
-           (pos (memq elem (car cache)))
-           (line (cons object (vtable--compute-cached-line table object))))
-      (if (or before
+      (progn
+        (setf (vtable-objects table) (list object))
+        (vtable--recompute-numerical table (vtable--compute-cached-line table object))
+        (vtable-goto-table table)
+        (vtable-revert-command))
+    ;; First insert into the objects.
+    (let ((pos (if location
+                   (if (integerp location)
+                       (prog1
+                           (nthcdr location (vtable-objects table))
+                         ;; Do not prepend if index is too large:
+                         (setq before nil))
+                     (or (memq location (vtable-objects table))
+                         ;; Prepend if `location' is not found and
+                         ;; `before' is non-nil:
+                         (and before (vtable-objects table))))
+                 ;; If `location' is nil and `before' is non-nil, we
+                 ;; prepend the new object.
+                 (if before (vtable-objects table)))))
+      (if (or before  ; If `before' is non-nil, `pos' should be, as well.
               (and pos (integerp location)))
-          ;; Add the new object before:.
-          (let ((old-line (car pos)))
-            (setcar pos line)
-            (setcdr pos (cons old-line (cdr pos)))
-            (unless (vtable-goto-object (car elem))
-              (vtable-beginning-of-table)))
+          ;; Add the new object before.
+          (let ((old-object (car pos)))
+            (setcar pos object)
+            (setcdr pos (cons old-object (cdr pos))))
         ;; Otherwise, add the object after.
         (if pos
             ;; Splice the object into the list.
-            (progn
-              (setcdr pos (cons line (cdr pos)))
-              (if (vtable-goto-object location)
-                  (forward-line 1)  ; Insert *after*.
-                (vtable-end-of-table)))
+            (setcdr pos (cons object (cdr pos)))
           ;; Otherwise, append the object.
-          (setcar cache (nconc (car cache) (list line)))
-          (vtable-end-of-table)))
-      (let ((start (point)))
-        ;; FIXME: We have to adjust colors in lines below this if we
-        ;; have :row-colors.
-        (vtable--insert-line table line 0
-                             (nth 1 cache) (vtable--spacer table)
-                             ellipsis ellipsis-width)
-        (add-text-properties start (point) (list 'keymap keymap
-                                                 'vtable table)))
-      ;; We may have inserted a non-numerical value into a previously
-      ;; all-numerical table, so recompute.
-      (vtable--recompute-numerical table (cdr line)))))
+          (nconc (vtable-objects table) (list object)))))
+    ;; Then adjust the cache and display.
+    (save-excursion
+      (vtable-goto-table table)
+      (let* ((cache (vtable--cache table))
+             (inhibit-read-only t)
+             (keymap (get-text-property (point) 'keymap))
+             (ellipsis (if (vtable-ellipsis table)
+                           (propertize (truncate-string-ellipsis)
+                                       'face (vtable-face table))
+                         ""))
+             (ellipsis-width (string-pixel-width ellipsis))
+             (elem (if location  ; This binding mirrors the binding of `pos' above.
+                       (if (integerp location)
+                           (nth location (car cache))
+                         (or (assq location (car cache))
+                             (and before (caar cache))))
+                     (if before (caar cache))))
+             (pos (memq elem (car cache)))
+             (line (cons object (vtable--compute-cached-line table object))))
+        (if (or before
+                (and pos (integerp location)))
+            ;; Add the new object before:.
+            (let ((old-line (car pos)))
+              (setcar pos line)
+              (setcdr pos (cons old-line (cdr pos)))
+              (unless (vtable-goto-object (car elem))
+                (vtable-beginning-of-table)))
+          ;; Otherwise, add the object after.
+          (if pos
+              ;; Splice the object into the list.
+              (progn
+                (setcdr pos (cons line (cdr pos)))
+                (if (vtable-goto-object location)
+                    (forward-line 1)  ; Insert *after*.
+                  (vtable-end-of-table)))
+            ;; Otherwise, append the object.
+            (setcar cache (nconc (car cache) (list line)))
+            (vtable-end-of-table)))
+        (let ((start (point)))
+          ;; FIXME: We have to adjust colors in lines below this if we
+          ;; have :row-colors.
+          (vtable--insert-line table line 0
+                               (nth 1 cache) (vtable--spacer table)
+                               ellipsis ellipsis-width)
+          (add-text-properties start (point) (list 'keymap keymap
+                                                   'vtable table)))
+        ;; We may have inserted a non-numerical value into a previously
+        ;; all-numerical table, so recompute.
+        (vtable--recompute-numerical table (cdr line))))))
 
 (defun vtable-column (table index)
   "Return the name of the INDEXth column in TABLE."
-- 
2.45.1


--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Joost Kremers <joostkremers@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 May 2024 21:53:02 +0000
Resent-Message-ID: <handler.69454.B69454.17171059645038 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Adam Porter <adam@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>, 69454 <at> debbugs.gnu.org, Eric Marsden <eric.marsden@HIDDEN>
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.17171059645038
          (code B ref 69454); Thu, 30 May 2024 21:53:02 +0000
Received: (at 69454) by debbugs.gnu.org; 30 May 2024 21:52:44 +0000
Received: from localhost ([127.0.0.1]:52698 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sCnhT-0001JC-Sj
	for submit <at> debbugs.gnu.org; Thu, 30 May 2024 17:52:44 -0400
Received: from fhigh3-smtp.messagingengine.com ([103.168.172.154]:43607)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joostkremers@HIDDEN>) id 1sCnhR-0001Iz-6c
 for 69454 <at> debbugs.gnu.org; Thu, 30 May 2024 17:52:41 -0400
Received: from compute7.internal (compute7.nyi.internal [10.202.2.48])
 by mailfhigh.nyi.internal (Postfix) with ESMTP id 0872B11400FD;
 Thu, 30 May 2024 17:52:25 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute7.internal (MEProxy); Thu, 30 May 2024 17:52:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 cc:cc:content-type:content-type:date:date:from:from:in-reply-to
 :in-reply-to:message-id:mime-version:references:reply-to:subject
 :subject:to:to; s=fm1; t=1717105945; x=1717192345; bh=GsO1+AmZf0
 NRjm5UMME9oqL+xm4kZgcCcP1IW9ddUME=; b=I5jlkSmynp8Bnhpd+sExknoZC0
 aTaDXFBQ/jptO1i6vo94ffLW3WNezOIzgw68ENnLtvqWLa9nr/85t/AnQ5uqWUTs
 9Dc5V/3Y8mmW+FmNgCukNpzS7WgKBYl7IwQgJbLdKZssf5QGo1lK8Sh1WvOkzS0V
 CEO5UtRHA0TklgDvArr1Su3TWJS2aQzAilRU5jM9GnH85B2IapqE16mYLy4DF4Iw
 d1o7Vk8Z1vSWbyaP0SQTznt0uzsE8o7xQ2mwRsKTdNhm21UHvZdZ3N4jaZj1d36A
 38Nm1X7e1swpgOKny9d1+GUEztuZZ2W/HAVtbbFrhuqd3J3BHyTUej2+HBgQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; t=1717105945; x=1717192345; bh=GsO1+AmZf0NRjm5UMME9oqL+xm4k
 ZgcCcP1IW9ddUME=; b=F4sUxHXGeQ9Rgc52j5gXxqkOQSIBG9FrEo29U49LZE1N
 0bb8VRxwKHU7/7G4y9/hsd+FBEJb+x2klbTMa6yC6kQPthy79rN37lGfjDHs3af7
 5TmTQMoedwGvEr4ZfM3gWiZep16MqrGSbqZEcdneQi3IQwIhxKBE9AwFIcrrtR9c
 ubis3HpRl8p17REpjvSYTifJ8oD7hejDbPMJru5wL0ClA8jt8wDevsClPxHMbRI1
 EQ/Qpa4TBHavfRdyPaj4H9mz5V/1ygjAIPKYDcyYodkeGytRGxWPGZyTecdClICd
 magD5Pr+JJq3B097XoWqmP6nQNfJJMmIQkircRzdmw==
X-ME-Sender: <xms:GPVYZnMOuTYVmYfrqazyIJfcpolJnT1mWGB2yrgs2cQPo9veBGN2Bg>
 <xme:GPVYZh-VwOPQfIWeAcMouw4lGI-bmZYBwzzpp_zCpp0qZ_M16LVaXek004KQ5AueK
 hbi5g0vnjHVmA>
X-ME-Received: <xmr:GPVYZmSw7VDUOA-lFTfQzl4DZJI8Bpzyv1MfvQdgeRs_L47KbkvIIfWGUNRX6A16KLjzucFptnTJGT5lKppdObwuSPwKaUlrey5vew>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdekhedgtddvucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpeflohhoshht
 ucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhmqe
 enucggtffrrghtthgvrhhnpeekveelieeuleettdefueegvddukefhgeevleduveeileet
 keeggfekhfeuffffieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih
 hlfhhrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh
X-ME-Proxy: <xmx:GPVYZrtewZqasKG6qAQRqE1C-59FvyMGKUjg1hNdo2eWtoEeoszJjw>
 <xmx:GPVYZvcbGVpfVIY9G-KEdBgjDezrrbVNyYT17dtzhdIBqYdmwDZJBw>
 <xmx:GPVYZn1ua2YPsn8zXZ4Kskt9Ew49U1GPIoTfBhdJ4ZdBbgX6Yn6OmA>
 <xmx:GPVYZr_q29TBlXah0NqXB6QNFbe-FwSnyWAPYa9rxeMvIqZlsMMIXA>
 <xmx:GfVYZgGDela6_Bn-uCdJcYL0Sx4OeG8fR_bvajQqDi4O1WiXeoK91KCt>
Feedback-ID: ie15541ac:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 30 May 2024 17:52:22 -0400 (EDT)
From: Joost Kremers <joostkremers@HIDDEN>
In-Reply-To: <86sexz6ks2.fsf@HIDDEN> (Joost Kremers's message of "Thu, 30
 May 2024 23:40:29 +0200")
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
 <86ikzstpyt.fsf@HIDDEN> <86sexz6ks2.fsf@HIDDEN>
Date: Thu, 30 May 2024 23:52:20 +0200
Message-ID: <86ed9j6k8b.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Thu, May 30 2024, Joost Kremers wrote:
> 0002-Fix-recomputing-of-vtable-column-alignment.patch
>
> This one fixes what I believe to be another bug: `vtable--compute-columns`
> should be able to recompute the columns, including setting the alignment
> property. It didn't actually do the latter, though.

Actually, forget about this one. I just realised that `vtable--compute-columns`
doesn't override the alignment property because it may have been set explicitly
in `make-vtable`. The actual problem is that if a table is created without data,
the alignment property of each column is set to `right`, even though there's no
reason to do so.

I'll try and come up with a better patch.


-- 
Joost Kremers
Life has its moments




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 May 2024 05:28:01 +0000
Resent-Message-ID: <handler.69454.B69454.171713322922994 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Joost Kremers <joostkremers@HIDDEN>
Cc: adam@HIDDEN, larsi@HIDDEN, 69454 <at> debbugs.gnu.org, eric.marsden@HIDDEN
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171713322922994
          (code B ref 69454); Fri, 31 May 2024 05:28:01 +0000
Received: (at 69454) by debbugs.gnu.org; 31 May 2024 05:27:09 +0000
Received: from localhost ([127.0.0.1]:52968 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sCunF-0005yn-Cm
	for submit <at> debbugs.gnu.org; Fri, 31 May 2024 01:27:09 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46814)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sCunB-0005yG-34
 for 69454 <at> debbugs.gnu.org; Fri, 31 May 2024 01:27:07 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sCukn-0005zR-7O; Fri, 31 May 2024 01:24:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=/F+4ZPjuABPhiKfdAhkiVVQlV/x7B1hrLYwtUInHYo0=; b=Xj7IMmwN0TrA
 d7QgGxbQQK71i6Rs9RzvElNKJAvYC1149kAT/oAMKPSC0127BNLA1nRyZCJHSYzWVWUgJUTUeqWDU
 oBZbDOBNA1+NbaxtubDnEMHixB3ZKdl8Xm21523vQRrBbLjS45unOsmQCAtTSvchqDCLr5Wl/Ef6e
 gnDqaT5J6RBYTYo89x+BSL2r6SG+wkARhFdhm6TndddO8t4z2OdwDyU5ZH9VqupEWQmsIMBDQkLy5
 Qc57M2zQYy905YpLOJC33mHs6F1jYTaSyu3SfOHH9vsMbGxLsK6AgAJnfYI+cyymaI7uWbO6DMN6s
 N0CxfGFZIglnVo/bqTcRug==;
Date: Fri, 31 May 2024 08:24:33 +0300
Message-Id: <864jaer1ta.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <86ed9j6k8b.fsf@HIDDEN> (message from Joost Kremers on Thu, 
 30 May 2024 23:52:20 +0200)
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
 <86ikzstpyt.fsf@HIDDEN> <86sexz6ks2.fsf@HIDDEN>
 <86ed9j6k8b.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Joost Kremers <joostkremers@HIDDEN>
> Cc: Adam Porter <adam@HIDDEN>,  Lars Ingebrigtsen <larsi@HIDDEN>,
>   69454 <at> debbugs.gnu.org,  Eric Marsden <eric.marsden@HIDDEN>
> Date: Thu, 30 May 2024 23:52:20 +0200
> 
> On Thu, May 30 2024, Joost Kremers wrote:
> > 0002-Fix-recomputing-of-vtable-column-alignment.patch
> >
> > This one fixes what I believe to be another bug: `vtable--compute-columns`
> > should be able to recompute the columns, including setting the alignment
> > property. It didn't actually do the latter, though.
> 
> Actually, forget about this one. I just realised that `vtable--compute-columns`
> doesn't override the alignment property because it may have been set explicitly
> in `make-vtable`. The actual problem is that if a table is created without data,
> the alignment property of each column is set to `right`, even though there's no
> reason to do so.
> 
> I'll try and come up with a better patch.

Thanks for working on this.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Joost Kremers <joostkremers@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 May 2024 06:56:02 +0000
Resent-Message-ID: <handler.69454.B69454.171713851131429 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: adam@HIDDEN, larsi@HIDDEN, 69454 <at> debbugs.gnu.org, eric.marsden@HIDDEN
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171713851131429
          (code B ref 69454); Fri, 31 May 2024 06:56:02 +0000
Received: (at 69454) by debbugs.gnu.org; 31 May 2024 06:55:11 +0000
Received: from localhost ([127.0.0.1]:53045 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sCwAQ-0008Aq-Gs
	for submit <at> debbugs.gnu.org; Fri, 31 May 2024 02:55:11 -0400
Received: from fout2-smtp.messagingengine.com ([103.168.172.145]:37221)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joostkremers@HIDDEN>) id 1sCwAD-0008A1-8q
 for 69454 <at> debbugs.gnu.org; Fri, 31 May 2024 02:55:08 -0400
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailfout.nyi.internal (Postfix) with ESMTP id 35CCF1380153;
 Fri, 31 May 2024 02:54:41 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute1.internal (MEProxy); Fri, 31 May 2024 02:54:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 cc:cc:content-type:content-type:date:date:from:from:in-reply-to
 :in-reply-to:message-id:mime-version:references:reply-to:subject
 :subject:to:to; s=fm1; t=1717138481; x=1717224881; bh=bvt0XagNOK
 cu1JKvTmsFhMTk0UnuWTO1QfO3X/nLqNM=; b=5NkqcU66I2IApRk7eQsfdt+tcY
 d+YRMFLxGvjJ2zpaubbxTq0z5PiZbMFpIPLPgVfRKrUeM0b7Xt5/aHjY1hYsnXx5
 HlW1ZPr5U8SOCRhGhbM4fxExb6jGLJ5aghCPdS2ZfVeCzBOsxzNBH8pk5EU0aSaw
 EOmJzA5Fegmby0RDC/pm+RhD6KyXR0U6OIbXvIJzvzF8QrEH2txt12SQ3YmuCtvE
 bbTPWChBWOZiwlS5MiCEyi/r+gbTlSPt6Um1YIM4BOAyL97ghbQkZl074fscnK0q
 wu1kYTAYHwrEd6edOUYSxXOa2kiyFNodW2e1K9Zqd0Jlk+RC6ZZB9H9/2ycA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; t=1717138481; x=1717224881; bh=bvt0XagNOKcu1JKvTmsFhMTk0Unu
 WTO1QfO3X/nLqNM=; b=oGns2h7ouWY7wW+ESJoL+zte0sGIigz7gtUXVWlEgIju
 +fxAKeFpxNLM74T6eCnqS0E0wuzpe8Z4CuhKrFGjpd+F5j0TaZnVbPrANIEtLq5W
 mYuMJR6gM9gHzqA2BH+6Wvfg9ept40QJ2KfxJlpVM+DDJ90bEAoJby6y4bAgjobm
 aFIY2RwPTyhk9POsTs8T/9KVK8YxJ25IQOrJ8U2ENFPt/o47JKd/uvVue8ZlPFzq
 8Lol19uvLhk8e08WkrZXLWXwakZ1hQTayCsqLbsYnrHmQYyeQL4jJ7cwukXFYpSz
 RS1DS0y8xEHdgiLEImxPalucjGM7lISxuLMzx51RCg==
X-ME-Sender: <xms:MHRZZpPYqNDzjI2N1z2Bx8W_cc5FRivDMONIaBC4B8v84HzMpZ0lLw>
 <xme:MHRZZr9k8vNfwYTKtst8TPzke_vjCeXfZUo3aoOLk__D1UZ9hKvIk2gLC7mGRKgh0
 MyuQu8cErFABw>
X-ME-Received: <xmr:MHRZZoTXLB6dmt3ruhfGGM8IvafLGQJ-6qOetFn4HhnQ68x5rV2k606VhOLSDbDRosvknKu-CJH4NcN67MgAhYJnv1SaWIhMFSeMdw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdekhedguddutdcutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd
 enucfjughrpefhvfevufgjfhffkfggtgesmhdtreertddttdenucfhrhhomheplfhoohhs
 thcumfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh
 eqnecuggftrfgrthhtvghrnhepvdeuudfghfdtvedttdelvdeludelheehfeevfffgvdeh
 jedvieeiveekjeeikefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg
 hilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhm
X-ME-Proxy: <xmx:MHRZZlvHS43fR7n2HjlzctN5P26nzaST0tYBYRJJ66jnxA70OANImg>
 <xmx:MHRZZhdohyxBZjsFrbHdjVo9u3YTahSL2sH8PYbB6rXnKDiMEQZh4w>
 <xmx:MHRZZh2YRgVSDodykY2Gacyuo_GMwTt1HeZO0C3duqmrUJJ1_93eKQ>
 <xmx:MHRZZt9jEn8m2vOzito8_bgSxwjgEZmadOLyFR0tAJc56y1KSUFTRw>
 <xmx:MXRZZqGJ-hpYDUQQcbJkn4u4nnuTKZvWjFA-Z6GasiP6nxKu1pvlEyhp>
Feedback-ID: ie15541ac:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 31 May 2024 02:54:38 -0400 (EDT)
From: Joost Kremers <joostkremers@HIDDEN>
In-Reply-To: <864jaer1ta.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 31 May
 2024 08:24:33 +0300")
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
 <86ikzstpyt.fsf@HIDDEN> <86sexz6ks2.fsf@HIDDEN>
 <86ed9j6k8b.fsf@HIDDEN> <864jaer1ta.fsf@HIDDEN>
Date: Fri, 31 May 2024 08:54:33 +0200
Message-ID: <861q5i4gk6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

>> From: Joost Kremers <joostkremers@HIDDEN>
>> Actually, forget about this one. I just realised that
>> `vtable--compute-columns` doesn't override the alignment property because it
>> may have been set explicitly in `make-vtable`. The actual problem is that if
>> a table is created without data, the alignment property of each column is set
>> to `right`, even though there's no reason to do so.

Actually, that's not entirely true. The problem was that once the 'align'
property was set, it could not be changed anymore. ('vtable-insert-object'
assumed that it could, though.) The new patch makes this possible, but only if
'align' wasn't set explicitly in the call to 'make-vtable'.

I'm including all three patches here, even though two of them haven't changed:

0001-Allow-empty-vtable.patch : same as before

0002-Enable-inserting-new-objects-into-empty-vtable.patch : same as before
(though it was 0003 then)

0003-vtable-allow-resetting-column-alignment-when-table-d.patch : new, as
described above.

I haven't updated the documentation yet nor did I add a NEWS entry, because I
first wanted to make sure you agree with the direction of this patch: Adam
suggested empty vtables should not be allowed, but this patch explicitly allows
them.

Thanks,

Joost


-- 
Joost Kremers
Life has its moments



--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=0001-Allow-empty-vtable.patch

From 45a84160d5557ee2004fa7e045f52854b9c8e3c5 Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Thu, 30 May 2024 13:28:00 +0200
Subject: [PATCH 1/3] Allow empty vtable

* lisp/emacs-lisp/vtable.el (vtable--compute-widths): Set default width
  for columns that have no explicit width and no data.
---
 lisp/emacs-lisp/vtable.el | 67 ++++++++++++++++++++++++---------------
 1 file changed, 41 insertions(+), 26 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index cb7ea397314..07ef7d20020 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -850,32 +850,47 @@ vtable--compute-width
     (error "Invalid spec: %s" spec))))
 
 (defun vtable--compute-widths (table cache)
-  "Compute the display widths for TABLE."
-  (seq-into
-   (seq-map-indexed
-    (lambda (column index)
-      (let ((width
-             (or
-              ;; Explicit widths.
-              (and (vtable-column-width column)
-                   (vtable--compute-width table (vtable-column-width column)))
-              ;; Compute based on the displayed widths of
-              ;; the data.
-              (seq-max (seq-map (lambda (elem)
-                                  (nth 1 (elt (cdr elem) index)))
-                                cache)))))
-        ;; Let min-width/max-width specs have their say.
-        (when-let ((min-width (and (vtable-column-min-width column)
-                                   (vtable--compute-width
-                                    table (vtable-column-min-width column)))))
-          (setq width (max width min-width)))
-        (when-let ((max-width (and (vtable-column-max-width column)
-                                   (vtable--compute-width
-                                    table (vtable-column-max-width column)))))
-          (setq width (min width max-width)))
-        width))
-    (vtable-columns table))
-   'vector))
+  "Compute the display widths for TABLE.
+CACHE is TABLE's cache data as returned by `vtable--compute-cache'."
+  (let ((widths (seq-map-indexed
+                 (lambda (column index)
+                   (let ((width
+                          (or
+                           ;; Explicit widths.
+                           (and (vtable-column-width column)
+                                (vtable--compute-width table (vtable-column-width column)))
+                           ;; If the vtable is empty and no explicit width is given,
+                           ;; set its width to 0 and deal with it below.
+                           (if (null cache)
+                               0)
+                           ;; Otherwise, compute based on the displayed widths of the
+                           ;; data.
+                           (seq-max (seq-map (lambda (elem)
+                                               (nth 1 (elt (cdr elem) index)))
+                                             cache)))))
+                     ;; Let min-width/max-width specs have their say.
+                     (when-let ((min-width (and (vtable-column-min-width column)
+                                                (vtable--compute-width
+                                                 table (vtable-column-min-width column)))))
+                       (setq width (max width min-width)))
+                     (when-let ((max-width (and (vtable-column-max-width column)
+                                                (vtable--compute-width
+                                                 table (vtable-column-max-width column)))))
+                       (setq width (min width max-width)))
+                     width))
+                 (vtable-columns table))))
+    ;; If there are any zero-width columns, divide the remaining window
+    ;; width evenly over them.
+    (when (member 0 widths)
+      (let* ((combined-width (apply #'+ widths))
+             (n-0cols (length (seq-keep #'zerop widths)))
+             (default-width (/ (- (window-width nil t) combined-width) n-0cols)))
+        (setq widths (mapcar (lambda (width)
+                               (if (zerop width)
+                                   default-width
+                                 width))
+                             widths))))
+    (seq-into widths 'vector)))
 
 (defun vtable--compute-cache (table)
   (seq-map
-- 
2.45.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0002-Enable-inserting-new-objects-into-empty-vtable.patch

From 734ea02bc4dc90d29f94f595271bff40f05b7752 Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Thu, 30 May 2024 23:20:00 +0200
Subject: [PATCH 2/3] Enable inserting new objects into empty vtable

* lisp/emacs-lisp/vtable.el (vtable-insert-object): If the vtable is
  empty, add the new object and recreate + redisplay the table.
---
 lisp/emacs-lisp/vtable.el | 151 +++++++++++++++++++-------------------
 1 file changed, 77 insertions(+), 74 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index 07ef7d20020..c86ae7f0955 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -368,86 +368,89 @@ vtable-insert-object
 case.
 
 This also updates the displayed table."
-  ;; FIXME: Inserting an object into an empty vtable currently isn't
-  ;; possible. `nconc' fails silently (twice), and `setcar' on the cache
-  ;; raises an error.
+  ;; If the vtable is empty, just add the object and regenerate the
+  ;; table.
   (if (null (vtable-objects table))
-      (error "[vtable] Cannot insert object into empty vtable"))
-  ;; First insert into the objects.
-  (let ((pos (if location
-                 (if (integerp location)
-                     (prog1
-                         (nthcdr location (vtable-objects table))
-                       ;; Do not prepend if index is too large:
-                       (setq before nil))
-                   (or (memq location (vtable-objects table))
-                       ;; Prepend if `location' is not found and
-                       ;; `before' is non-nil:
-                       (and before (vtable-objects table))))
-               ;; If `location' is nil and `before' is non-nil, we
-               ;; prepend the new object.
-               (if before (vtable-objects table)))))
-    (if (or before  ; If `before' is non-nil, `pos' should be, as well.
-            (and pos (integerp location)))
-        ;; Add the new object before.
-        (let ((old-object (car pos)))
-          (setcar pos object)
-          (setcdr pos (cons old-object (cdr pos))))
-      ;; Otherwise, add the object after.
-      (if pos
-          ;; Splice the object into the list.
-          (setcdr pos (cons object (cdr pos)))
-        ;; Otherwise, append the object.
-        (nconc (vtable-objects table) (list object)))))
-  ;; Then adjust the cache and display.
-  (save-excursion
-    (vtable-goto-table table)
-    (let* ((cache (vtable--cache table))
-           (inhibit-read-only t)
-           (keymap (get-text-property (point) 'keymap))
-           (ellipsis (if (vtable-ellipsis table)
-                         (propertize (truncate-string-ellipsis)
-                                     'face (vtable-face table))
-                       ""))
-           (ellipsis-width (string-pixel-width ellipsis))
-           (elem (if location  ; This binding mirrors the binding of `pos' above.
-                     (if (integerp location)
-                         (nth location (car cache))
-                       (or (assq location (car cache))
-                           (and before (caar cache))))
-                   (if before (caar cache))))
-           (pos (memq elem (car cache)))
-           (line (cons object (vtable--compute-cached-line table object))))
-      (if (or before
+      (progn
+        (setf (vtable-objects table) (list object))
+        (vtable--recompute-numerical table (vtable--compute-cached-line table object))
+        (vtable-goto-table table)
+        (vtable-revert-command))
+    ;; First insert into the objects.
+    (let ((pos (if location
+                   (if (integerp location)
+                       (prog1
+                           (nthcdr location (vtable-objects table))
+                         ;; Do not prepend if index is too large:
+                         (setq before nil))
+                     (or (memq location (vtable-objects table))
+                         ;; Prepend if `location' is not found and
+                         ;; `before' is non-nil:
+                         (and before (vtable-objects table))))
+                 ;; If `location' is nil and `before' is non-nil, we
+                 ;; prepend the new object.
+                 (if before (vtable-objects table)))))
+      (if (or before  ; If `before' is non-nil, `pos' should be, as well.
               (and pos (integerp location)))
-          ;; Add the new object before:.
-          (let ((old-line (car pos)))
-            (setcar pos line)
-            (setcdr pos (cons old-line (cdr pos)))
-            (unless (vtable-goto-object (car elem))
-              (vtable-beginning-of-table)))
+          ;; Add the new object before.
+          (let ((old-object (car pos)))
+            (setcar pos object)
+            (setcdr pos (cons old-object (cdr pos))))
         ;; Otherwise, add the object after.
         (if pos
             ;; Splice the object into the list.
-            (progn
-              (setcdr pos (cons line (cdr pos)))
-              (if (vtable-goto-object location)
-                  (forward-line 1)  ; Insert *after*.
-                (vtable-end-of-table)))
+            (setcdr pos (cons object (cdr pos)))
           ;; Otherwise, append the object.
-          (setcar cache (nconc (car cache) (list line)))
-          (vtable-end-of-table)))
-      (let ((start (point)))
-        ;; FIXME: We have to adjust colors in lines below this if we
-        ;; have :row-colors.
-        (vtable--insert-line table line 0
-                             (nth 1 cache) (vtable--spacer table)
-                             ellipsis ellipsis-width)
-        (add-text-properties start (point) (list 'keymap keymap
-                                                 'vtable table)))
-      ;; We may have inserted a non-numerical value into a previously
-      ;; all-numerical table, so recompute.
-      (vtable--recompute-numerical table (cdr line)))))
+          (nconc (vtable-objects table) (list object)))))
+    ;; Then adjust the cache and display.
+    (save-excursion
+      (vtable-goto-table table)
+      (let* ((cache (vtable--cache table))
+             (inhibit-read-only t)
+             (keymap (get-text-property (point) 'keymap))
+             (ellipsis (if (vtable-ellipsis table)
+                           (propertize (truncate-string-ellipsis)
+                                       'face (vtable-face table))
+                         ""))
+             (ellipsis-width (string-pixel-width ellipsis))
+             (elem (if location  ; This binding mirrors the binding of `pos' above.
+                       (if (integerp location)
+                           (nth location (car cache))
+                         (or (assq location (car cache))
+                             (and before (caar cache))))
+                     (if before (caar cache))))
+             (pos (memq elem (car cache)))
+             (line (cons object (vtable--compute-cached-line table object))))
+        (if (or before
+                (and pos (integerp location)))
+            ;; Add the new object before:.
+            (let ((old-line (car pos)))
+              (setcar pos line)
+              (setcdr pos (cons old-line (cdr pos)))
+              (unless (vtable-goto-object (car elem))
+                (vtable-beginning-of-table)))
+          ;; Otherwise, add the object after.
+          (if pos
+              ;; Splice the object into the list.
+              (progn
+                (setcdr pos (cons line (cdr pos)))
+                (if (vtable-goto-object location)
+                    (forward-line 1)  ; Insert *after*.
+                  (vtable-end-of-table)))
+            ;; Otherwise, append the object.
+            (setcar cache (nconc (car cache) (list line)))
+            (vtable-end-of-table)))
+        (let ((start (point)))
+          ;; FIXME: We have to adjust colors in lines below this if we
+          ;; have :row-colors.
+          (vtable--insert-line table line 0
+                               (nth 1 cache) (vtable--spacer table)
+                               ellipsis ellipsis-width)
+          (add-text-properties start (point) (list 'keymap keymap
+                                                   'vtable table)))
+        ;; We may have inserted a non-numerical value into a previously
+        ;; all-numerical table, so recompute.
+        (vtable--recompute-numerical table (cdr line))))))
 
 (defun vtable-column (table index)
   "Return the name of the INDEXth column in TABLE."
-- 
2.45.1


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0003-vtable-allow-resetting-column-alignment-when-table-d.patch

From df8588c0cf589190900edda3a0082c0ac7ad0b74 Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Fri, 31 May 2024 01:38:54 +0200
Subject: [PATCH 3/3] vtable: allow resetting column alignment when table data
 changes

* lisp/emacs-lisp/vtable.el (vtable--compute-columns): if a column was
  not created with an explicit 'align' property, allow changing this
  property when the column data changes from numeric to non-numeric (or
  vice versa). This makes it possible to add data to an empty table,
  because in a table without data all columns are assumed to be numeric
  and right-aligned.
---
 lisp/emacs-lisp/vtable.el | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index c86ae7f0955..3e9f5214db0 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -45,7 +45,8 @@ vtable-column
   getter
   formatter
   displayer
-  -numerical)
+  -numerical
+  -aligned)
 
 (defclass vtable ()
   ((columns :initarg :columns :accessor vtable-columns)
@@ -473,7 +474,17 @@ vtable--get-value
    (t
     (elt object index))))
 
-(defun vtable--compute-columns (table)
+(defun vtable--compute-columns (table &optional recompute)
+  "Compute column specs for TABLE.
+Set the `align', `-aligned' and `-numerical' properties of each column.
+If the column contains only numerical data, set `-numerical' to t,
+otherwise to nil.  `-aligned' indicates whether the column has an
+`align' property set by the user.  If it does, `align' is not touched,
+otherwise it is set to `right' for numeric columns and to `left' for
+non-numeric columns.
+
+If RECOMPUTE is non-nil, do not set `-aligned'.  This can be used to
+recompute the column specs when the table data has changed."
   (let ((numerical (make-vector (length (vtable-columns table)) t))
         (columns (vtable-columns table)))
     ;; First determine whether there are any all-numerical columns.
@@ -484,11 +495,16 @@ vtable--compute-columns
                                              table))
            (setf (elt numerical index) nil)))
        (vtable-columns table)))
+    ;; Check if any columns have an explicit `align' property.
+    (unless recompute
+      (dolist (column (vtable-columns table))
+        (if (vtable-column-align column)
+            (setf (vtable-column--aligned column) t))))
     ;; Then fill in defaults.
     (seq-map-indexed
      (lambda (column index)
        ;; This is used when displaying.
-       (unless (vtable-column-align column)
+       (unless (vtable-column--aligned column)
          (setf (vtable-column-align column)
                (if (elt numerical index)
                    'right
@@ -813,7 +829,7 @@ vtable--recompute-numerical
          (setq recompute t)))
      line)
     (when recompute
-      (vtable--compute-columns table))))
+      (vtable--compute-columns table t))))
 
 (defun vtable--set-header-line (table widths spacer)
   (setq header-line-format
-- 
2.45.1


--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Adam Porter <adam@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 02 Jun 2024 17:51:02 +0000
Resent-Message-ID: <handler.69454.B69454.171735061623479 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Joost Kremers <joostkremers@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Cc: larsi@HIDDEN, 69454 <at> debbugs.gnu.org, eric.marsden@HIDDEN
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171735061623479
          (code B ref 69454); Sun, 02 Jun 2024 17:51:02 +0000
Received: (at 69454) by debbugs.gnu.org; 2 Jun 2024 17:50:16 +0000
Received: from localhost ([127.0.0.1]:60237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sDpLT-00066c-Kz
	for submit <at> debbugs.gnu.org; Sun, 02 Jun 2024 13:50:15 -0400
Received: from basenji.birch.relay.mailchannels.net ([23.83.209.12]:2507)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <adam@HIDDEN>) id 1sDpLN-00066M-Ea
 for 69454 <at> debbugs.gnu.org; Sun, 02 Jun 2024 13:50:14 -0400
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 4F1B8C0369;
 Sun,  2 Jun 2024 17:49:55 +0000 (UTC)
Received: from pdx1-sub0-mail-a292.dreamhost.com (unknown [127.0.0.6])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id CF413C3CA6;
 Sun,  2 Jun 2024 17:49:54 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1717350594; a=rsa-sha256;
 cv=none;
 b=yJxqjqoRlOc6t6h9kioB2Mo/p5D9Cc3/fDZ7izwpoGMHZIlrfuVqpbgB6UbPKnhGqgsBUN
 zTUjjY9rd7vq42EIsATVeoNImGo5idPzMv2HxjDHmCZS/acPWKRJIvGUZnySeMrsC7eU0p
 I8EB5ugXtDuNAIkC43s1jCccezVFsY/i42QtNXAeTj1jyCmav9yfjsvhH6bIg12Emo61Cp
 jpOH3ACOM0WE20VVunDjz8ApM0VpfO0RsN6M6pf6i3d1blMW2nANnvE/ucmoWXhysWMTjN
 7M0y1d+JqoA4ArJpY2C/f2DiqJqs4ewvo+Jk2sbQ1Hpg1aWxA/PNsrwHBWyT6g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1717350594;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=drfbS1GciLueHRqDFDr+ILuIh+0/nsZqLnn90xPUCas=;
 b=dE+aA7VWuVPNgvqtUyN8mJoQ3ViRkys9Abz7S074x4mDb8z4OXiTmIF4wH5WluBqBbdmGI
 VLbK2Imo4Wtlxk5jqHxAe7Lmw8gti5qwh2FliS+qYyYzjWvFLnytg0kzU2648YE3tDH5ID
 ORdLBBnIEfRI9Pb0ApUq+r1TT1Tr3nLAWfEn0Wiv87VpIgDzbPNOYdO80W0yinA0+AoIc/
 qUDpkfjv+dS1nOrduCmEvQF2vPT+y2tF6eMPpjzJsy3TmrdovtU1IJtwum7F8ACy8ViH62
 uk9sxWcmiqepNdv2LJF6YaijyrrnXHGdIvRsyCEPSTQ+Nsgm2NTY9brzGJ9njQ==
ARC-Authentication-Results: i=1; rspamd-7f76976655-79jnx;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@HIDDEN
X-Sender-Id: dreamhost|x-authsender|adam@HIDDEN
X-MC-Relay: Junk
X-MailChannels-SenderId: dreamhost|x-authsender|adam@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Relation-Obese: 15537db91a591597_1717350595094_3931293451
X-MC-Loop-Signature: 1717350595094:2210517779
X-MC-Ingress-Time: 1717350595094
Received: from pdx1-sub0-mail-a292.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.118.214.225 (trex/6.9.2); Sun, 02 Jun 2024 17:49:55 +0000
Received: from [10.43.97.65] (unknown [193.56.116.15])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: adam@HIDDEN)
 by pdx1-sub0-mail-a292.dreamhost.com (Postfix) with ESMTPSA id 4Vskrx6hb6z6t; 
 Sun,  2 Jun 2024 10:49:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net;
 s=dreamhost; t=1717350594;
 bh=drfbS1GciLueHRqDFDr+ILuIh+0/nsZqLnn90xPUCas=;
 h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding;
 b=i5bOqVMaz10m/0tLorrd+59Z2FKWQq+t6lUzI5gkr6KygnrXh1C/PmFFzHOyzMZ8U
 QB6inCoqBgdZMcluYowt2+MffWrMqaaU2t+HUVAJvUbm6Jz1UPikAzqkj/YUFgepbc
 IL82nFIGBX0MPn5BHMb7NRUzX6yyZqT10KyYkGh2WZC+vbm+DFod31HdQFfWphLdVN
 MgITuhcu1lVnu85Uhwz2QHPdM5rCOnq4tQuHN+H9/NNed3vjhjS+/lu9OqeqkHWrCj
 u189Uym8xGfd4iRYjvZa0VWTjd9zHL5PH25m/3F3gsd5fQZwyH5NHO7qLy5En7huuk
 1OTU5QTv8ko/w==
Message-ID: <debafde7-1fd0-482b-bb1a-75ab816e4d5b@HIDDEN>
Date: Sun, 2 Jun 2024 12:49:52 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
 <86ikzstpyt.fsf@HIDDEN> <86sexz6ks2.fsf@HIDDEN>
 <86ed9j6k8b.fsf@HIDDEN> <864jaer1ta.fsf@HIDDEN>
 <861q5i4gk6.fsf@HIDDEN>
Content-Language: en-US
From: Adam Porter <adam@HIDDEN>
In-Reply-To: <861q5i4gk6.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

On 5/31/24 01:54, Joost Kremers wrote:

> I haven't updated the documentation yet nor did I add a NEWS entry, because I
> first wanted to make sure you agree with the direction of this patch: Adam
> suggested empty vtables should not be allowed, but this patch explicitly allows
> them.

IIRC I only suggested that because it would mean fewer changes to the 
code, but if you've already written code to allow it, I don't object.  :)

Thanks for working on these issues.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#69454: Not possible to insert an empty vtable
Resent-From: Joost Kremers <joostkremers@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 03 Jun 2024 12:15:02 +0000
Resent-Message-ID: <handler.69454.B69454.171741686411639 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 69454
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Adam Porter <adam@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, eric.marsden@HIDDEN, larsi@HIDDEN, 69454 <at> debbugs.gnu.org
Received: via spool by 69454-submit <at> debbugs.gnu.org id=B69454.171741686411639
          (code B ref 69454); Mon, 03 Jun 2024 12:15:02 +0000
Received: (at 69454) by debbugs.gnu.org; 3 Jun 2024 12:14:24 +0000
Received: from localhost ([127.0.0.1]:34859 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sE6Zy-00031d-Sa
	for submit <at> debbugs.gnu.org; Mon, 03 Jun 2024 08:14:24 -0400
Received: from wfhigh8-smtp.messagingengine.com ([64.147.123.159]:44633)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joostkremers@HIDDEN>) id 1sE6Zw-00031F-6S
 for 69454 <at> debbugs.gnu.org; Mon, 03 Jun 2024 08:14:21 -0400
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailfhigh.west.internal (Postfix) with ESMTP id 4F6B818000C3;
 Mon,  3 Jun 2024 08:14:01 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Mon, 03 Jun 2024 08:14:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 cc:cc:content-type:content-type:date:date:from:from:in-reply-to
 :in-reply-to:message-id:mime-version:references:reply-to:subject
 :subject:to:to; s=fm1; t=1717416840; x=1717503240; bh=SF3+ORfBV1
 68aFpNUexj7nnTbSRYZAl0y0d7ORNpLCA=; b=Zj1Sz1NwSNg1ZA1rfPPZLUwcph
 jtdu23KLrwDP5ftN/HgS3Z/oYb34zeJ+LOO4JUYIXV5eDQKqazQlomxDSLW4slod
 khH/OgmLnrYV3NaRc681MVd6WcIzk9zsSpQ+aU4h+fOcVEuuUib8Uf5i3d7cUE2E
 +KhwqSsJsclGm6l2QeEc1OhLqloRfZIZwqih7eB21OEMqSt3iZX/6Co1EtF+FvC6
 OuvPEK+3bnaJpT0XXy+5RM6e6IOWU5G/9rwyvvjlsG9JkUAJxIvBljBo6Ng9K4sr
 SmbLZzSFf9XVrMQOA97ohUhWmEC39Eg97F5Y2utdSrGV7yVniXrCoMqqC+8A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; t=1717416840; x=1717503240; bh=SF3+ORfBV168aFpNUexj7nnTbSRY
 ZAl0y0d7ORNpLCA=; b=ZdfgX+a6Mz3GCcm6cdIp904ezf8PQPhHYIxZdpHmrtrn
 lzeAQUvagNUtqOnZ65iL55boebuqFOP6vqXH4ypVc77m9+8Yvqjz/9P2NIqLVup4
 GeV0cjaXXbBW7MyyY5QobaegFifhmAaGyu0akXecgnftXddpfDscc2+9I5Dz8U/u
 0erCAVj5zEenn7n59bVgRN+7PiE2tih2dU1aYmC2xfTmq3CeFGgYgFBqMwqw6tJ+
 iUjlcPAgt2oXkDuNohvrJU8E/FB3CJyM1hlv5XIdVk3j/9Xn0eGEaMcb52NsX1RJ
 i38fNW3gHFXVGJwgTssSgDEaXJrtQzIrqpwa1UckJg==
X-ME-Sender: <xms:iLNdZvsckmxObtFSRnMK8UTxd7pMz-jHtXLvC3JQG5WfZi5lNT0yGg>
 <xme:iLNdZgf1mSkec690_OnZJCyqhVggThG1T2vuZqlFBZrZ3pIPoqXrdrqaqFudNFwoM
 Zfm6TLu3wp0fA>
X-ME-Received: <xmr:iLNdZiz2hfQ5Q5AzPTu2Q4zxTzjddV9Rz5tDl86qAX1HEWTQtas_Ig20NKY-4UI4joiXIubRK8N7gAcj5zKAsLbjoPFciGlta7S6iQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelvddggeelucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvvefujghffffkgggtsehmtderredttddtnecuhfhrohhmpeflohhoshht
 ucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhmqe
 enucggtffrrghtthgvrhhnpedvuedugffhtdevtddtledvleduleehheefveffgfdvheej
 vdeiieevkeejieekgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih
 hlfhhrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh
X-ME-Proxy: <xmx:iLNdZuPEqNUY_PD-dQa42pzQfQcYl_nftb2dh3qFi1y_7ND32eJ8Yw>
 <xmx:iLNdZv-KRzH-SOMIsWeWtIzBE6PS3gJMvjpQ046gbRfXMVbfVPAJ8w>
 <xmx:iLNdZuXkUQidD_kcHZBhlGSlly1Bf4RkxzwV03alaFfav4r2GTCY5g>
 <xmx:iLNdZgfFPSp4doB0JDBChDEM2XjBEPTx219lswLeIe2zK5vuqpCmzg>
 <xmx:iLNdZqmQhbgM1pmK6evE3x4j1opTmelJk5tnUKIrv5BGWmfxTFvFNSKD>
Feedback-ID: ie15541ac:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 3 Jun 2024 08:13:58 -0400 (EDT)
From: Joost Kremers <joostkremers@HIDDEN>
In-Reply-To: <debafde7-1fd0-482b-bb1a-75ab816e4d5b@HIDDEN> (Adam
 Porter's message of "Sun, 2 Jun 2024 12:49:52 -0500")
References: <5aee0900-7459-4aef-b3c1-cdf83e48b874@HIDDEN>
 <86plw3yecs.fsf@HIDDEN>
 <86jzkfcj1z.fsf@HIDDEN>
 <86ikzstpyt.fsf@HIDDEN> <86sexz6ks2.fsf@HIDDEN>
 <86ed9j6k8b.fsf@HIDDEN> <864jaer1ta.fsf@HIDDEN>
 <861q5i4gk6.fsf@HIDDEN>
 <debafde7-1fd0-482b-bb1a-75ab816e4d5b@HIDDEN>
Date: Mon, 03 Jun 2024 14:13:55 +0200
Message-ID: <864jaa8br0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

On Sun, Jun 02 2024, Adam Porter wrote:
> IIRC I only suggested that because it would mean fewer changes to the code, but
> if you've already written code to allow it, I don't object.  :)

In that case, I'm providing the same patch here, with an additional update for
vtable.texi and NEWS:

 

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=0001-Allow-empty-vtable.patch

From a87d2fc4637a058fad479b4ba5653947bdbb82bf Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Thu, 30 May 2024 13:28:00 +0200
Subject: [PATCH 1/4] Allow empty vtable

* lisp/emacs-lisp/vtable.el (vtable--compute-widths): Set default width
  for columns that have no explicit width and no data.
---
 lisp/emacs-lisp/vtable.el | 67 ++++++++++++++++++++++++---------------
 1 file changed, 41 insertions(+), 26 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index cb7ea397314..07ef7d20020 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -850,32 +850,47 @@ vtable--compute-width
     (error "Invalid spec: %s" spec))))
 
 (defun vtable--compute-widths (table cache)
-  "Compute the display widths for TABLE."
-  (seq-into
-   (seq-map-indexed
-    (lambda (column index)
-      (let ((width
-             (or
-              ;; Explicit widths.
-              (and (vtable-column-width column)
-                   (vtable--compute-width table (vtable-column-width column)))
-              ;; Compute based on the displayed widths of
-              ;; the data.
-              (seq-max (seq-map (lambda (elem)
-                                  (nth 1 (elt (cdr elem) index)))
-                                cache)))))
-        ;; Let min-width/max-width specs have their say.
-        (when-let ((min-width (and (vtable-column-min-width column)
-                                   (vtable--compute-width
-                                    table (vtable-column-min-width column)))))
-          (setq width (max width min-width)))
-        (when-let ((max-width (and (vtable-column-max-width column)
-                                   (vtable--compute-width
-                                    table (vtable-column-max-width column)))))
-          (setq width (min width max-width)))
-        width))
-    (vtable-columns table))
-   'vector))
+  "Compute the display widths for TABLE.
+CACHE is TABLE's cache data as returned by `vtable--compute-cache'."
+  (let ((widths (seq-map-indexed
+                 (lambda (column index)
+                   (let ((width
+                          (or
+                           ;; Explicit widths.
+                           (and (vtable-column-width column)
+                                (vtable--compute-width table (vtable-column-width column)))
+                           ;; If the vtable is empty and no explicit width is given,
+                           ;; set its width to 0 and deal with it below.
+                           (if (null cache)
+                               0)
+                           ;; Otherwise, compute based on the displayed widths of the
+                           ;; data.
+                           (seq-max (seq-map (lambda (elem)
+                                               (nth 1 (elt (cdr elem) index)))
+                                             cache)))))
+                     ;; Let min-width/max-width specs have their say.
+                     (when-let ((min-width (and (vtable-column-min-width column)
+                                                (vtable--compute-width
+                                                 table (vtable-column-min-width column)))))
+                       (setq width (max width min-width)))
+                     (when-let ((max-width (and (vtable-column-max-width column)
+                                                (vtable--compute-width
+                                                 table (vtable-column-max-width column)))))
+                       (setq width (min width max-width)))
+                     width))
+                 (vtable-columns table))))
+    ;; If there are any zero-width columns, divide the remaining window
+    ;; width evenly over them.
+    (when (member 0 widths)
+      (let* ((combined-width (apply #'+ widths))
+             (n-0cols (length (seq-keep #'zerop widths)))
+             (default-width (/ (- (window-width nil t) combined-width) n-0cols)))
+        (setq widths (mapcar (lambda (width)
+                               (if (zerop width)
+                                   default-width
+                                 width))
+                             widths))))
+    (seq-into widths 'vector)))
 
 (defun vtable--compute-cache (table)
   (seq-map
-- 
2.45.2


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0002-Enable-inserting-new-objects-into-empty-vtable.patch

From 36b0fb11b27d8f6246a4683462823088c562b146 Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Thu, 30 May 2024 23:20:00 +0200
Subject: [PATCH 2/4] Enable inserting new objects into empty vtable

* lisp/emacs-lisp/vtable.el (vtable-insert-object): If the vtable is
  empty, add the new object and recreate + redisplay the table.
---
 lisp/emacs-lisp/vtable.el | 151 +++++++++++++++++++-------------------
 1 file changed, 77 insertions(+), 74 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index 07ef7d20020..c86ae7f0955 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -368,86 +368,89 @@ vtable-insert-object
 case.
 
 This also updates the displayed table."
-  ;; FIXME: Inserting an object into an empty vtable currently isn't
-  ;; possible. `nconc' fails silently (twice), and `setcar' on the cache
-  ;; raises an error.
+  ;; If the vtable is empty, just add the object and regenerate the
+  ;; table.
   (if (null (vtable-objects table))
-      (error "[vtable] Cannot insert object into empty vtable"))
-  ;; First insert into the objects.
-  (let ((pos (if location
-                 (if (integerp location)
-                     (prog1
-                         (nthcdr location (vtable-objects table))
-                       ;; Do not prepend if index is too large:
-                       (setq before nil))
-                   (or (memq location (vtable-objects table))
-                       ;; Prepend if `location' is not found and
-                       ;; `before' is non-nil:
-                       (and before (vtable-objects table))))
-               ;; If `location' is nil and `before' is non-nil, we
-               ;; prepend the new object.
-               (if before (vtable-objects table)))))
-    (if (or before  ; If `before' is non-nil, `pos' should be, as well.
-            (and pos (integerp location)))
-        ;; Add the new object before.
-        (let ((old-object (car pos)))
-          (setcar pos object)
-          (setcdr pos (cons old-object (cdr pos))))
-      ;; Otherwise, add the object after.
-      (if pos
-          ;; Splice the object into the list.
-          (setcdr pos (cons object (cdr pos)))
-        ;; Otherwise, append the object.
-        (nconc (vtable-objects table) (list object)))))
-  ;; Then adjust the cache and display.
-  (save-excursion
-    (vtable-goto-table table)
-    (let* ((cache (vtable--cache table))
-           (inhibit-read-only t)
-           (keymap (get-text-property (point) 'keymap))
-           (ellipsis (if (vtable-ellipsis table)
-                         (propertize (truncate-string-ellipsis)
-                                     'face (vtable-face table))
-                       ""))
-           (ellipsis-width (string-pixel-width ellipsis))
-           (elem (if location  ; This binding mirrors the binding of `pos' above.
-                     (if (integerp location)
-                         (nth location (car cache))
-                       (or (assq location (car cache))
-                           (and before (caar cache))))
-                   (if before (caar cache))))
-           (pos (memq elem (car cache)))
-           (line (cons object (vtable--compute-cached-line table object))))
-      (if (or before
+      (progn
+        (setf (vtable-objects table) (list object))
+        (vtable--recompute-numerical table (vtable--compute-cached-line table object))
+        (vtable-goto-table table)
+        (vtable-revert-command))
+    ;; First insert into the objects.
+    (let ((pos (if location
+                   (if (integerp location)
+                       (prog1
+                           (nthcdr location (vtable-objects table))
+                         ;; Do not prepend if index is too large:
+                         (setq before nil))
+                     (or (memq location (vtable-objects table))
+                         ;; Prepend if `location' is not found and
+                         ;; `before' is non-nil:
+                         (and before (vtable-objects table))))
+                 ;; If `location' is nil and `before' is non-nil, we
+                 ;; prepend the new object.
+                 (if before (vtable-objects table)))))
+      (if (or before  ; If `before' is non-nil, `pos' should be, as well.
               (and pos (integerp location)))
-          ;; Add the new object before:.
-          (let ((old-line (car pos)))
-            (setcar pos line)
-            (setcdr pos (cons old-line (cdr pos)))
-            (unless (vtable-goto-object (car elem))
-              (vtable-beginning-of-table)))
+          ;; Add the new object before.
+          (let ((old-object (car pos)))
+            (setcar pos object)
+            (setcdr pos (cons old-object (cdr pos))))
         ;; Otherwise, add the object after.
         (if pos
             ;; Splice the object into the list.
-            (progn
-              (setcdr pos (cons line (cdr pos)))
-              (if (vtable-goto-object location)
-                  (forward-line 1)  ; Insert *after*.
-                (vtable-end-of-table)))
+            (setcdr pos (cons object (cdr pos)))
           ;; Otherwise, append the object.
-          (setcar cache (nconc (car cache) (list line)))
-          (vtable-end-of-table)))
-      (let ((start (point)))
-        ;; FIXME: We have to adjust colors in lines below this if we
-        ;; have :row-colors.
-        (vtable--insert-line table line 0
-                             (nth 1 cache) (vtable--spacer table)
-                             ellipsis ellipsis-width)
-        (add-text-properties start (point) (list 'keymap keymap
-                                                 'vtable table)))
-      ;; We may have inserted a non-numerical value into a previously
-      ;; all-numerical table, so recompute.
-      (vtable--recompute-numerical table (cdr line)))))
+          (nconc (vtable-objects table) (list object)))))
+    ;; Then adjust the cache and display.
+    (save-excursion
+      (vtable-goto-table table)
+      (let* ((cache (vtable--cache table))
+             (inhibit-read-only t)
+             (keymap (get-text-property (point) 'keymap))
+             (ellipsis (if (vtable-ellipsis table)
+                           (propertize (truncate-string-ellipsis)
+                                       'face (vtable-face table))
+                         ""))
+             (ellipsis-width (string-pixel-width ellipsis))
+             (elem (if location  ; This binding mirrors the binding of `pos' above.
+                       (if (integerp location)
+                           (nth location (car cache))
+                         (or (assq location (car cache))
+                             (and before (caar cache))))
+                     (if before (caar cache))))
+             (pos (memq elem (car cache)))
+             (line (cons object (vtable--compute-cached-line table object))))
+        (if (or before
+                (and pos (integerp location)))
+            ;; Add the new object before:.
+            (let ((old-line (car pos)))
+              (setcar pos line)
+              (setcdr pos (cons old-line (cdr pos)))
+              (unless (vtable-goto-object (car elem))
+                (vtable-beginning-of-table)))
+          ;; Otherwise, add the object after.
+          (if pos
+              ;; Splice the object into the list.
+              (progn
+                (setcdr pos (cons line (cdr pos)))
+                (if (vtable-goto-object location)
+                    (forward-line 1)  ; Insert *after*.
+                  (vtable-end-of-table)))
+            ;; Otherwise, append the object.
+            (setcar cache (nconc (car cache) (list line)))
+            (vtable-end-of-table)))
+        (let ((start (point)))
+          ;; FIXME: We have to adjust colors in lines below this if we
+          ;; have :row-colors.
+          (vtable--insert-line table line 0
+                               (nth 1 cache) (vtable--spacer table)
+                               ellipsis ellipsis-width)
+          (add-text-properties start (point) (list 'keymap keymap
+                                                   'vtable table)))
+        ;; We may have inserted a non-numerical value into a previously
+        ;; all-numerical table, so recompute.
+        (vtable--recompute-numerical table (cdr line))))))
 
 (defun vtable-column (table index)
   "Return the name of the INDEXth column in TABLE."
-- 
2.45.2


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0003-vtable-allow-resetting-column-alignment-when-table-d.patch

From 63b47044325bc8d7357b6536d7575a5a73bbeb08 Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Fri, 31 May 2024 01:38:54 +0200
Subject: [PATCH 3/4] vtable: allow resetting column alignment when table data
 changes

* lisp/emacs-lisp/vtable.el (vtable--compute-columns): if a column was
  not created with an explicit 'align' property, allow changing this
  property when the column data changes from numeric to non-numeric (or
  vice versa). This makes it possible to add data to an empty table,
  because in a table without data all columns are assumed to be numeric
  and right-aligned.
---
 lisp/emacs-lisp/vtable.el | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index c86ae7f0955..3e9f5214db0 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -45,7 +45,8 @@ vtable-column
   getter
   formatter
   displayer
-  -numerical)
+  -numerical
+  -aligned)
 
 (defclass vtable ()
   ((columns :initarg :columns :accessor vtable-columns)
@@ -473,7 +474,17 @@ vtable--get-value
    (t
     (elt object index))))
 
-(defun vtable--compute-columns (table)
+(defun vtable--compute-columns (table &optional recompute)
+  "Compute column specs for TABLE.
+Set the `align', `-aligned' and `-numerical' properties of each column.
+If the column contains only numerical data, set `-numerical' to t,
+otherwise to nil.  `-aligned' indicates whether the column has an
+`align' property set by the user.  If it does, `align' is not touched,
+otherwise it is set to `right' for numeric columns and to `left' for
+non-numeric columns.
+
+If RECOMPUTE is non-nil, do not set `-aligned'.  This can be used to
+recompute the column specs when the table data has changed."
   (let ((numerical (make-vector (length (vtable-columns table)) t))
         (columns (vtable-columns table)))
     ;; First determine whether there are any all-numerical columns.
@@ -484,11 +495,16 @@ vtable--compute-columns
                                              table))
            (setf (elt numerical index) nil)))
        (vtable-columns table)))
+    ;; Check if any columns have an explicit `align' property.
+    (unless recompute
+      (dolist (column (vtable-columns table))
+        (if (vtable-column-align column)
+            (setf (vtable-column--aligned column) t))))
     ;; Then fill in defaults.
     (seq-map-indexed
      (lambda (column index)
        ;; This is used when displaying.
-       (unless (vtable-column-align column)
+       (unless (vtable-column--aligned column)
          (setf (vtable-column-align column)
                (if (elt numerical index)
                    'right
@@ -813,7 +829,7 @@ vtable--recompute-numerical
          (setq recompute t)))
      line)
     (when recompute
-      (vtable--compute-columns table))))
+      (vtable--compute-columns table t))))
 
 (defun vtable--set-header-line (table widths spacer)
   (setq header-line-format
-- 
2.45.2


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0004-Update-vtable-documentation-and-NEWS.patch

From ebfc7ae51895d7dc468c737f2fe403fbd398d5e8 Mon Sep 17 00:00:00 2001
From: Joost Kremers <joostkremers@HIDDEN>
Date: Mon, 3 Jun 2024 14:07:43 +0200
Subject: [PATCH 4/4] Update vtable documentation and NEWS

* doc/misc/vtable.texi: Add note about empty vtables; add note about
  column width in empty vtables.
* etc/NEWS: Add note about empty vtables.
---
 doc/misc/vtable.texi | 11 +++++++++++
 etc/NEWS             |  8 ++++++++
 2 files changed, 19 insertions(+)

diff --git a/doc/misc/vtable.texi b/doc/misc/vtable.texi
index 6003435385f..061547f5deb 100644
--- a/doc/misc/vtable.texi
+++ b/doc/misc/vtable.texi
@@ -264,6 +264,10 @@ Making A Table
 more elements in the sequence than there is in @code{:columns}, only
 the @code{:columns} first elements are displayed.
 
+If the @code{:objects} list is empty (and no @code{:objects-function} is
+defined), an empty vtable is created.  In this case, a @code{:columns}
+spec must be provided.
+
 @item :objects-function
 It's often convenient to generate the objects dynamically (for
 instance, to make reversion work automatically).  In that case, this
@@ -295,6 +299,11 @@ Making A Table
 @var{n} percent of the window's width.
 @end table
 
+If no @code{width} is provided, the width is calculated based on the
+column data (provided in the @code{:objects} list or through the
+@code{:objects-function}) or, if there is no data, on the basis of the
+window width.
+
 @item min-width
 This uses the same format as @code{width}, but specifies the minimum
 width (and overrides @code{width} if @code{width} is smaller than this.
@@ -569,6 +578,8 @@ Interface Functions
 index is too small, or appended if it is too large.  In this case,
 @var{before} is ignored.
 
+If @var{table} is empty, @var{location} and @var{before} are ignored.
+
 This also updates the displayed table.
 @end defun
 
diff --git a/etc/NEWS b/etc/NEWS
index 5a1f7f3e443..7089b27ed75 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2806,6 +2806,14 @@ this was not possible.)  In addition, LOCATION can be an integer, a
 (zero-based) index into the table at which the new object is inserted
 (BEFORE is ignored in this case).
 
+** 'make-vtable' can create empty vtable
+It is now possible to create a vtable without data, by leaving the
+':objects' list empty, or by providing a ':objects-function' that
+(initially) produces no data.  In such a case, it is necessary to
+provide a ':columns' spec, so that the number of columns and their
+widths can be determined.  Columns widths can be set explicitly, or they
+will be calculated based on the window width.
+
 ** JSON
 
 ---
-- 
2.45.2


--=-=-=
Content-Type: text/plain




-- 
Joost Kremers
Life has its moments


--=-=-=--





Last modified: Mon, 3 Jun 2024 12:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.