Subject: Re: bug#48302: [PATCH] Abbreviate `find' properties in M-x rgrep on MS Windows

From: Michael Albinus <[email-masked]>
Date: Mon, 10 May 2021 09:42:46 +0200

Jim Porter <[email-masked]> writes:

Hi Jim,

> It uses the shell-quoting semantics of whatever the current system is;
> it would be nice to test all shell-quoting styles in one test run, but
> I wasn't sure how to do that.

You could force this by let-binding system-type, like

--8<---------------cut here---------------start------------->8---
(let ((system-type 'gnu/linux))
  (rgrep-default-command "search" "*" nil)
  ...)

(let ((system-type 'darwin))
  (rgrep-default-command "search" "*" nil)
  ...)
--8<---------------cut here---------------end--------------->8---

In the windows-nt case, the function w32-shell-dos-semantics is called,
which does not exist on other systems. So you must mock it up to return
either t or nil:

--8<---------------cut here---------------start------------->8---
(let ((system-type 'windows-nt))
  (cl-letf (((symbol-function #'w32-shell-dos-semantics) #'always))
    (rgrep-default-command "search" "*" nil)
    ...))

(let ((system-type 'windows-nt))
  (cl-letf (((symbol-function #'w32-shell-dos-semantics) #'ignore))
    (rgrep-default-command "search" "*" nil)
    ...))
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.