Subject: bug#69454: Not possible to insert an empty vtable

From: Eric Marsden <[email-masked]>
Date: Wed, 28 Feb 2024 15:29:11 +0100

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