GNU bug report logs - #2607
23.0.90; `system-type' test in `shell-quote-wildcard-pattern'

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Mon, 9 Mar 2009 06:30:03 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #25 received at 2607 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 2607 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: 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 <at> iro.umontreal.ca>
> Cc: 2607 <at> emacsbugs.donarmstrong.com,  Drew Adams <drew.adams <at> 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?




This bug report was last modified 16 years and 63 days ago.

Previous Next


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