GNU bug report logs - #69666
[PATCH] (vtable-update-object): Make old-object argument optional

Previous Next

Package: emacs;

Reported by: Adam Porter <adam <at> alphapapa.net>

Date: Sat, 9 Mar 2024 05:53:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 69666 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Adam Porter <adam <at> alphapapa.net>
Cc: 69666 <at> debbugs.gnu.org
Subject: Re: bug#69666: [PATCH] (vtable-update-object): Make old-object
 argument optional
Date: Thu, 14 Mar 2024 11:00:51 +0200
> Date: Fri, 8 Mar 2024 23:51:33 -0600
> From: Adam Porter <adam <at> alphapapa.net>
> 
> Please see the attached patch which makes `vtable-update-object' easier 
> to use in the common case of updating an existing object's 
> representation in a table (rather than replacing it with another object).

Thanks, I have some minor comments below.

> Subject: [PATCH] (vtable-update-object): Make old-object argument optional

Since this changes the API of a public function, we need to call this
out in NEWS.

> +@defun vtable-update-object table object &optional old-object
> +Change @var{old-object} into @var{object} in @var{table}; or, without
> +@var{old-object}, update existing @var{object} in @var{table}.  This
> +also updates the displayed table.

This is backwards: the documentation should first say what happens if
the function is called with just 2 arguments, and then what happens if
the 3rd one is supplied.  Like this:

  Update @var{object} in @var{table} and redisplay @var{table}.
  Optional argument @var{old-object}, if non-@code{nil}, means to
  change @var{old-object} into @var{object}.

> +(defun vtable-update-object (table object &optional old-object)
> +  "Replace OLD-OBJECT in TABLE with OBJECT.
> +Without OLD-OBJECT, just update existing OBJECT in TABLE."

Same here.




This bug report was last modified 1 year and 63 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.