Subject: bug#30297: 27.0.50; *Help* shows inaccurate arglist for json-parse-string

From: "Basil L. Contovounesios" <[email-masked]>
Date: Tue, 30 Jan 2018 23:31:29 +0000

>From 2ccc2700b2f2386a8792aa0fc1b2146b5c201e79 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email-masked]>
Date: Tue, 30 Jan 2018 11:10:14 +0000
Subject: [PATCH] ; Fix arglist doc of json parse functions

* src/json.c (Fjson_parse_string, Fjson_parse_buffer):
Fix "usage:" arglist doc.
---
 src/json.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/json.c b/src/json.c
index 12ba7afa6a..b046d34f66 100644
--- a/src/json.c
+++ b/src/json.c
@@ -740,7 +740,7 @@ object, all but the last one are ignored.  If STRING doesn't contain a
 valid JSON object, an error of type `json-parse-error' is signaled.
 The keyword argument `:object-type' specifies which Lisp type is used
 to represent objects; it can be `hash-table' or `alist'.
-usage: (string &key (OBJECT-TYPE \\='hash-table)) */)
+usage: (json-parse-string STRING &key (OBJECT-TYPE \\='hash-table))  */)
   (ptrdiff_t nargs, Lisp_Object *args)
 {
   ptrdiff_t count = SPECPDL_INDEX ();
@@ -813,7 +813,7 @@ DEFUN ("json-parse-buffer", Fjson_parse_buffer, Sjson_parse_buffer,
 This is similar to `json-parse-string', which see.  Move point after
 the end of the object if parsing was successful.  On error, point is
 not moved.
-usage: (&key (OBJECT-TYPE \\='hash-table))  */)
+usage: (json-parse-buffer &key (OBJECT-TYPE \\='hash-table))  */)
   (ptrdiff_t nargs, Lisp_Object *args)
 {
   ptrdiff_t count = SPECPDL_INDEX ();
-- 
2.15.1

Seen on latest master:

1. emacs -Q
2. C-h f json-parse-string RET

*Help* reports the following arglist:

  (json-parse-string &key (OBJECT-TYPE 'hash-table))

despite mention of the positional argument STRING in the rest of the
docstring.

Attached is a doc fix suggestion.

Thanks,

-- 
Basil

In GNU Emacs 27.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-01-30 built on thunk
Repository revision: 2b0bcbbaa64f95c14deed89fdf279d8be48ee352
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
System Description: Debian GNU/Linux buster/sid

Quit
Configured using:
 'configure --config-cache --prefix=/home/blc/.local --with-mailutils
 --with-x-toolkit=lucid --with-modules --with-file-notification=yes
 --with-x 'CFLAGS=-flto -fomit-frame-pointer -march=native -maes -mavx
 -mcrc32 -mf16c -mfpmath=sse -mfsgsbase -mfxsr -minline-all-stringops
 -mmmx -mpclmul -mpopcnt -msahf -msse4.2 -mxsave -mxsaveopt -mvzeroupper
 -O2 -pipe' LDFLAGS=-flto'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 MODULES THREADS LIBSYSTEMD JSON LCMS2