bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Michael Albinus
Subject: bug#48302: [PATCH] Abbreviate `find' properties in M-x rgrep on MS Windows
Date: Mon, 10 May 2021 09:42:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jim Porter <jporterbugs@gmail.com> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]