Subject: bug#30489: 26.0.91; [PATCH] Data associated with json-readtable-error not a list

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sun, 18 Mar 2018 00:14:13 +0000

>From b917a7409659dde2ccc836d80741ad5a89d8785c Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email-masked]>
Date: Fri, 16 Feb 2018 17:11:49 +0000
Subject: [PATCH] Pass json-readtable-error data as a list (bug#30489)

* lisp/json.el (json-readtable-dispatch): Fix error data.
---
 lisp/json.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/json.el b/lisp/json.el
index b03a482ca6..d374f452e6 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -685,7 +685,7 @@ json-readtable-dispatch
       (push (list c 'json-read-number) table))
     (pcase-dolist (`(,c . ,rest) table)
       (push `((eq ,char ,c) (,@rest)) res))
-    `(cond ,@res (t (signal 'json-readtable-error ,char)))))
+    `(cond ,@res (t (signal 'json-readtable-error (list ,char))))))
 
 (defun json-read ()
   "Parse and return the JSON object following point.
-- 
2.16.2

Noam Postavsky <[email-masked]> writes:

> "Basil L. Contovounesios" <[email-masked]> writes:
>
>> @@ -685,7 +685,7 @@ json-readtable-dispatch
>>        (push (list c 'json-read-number) table))
>>      (pcase-dolist (`(,c . ,rest) table)
>>        (push `((eq ,char ,c) (,@rest)) res))
>> -    `(cond ,@res (t (signal 'json-readtable-error ,char)))))
>> +    `(cond ,@res (t (signal 'json-readtable-error ,(list char))))))
>
> Actually, shouldn't this be (list ,char)?
>
> Otherwise, I get this warning when compiling:
>
> In end of data:
> ../../lisp/json.el:766:1:Warning: the function ‘char’ is not known to be
>     defined.

Right you are; thanks for catching this embarrassing macro mistake.

I attach an updated patch including your fix and the bug number.

Thanks again,

-- 
Basil