Subject: bug#48228: json-serialize should signal error when dll is not found [MS Windows]

From: Dmitry Gutov <[email-masked]>
Date: Thu, 6 May 2021 01:36:06 +0300

On 04.05.2021 21:07, Eli Zaretskii wrote:
>> Cc: [email-masked], [email-masked], [email-masked]
>> From: Dmitry Gutov <[email-masked]>
>> Date: Tue, 4 May 2021 20:47:26 +0300
>>
>> On 04.05.2021 20:42, Eli Zaretskii wrote:
>>> How is that different from similar code that relies on, say, librsvg
>>> to display SVG images?
>>
>> Does it have a Lisp entry point? If so, I suppose it should be fixed too.
> 
> We have create-image, which currently explicitly checks for the
> relevant library to be available to Emacs.
> 
>> My main experience with librsvg is creating image specs manually and
>> having them used via the 'display' text property. There is no obvious
>> place to signal an error in that scenario.
> 
> There is: in create-image.

It does make sense to signal an error in that case, too (with a 
dedicated error symbol).

A bit less critical than the JSON case, because the latter can 
erroneously return nil (and print a message) in situations where nil is 
a valid return value. And one can create an image spec by hand without 
calling create-image, so the "real" error is going to happen somewhere 
else anyway (during redisplay, I imagine).

So I would probably split this change into 2 commits: the essential 
places where no valid code should proceed when there is no support, and 
cases like create-image, to be easily reverted if we see significant 
complaints.