[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern'
From: |
Eli Zaretskii |
Subject: |
bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern' |
Date: |
Tue, 10 Mar 2009 22:02:04 +0200 |
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: 2607@emacsbugs.donarmstrong.com, Drew Adams <drew.adams@oracle.com>
> Date: Mon, 09 Mar 2009 21:14:30 -0400
>
> BTW, Reading the docstring makes me wonder what this function is really
> intended to do. Especially the last sentence:
>
> Existing quote characters in PATTERN are left alone, so you can pass
> PATTERN that already quotes some of the special characters.
>
> I see what it corresponds to in the DOS part of the code, but I don't
> see anything equivalent in the Unix side.
Wonderful, isn't it? code that solves a non-trivial problem by doing
absolutely nothing?
Seriously, though: that function does do what the doc string promises,
on Unix as well as on DOS/Windows. It does that by not quoting the
Unix quote character: the backslash itself. Thus
(shell-quote-wildcard-pattern "'foo*")
=> "\\'foo*"
but
(shell-quote-wildcard-pattern "foo\\*")
=> "foo\\*"
Perhaps we should make the doc string less of a riddle by saying
explicitly that "quote characters" in this context means " on Windows
and backslash on Unix.
> And furthermore, even seeing the code, I don't understand what is
> this special case supposed to be used for.
Sorry, I don't understand: what special case did you have in mind?