Subject: bug#70664: 29.3; vtable-insert-object cannot insert at top of table

From: Eli Zaretskii <[email-masked]>
Date: Thu, 09 May 2024 11:45:57 +0300

> From: Joost Kremers <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Tue, 07 May 2024 12:52:56 +0200
> 
> Here's my first attempt at fixing this bug and generally making
> `vtable-insert-object` more versatile (see attachment).

Thanks.

> A few questions / comments:
> 
> - Is this the right place to send this patch? Or should it go to emacs-devel?

Here is the right place for patches.

> - I don't know if this change warrants a NEWS entry. It's not really
>   user-facing, so I didn't add one.

This changes a public API, so it does need to be called out in NEWS,
just in the section which lists Lisp-level changes.

> - I don't know how to write a non-interactive test for my changes, because
>   `vtable-insert-object` only works if the vtable is being displayed in a
>   buffer. So instead I wrote an interactive function to test all possible
>   combinations of LOCATION and BEFORE:

A test can be interactive (since the test suite can be run
interactively as well), but then please skip the test if it's run in
batch mode.

> +@defun vtable-insert-object table object &optional location before
> +Insert @var{object} into @var{table}.  @var{location} should be an
> +object in the table, the new object is inserted after this object, or
> +before it if @var{before} is non-nil.  If @var{location} is nil,
                                    ^^^                        ^^^
@code{nil}, in both cases.

> +;; FIXME: The fact that the `location' argument of
> +;; `vtable-insert-object' can be an integer and is then interpreted as
> +;; an index precludes the use of integers as objects. This seems a very
                                                       ^^
Two spaces between sentences, please.