GNU bug report logs -
#69454
Not possible to insert an empty vtable
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi all,
>>>> Date: Wed, 28 Feb 2024 15:29:11 +0100
>>>> From: Eric Marsden <eric.marsden <at> risk-engineering.org>
>>>>
>>>> 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 did some work on fixing this, and would like to suggest the attached patches.
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-widths`
would error out. With the patch, columns without an explicit width get assigned
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 does
this by simply recreating and redisplaying the table, which I think makes the
most sense.
Comments?
TIA
--
Joost Kremers
Life has its moments
[0001-Allow-empty-vtable.patch (text/x-patch, attachment)]
[0002-Fix-recomputing-of-vtable-column-alignment.patch (text/x-patch, attachment)]
[0003-Enable-inserting-new-objects-into-empty-vtable.patch (text/x-patch, attachment)]
This bug report was last modified 107 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.