Subject: bug#2607 closed by Eli Zaretskii <[email-masked]> (Re: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern')

From: [email-masked] (Emacs bug Tracking System)
Date: Sat, 28 Mar 2009 12:35:03 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern'

It has been closed by Eli Zaretskii <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Eli Zaretskii <[email-masked]> by
replying to this email.

-- 
2607: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2607
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern'
From: Eli Zaretskii <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 28 Mar 2009 15:27:04 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Tue, 10 Mar 2009 22:02:30 -0400
> 
> I think I understand: idempotency is actually not important, and is not
> really what is meant by the 2 lines.
> Indeed (shell-quote-wildcard-pattern "\\'foo*") => "\\\\'foo*"
> so it's not idempotent: \ can be used to escape [*?\] but not [;<>&|()'"#$].
> 
> How 'bout something like:
> 
>    Quote characters special to the shell in pattern, leave wildcards alone.
> 
>    PATTERN should be a file-name wildcard pattern suitable for the
>    underlying filesystem.  PATTERN can use \ under Unix and " in Windows
>    to quote wildcard characters.

I installed something similar.

Subject: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern'
From: "Drew Adams" <[email-masked]>
To: <[email-masked]>
Date: Sun, 8 Mar 2009 23:23:39 -0700

This is not so much a bug report as a report of a possible bug, or at
least a question.
 
The code of `shell-quote-wildcard-pattern' has this test:
(memq system-type '(ms-dos windows-nt cygwin)).  Looking at that
code, the inclusion of `cygwin' here seems suspect to me.
 
The Elisp manual says only that a `system-type' of `cygwin' means
Emacs running on Cygwin ("type of operating system Emacs is operating
on"). Dunno what that means, really, but I'm guessing that such a
system would use a shell, such as `bash', that treats characters in
file names similarly to how `bash' treats them for GNU/Linux or UNIX.
 
I use Emacs on Windows, but not built on Cygwin. I use it with Cygwin
and with `bash' as my shell, however, and that is how the shell
behaves for me.  I have no problem with `shell-quote-wildcard-pattern'
AFAIK (my `system-type' is `windows-nt'), but I'm guessing that
someone with a `system-type' of `cygwin' might have trouble with it.
 
If these guesses are wrong, then please ignore this report.
 
If these guesses are correct, then perhaps `cygwin' should be removed
from that `system-type' test. The code would then treat `cygwin' Emacs
like Emacs on UNIX or GNU/Linux, as far as quoting file-name chars in
shell commands is concerned.

In GNU Emacs 23.0.90.1 (i386-mingw-nt5.1.2600)
 of 2009-02-01 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'