From da903db0bcf310376d4ff7aaf3578bb576cfa1b7 Mon Sep 17 00:00:00 2001 From: Joost Kremers Date: Mon, 14 Oct 2024 13:10:57 +0200 Subject: [PATCH 4/4] Update vtable documentation * docs/misc/vtable.texi: Document creation of empty vtables. * etc/NEWS: Announce empty vtables. --- doc/misc/vtable.texi | 11 +++++++++++ etc/NEWS | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/doc/misc/vtable.texi b/doc/misc/vtable.texi index 795d7fad037..b2ead47d0bc 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. @@ -576,6 +585,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 4346fb4aedd..ecd22499767 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -662,6 +662,15 @@ This lets a Lisp program access the core functionality of the program, choosing the program according to the operating system's conventions. +** 'make-vtable' can create an 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. + + * Changes in Emacs 31.1 on Non-Free Operating Systems -- 2.47.0