Subject: Re: bug#54487: 29.0.50; connection-local value for `shell-file-name' not set in Dired buffers over Tramp

From: Michael Albinus <[email-masked]>
Date: Mon, 21 Mar 2022 15:06:28 +0100

Eli Zaretskii <[email-masked]> writes:

Hi Eli,

> Is it really a good idea to solve this only for Grep?  Shouldn't shell
> quoting always use this logic (with some variable that callers could
> bind in exceptional cases, which I presume will be rare)?  Or am I
> missing something?

I had the same feeling after sending the patch, so I've started to
rework this. I came out with the following solution:

--8<---------------cut here---------------start------------->8---
shell-quote-argument is a compiled Lisp function in
‘../../../src/emacs/lisp/subr.el’.

(shell-quote-argument ARGUMENT &optional POSIX)

Quote ARGUMENT for passing as argument to an inferior shell.

This function is designed to work with the syntax of your system’s
standard shell, and might produce incorrect results with unusual shells.
See Info node ‘(elisp)Security Considerations’.

If the optional POSIX argument is non-nil, ARGUMENT is quoted
according to POSIX rules.
--8<---------------cut here---------------end--------------->8---

I'll wait until Jim confirms that this works in general, then I would
apply a patch along this spec.

Best regards, Michael.