]> git.eshelyaron.com Git - emacs.git/commitdiff
Update vtable documentation
authorJoost Kremers <joostkremers@fastmail.com>
Mon, 14 Oct 2024 11:10:57 +0000 (13:10 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 9 Nov 2024 15:49:24 +0000 (16:49 +0100)
* doc/misc/vtable.texi: Document creation of empty vtables.
* etc/NEWS: Announce empty vtables.  (Bug#73775)

(cherry picked from commit ac91d190d623f6fef186b035373cdb72347cc99d)

doc/misc/vtable.texi
etc/NEWS

index 795d7fad037fe6b715dd52afa50d816960a3b762..b2ead47d0bc9192cbbe9fd705c4541097c6cfa45 100644 (file)
@@ -264,6 +264,10 @@ In the latter case, if @code{:columns} is non-@code{nil} and there's
 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 @@ The width of @var{n} @samp{x} characters in the table's face.
 @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 @@ index is out of range, @var{object} is prepended to @var{table} if the
 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
 
index d087d4746af37488367ae25ab9da32f89b02c323..73f29b8800d4abc6bf2f9f6218fd398e132b50a6 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -725,6 +725,16 @@ 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.
+
+
 \f
 * Changes in Emacs 31.1 on Non-Free Operating Systems