Subject: Re: bug#54225: [PATCH] with-demoted-errors: Fix macroexp-warn-and-return call

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 03 Mar 2022 15:36:09 +0100

Kyle Meyer <[email-masked]> writes:

> The macroexp-warn-and-return call added to with-demoted-errors in
> d52c929e31f (2022-02-04) is incorrect.  The with-demoted-errors format
> string is passed as MSG, the actual message is passed as FORM, and the
> form is passed as CATEGORY, leading to with-demoted-errors returning
> "Missing format argument".
>
> * lisp/subr.el (with-demoted-errors): Call macroexp-warn-and-return
> with correct arguments.

[...]

> -      (macroexp-warn-and-return format "Missing format argument" exp))))
> +      (macroexp-warn-and-return "Missing format argument" exp))))

The code flow in with-demoted-errors is pretty confusing.  Can it be
improved upon instead of tweaked this way?  (`format' here will be
"Error: %S" at least in some cases, I guess?)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no