From: Michael Albinus <michael.albinus@gmx.de>
To: Jim Porter <jporterbugs@gmail.com>
Cc: 48302@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 [thread overview]
Message-ID: <87bl9jdog9.fsf@gmx.de> (raw)
In-Reply-To: <CANh=_JE417Ls2qQVv6w63rX94ETr0JTx7WT5HnqDx8Qf=WwFxg@mail.gmail.com> (Jim Porter's message of "Sun, 9 May 2021 13:07:42 -0700")
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.
next prev parent reply other threads:[~2021-05-10 7:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-08 22:17 bug#48302: [PATCH] Abbreviate `find' properties in M-x rgrep on MS Windows Jim Porter
2021-05-09 6:53 ` Eli Zaretskii
2021-05-09 20:07 ` Jim Porter
2021-05-10 7:42 ` Michael Albinus [this message]
2021-05-11 4:36 ` bug#48302: [PATCH v2] " Jim Porter
2021-05-11 7:11 ` Michael Albinus
2021-05-11 12:22 ` Eli Zaretskii
2021-05-12 8:48 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bl9jdog9.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=48302@debbugs.gnu.org \
--cc=jporterbugs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).