Subject: bug#47427: 26.3; 1. Please define a built-in predicate `plistp', 2. wrong type wrong-type-argument error

From: Drew Adams <[email-masked]>
Date: Fri, 26 Mar 2021 22:27:00 +0000

(plist-put (list 'a 'b 'c) "a" 42)

Debugger entered--Lisp error: (wrong-type-argument plistp (a b c))
  plist-put((a b c) "abc" 42)
  eval((plist-put (list (quote a) (quote b) (quote c)) "abc" 42))

That's all fine and dandy, except that there is no predicate `plistp'.

See (elisp) Type Predicates:

  All built-in functions do check the types of their actual arguments
  when appropriate, and signal a 'wrong-type-argument' error if an
  argument is of the wrong type.

It makes no sense to refer to `plistp' in the error message if it
doesn't exist.  If it won't exist then the error message should say that
the arg isn't a plist - not mention `plistp'.  Even just saying "plist"
in the error message would be an improvement in this regard.  But the
right fix is to define a `plistp' primitive.

Not only that, but the error is _not_, apparently that the first
arg isn't a proper plist.  For example, this raises no error:

 (plist-put (list 'a 'b 'c) "a" 42)

And it returns the list (a 42 c).  Clearly the error was raised
not because of an improper plist but because the key to look up
is a string and the keys in the almost-plist are symbols.

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.19041
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''