Subject: Re: bug#63432: 30.0.50; Handle current-prefix-arg in async-shell-command
From: Eli Zaretskii <[email-masked]>
To: Gabriel <[email-masked]>
Cc: [email-masked]
Date: Sun, 14 May 2023 09:28:34 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Gabriel <[email-masked]>
> Date: Sat, 13 May 2023 20:35:51 -0300
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Thanks, but I don't understand why we need the error message.  Isn't
> > it enough to pass nil as 2nd argument to shell-command?
> 
> The error message is just for noninteractive cases where a caller passes
> a numeric argument as the second argument of `async-shell-command'.

I think the error signaled by shell-command is sufficient in the
non-interactive case.  We don't usually try detecting
wrong-type-argument errors in non-interactive use, we leave it to the
underlying primitives to detect and report.

> Example:
>     Before patch:
>         (async-shell-command "ls" 1) => error: (wrong-type-argument stringp 1)
>     After patch:
>         (async-shell-command "ls" 1) => error: (error "Invalid output buffer")

I see nothing wrong with the "before" version, it gives an accurate
description of the problem for that case.

> Here is a patch without the error message, in case it's preferable:

Thanks, installed on the emacs-29 branch, and closing the bug.