GNU bug report logs - #47425
26.3; `plist-get', `plist-put' should accept a TEST function

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 26 Mar 2021 22:14:01 UTC

Severity: wishlist

Found in version 26.3

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Jean Louis <bugs <at> gnu.support>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 47425 <at> debbugs.gnu.org
Subject: Re: bug#47425: 26.3; `plist-get', `plist-put' should accept a TEST
 function
Date: Sat, 27 Mar 2021 10:16:35 +0300
* Drew Adams <drew.adams <at> oracle.com> [2021-03-27 01:15]:
> Please consider adding a TEST comparer arg for plist keys.
> 
> In Elisp, a plist key need not be a symbol:
> 
> (plist-put (list "aaa" 1 "bbb" 2 "ccc" 3) "bbb" 42)
> 
> That "works" (and no error), but it doesn't do what's expected, since
> the keys should be compared with `equal' or `string=', not `eq'.
> 
> And if it were not intended that that work then Elisp would raise a
> wrong-type-argument error saying that the first arg isn't a plist.
> 
> And note that the Elisp manual says:
> 
>   A "property list" ("plist" for short) is a list of
>   paired elements.  Each of the pairs associates a
>   property name (usually a symbol) with a property or value.
>                  ^^^^^^^

That is right, I always had that problem with plist, and still
do. Amount of the coping code on my side would become redundant if
that would be corrected to have a test function.




This bug report was last modified 3 years and 58 days ago.

Previous Next


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