GNU bug report logs - #48302
[PATCH] Abbreviate `find' properties in M-x rgrep on MS Windows

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Sat, 8 May 2021 22:18:01 UTC

Severity: normal

Tags: patch

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 48302 <at> debbugs.gnu.org
Subject: bug#48302: [PATCH] Abbreviate `find' properties in M-x rgrep on MS Windows
Date: Mon, 10 May 2021 09:42:46 +0200
Jim Porter <jporterbugs <at> 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.




This bug report was last modified 4 years and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.