From unknown Mon Jun 23 09:36:35 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern' Reply-To: "Drew Adams" , 2607@debbugs.gnu.org Resent-From: "Drew Adams" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 09 Mar 2009 06:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 2607 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123657983113978 (code B ref -1); Mon, 09 Mar 2009 06:30:03 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 9 Mar 2009 06:23:51 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n296NlZQ013966 for ; Sun, 8 Mar 2009 23:23:49 -0700 Received: from mail.gnu.org ([66.92.78.42]:35000 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LgYtv-0007fN-7T for emacs-pretest-bug@gnu.org; Mon, 09 Mar 2009 02:23:47 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LgYto-0003Hr-LV for emacs-pretest-bug@gnu.org; Mon, 09 Mar 2009 02:23:46 -0400 Received: from acsinet11.oracle.com ([141.146.126.233]:53665) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LgYto-0003Hh-3N for emacs-pretest-bug@gnu.org; Mon, 09 Mar 2009 02:23:40 -0400 Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n296OFPA008619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Mar 2009 06:24:16 GMT Received: from acsmt703.oracle.com (acsmt703.oracle.com [141.146.40.81]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n296NmlH017911 for ; Mon, 9 Mar 2009 06:23:49 GMT Received: from dradamslap1 (/141.144.168.181) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Mar 2009 06:23:33 +0000 From: "Drew Adams" To: Date: Sun, 8 Mar 2009 23:23:39 -0700 Message-ID: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acmgf5YOpAFjtMUjTBuJDuQHV1dEtw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt703.oracle.com [141.146.40.81] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090204.49B4B5E6.021F:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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)' From unknown Mon Jun 23 09:36:35 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern' Reply-To: Eli Zaretskii , 2607@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 09 Mar 2009 22:40:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2607 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2607-submit@emacsbugs.donarmstrong.com id=B2607.123663796313702 (code B ref 2607); Mon, 09 Mar 2009 22:40:06 +0000 Received: (at 2607) by emacsbugs.donarmstrong.com; 9 Mar 2009 22:32:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mtaout5.012.net.il (mtaout5.012.net.il [84.95.2.13]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n29MWcrG013688 for <2607@emacsbugs.donarmstrong.com>; Mon, 9 Mar 2009 15:32:40 -0700 Received: from conversion-daemon.i_mtaout5.012.net.il by i_mtaout5.012.net.il (HyperSendmail v2004.12) id <0KG900000FU5M500@i_mtaout5.012.net.il> for 2607@emacsbugs.donarmstrong.com; Tue, 10 Mar 2009 00:31:17 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.183.217]) by i_mtaout5.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KG90002HFW1E7V1@i_mtaout5.012.net.il>; Tue, 10 Mar 2009 00:31:14 +0200 (IST) Date: Tue, 10 Mar 2009 00:31:00 +0200 From: Eli Zaretskii In-reply-to: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> X-012-Sender: halo1@inter.net.il To: Drew Adams , 2607@debbugs.gnu.org Message-id: References: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> > From: "Drew Adams" > Date: Sun, 8 Mar 2009 23:23:39 -0700 > Cc: > > 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. Cygwin is in the same list because Cygwin runs on Windows, and Windows does not allow the `"' character in file names. It's true that Cygwin uses Bash as the shell, but no shell can fix what the underlying filesystem does not support. From unknown Mon Jun 23 09:36:35 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern' Reply-To: "Drew Adams" , 2607@debbugs.gnu.org Resent-From: "Drew Adams" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 09 Mar 2009 22:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2607 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2607-submit@emacsbugs.donarmstrong.com id=B2607.123663844416294 (code B ref 2607); Mon, 09 Mar 2009 22:45:02 +0000 Received: (at 2607) by emacsbugs.donarmstrong.com; 9 Mar 2009 22:40:44 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from rgminet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n29Mef2U016288 for <2607@emacsbugs.donarmstrong.com>; Mon, 9 Mar 2009 15:40:42 -0700 Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n29MfiNG018704 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Mar 2009 22:41:46 GMT Received: from acsmt703.oracle.com (acsmt703.oracle.com [141.146.40.81]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n29MeYfw023860; Mon, 9 Mar 2009 22:40:36 GMT Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Mar 2009 22:40:30 +0000 From: "Drew Adams" To: "'Eli Zaretskii'" , <2607@debbugs.gnu.org> References: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> Date: Mon, 9 Mar 2009 15:40:32 -0700 Message-ID: <010401c9a108$0e5a9ec0$c2b22382@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcmhBwBhJh0jzyMQQCS0E5t/Pye4hwAAEt2A X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt703.oracle.com [141.146.40.81] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010202.49B59AE0.00F4:SCFSTAT928724,ss=1,fgs=0 > > 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. > > Cygwin is in the same list because Cygwin runs on Windows, and Windows > does not allow the `"' character in file names. It's true that Cygwin > uses Bash as the shell, but no shell can fix what the underlying > filesystem does not support. OK, thanks for checking. I'm not claiming the code is wrong; I just thought it might be. For me, using `bash' with Cygwin, but with Emacs built natively, escaping the chars that are handled in the UNIX part of the code makes most sense. But yes, the `"' thing is of course true. That seems to be a separate matter. It was mainly the set of chars for which escaping occurs that seemed to me might better follow the UNIX model (for Cygwin). But if you've checked the code and feel it is right, that's good enough for me. From unknown Mon Jun 23 09:36:35 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern' Reply-To: Stefan Monnier , 2607@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 10 Mar 2009 01:20:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2607 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2607-submit@emacsbugs.donarmstrong.com id=B2607.123664767924561 (code B ref 2607); Tue, 10 Mar 2009 01:20:04 +0000 Received: (at 2607) by emacsbugs.donarmstrong.com; 10 Mar 2009 01:14:39 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.4 required=4.0 tests=FOURLA,HAS_BUG_NUMBER, XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2A1EavU024553 for <2607@emacsbugs.donarmstrong.com>; Mon, 9 Mar 2009 18:14:37 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlAFAEBbtUnO+KDF/2dsb2JhbACBTs8zhAUGhCE X-IronPort-AV: E=Sophos;i="4.38,332,1233550800"; d="scan'208";a="34937999" Received: from 206-248-160-197.dsl.teksavvy.com (HELO ceviche.home) ([206.248.160.197]) by ironport2-out.teksavvy.com with ESMTP; 09 Mar 2009 21:14:30 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 72D2EB403E; Mon, 9 Mar 2009 21:14:30 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Cc: 2607@debbugs.gnu.org, Drew Adams Message-ID: References: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> Date: Mon, 09 Mar 2009 21:14:30 -0400 In-Reply-To: (Eli Zaretskii's message of "Tue, 10 Mar 2009 00:31:00 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >> 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. > Cygwin is in the same list because Cygwin runs on Windows, and Windows > does not allow the `"' character in file names. It's true that Cygwin > uses Bash as the shell, but no shell can fix what the underlying > filesystem does not support. 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. And furthermore, even seeing the code, I don't understand what is this special case supposed to be used for. Stefan From unknown Mon Jun 23 09:36:35 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern' Reply-To: Eli Zaretskii , 2607@debbugs.gnu.org Resent-From: Eli Zaretskii Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 10 Mar 2009 20:10:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2607 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2607-submit@emacsbugs.donarmstrong.com id=B2607.123671533824801 (code B ref 2607); Tue, 10 Mar 2009 20:10:05 +0000 Received: (at 2607) by emacsbugs.donarmstrong.com; 10 Mar 2009 20:02:18 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mtaout2.012.net.il (mtaout2.012.net.il [84.95.2.4]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2AK2ExR024794 for <2607@emacsbugs.donarmstrong.com>; Tue, 10 Mar 2009 13:02:15 -0700 Received: from conversion-daemon.i_mtaout2.012.net.il by i_mtaout2.012.net.il (HyperSendmail v2004.12) id <0KGB008003JPHX00@i_mtaout2.012.net.il> for 2607@emacsbugs.donarmstrong.com; Tue, 10 Mar 2009 22:02:52 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.183.217]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KGB003RA3OPGOI0@i_mtaout2.012.net.il>; Tue, 10 Mar 2009 22:02:50 +0200 (IST) Date: Tue, 10 Mar 2009 22:02:04 +0200 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier Cc: 2607@debbugs.gnu.org, drew.adams@oracle.com Message-id: References: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> > From: Stefan Monnier > Cc: 2607@emacsbugs.donarmstrong.com, Drew Adams > 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? From unknown Mon Jun 23 09:36:35 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern' Reply-To: Stefan Monnier , 2607@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 11 Mar 2009 02:10:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 2607 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 2607-submit@emacsbugs.donarmstrong.com id=B2607.123673696019590 (code B ref 2607); Wed, 11 Mar 2009 02:10:05 +0000 Received: (at 2607) by emacsbugs.donarmstrong.com; 11 Mar 2009 02:02:40 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2B22adS019583 for <2607@emacsbugs.donarmstrong.com>; Tue, 10 Mar 2009 19:02:38 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhIFALO4tklFxL+1/2dsb2JhbACBTtBUhA0GhCU X-IronPort-AV: E=Sophos;i="4.38,338,1233550800"; d="scan'208";a="35015379" Received: from 69-196-191-181.dsl.teksavvy.com (HELO ceviche.home) ([69.196.191.181]) by ironport2-out.teksavvy.com with ESMTP; 10 Mar 2009 22:02:30 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 6865FB4121; Tue, 10 Mar 2009 22:02:30 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Cc: 2607@debbugs.gnu.org, drew.adams@oracle.com Message-ID: References: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> Date: Tue, 10 Mar 2009 22:02:30 -0400 In-Reply-To: (Eli Zaretskii's message of "Tue, 10 Mar 2009 22:02:04 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Wonderful, isn't it? code that solves a non-trivial problem by doing > absolutely nothing? Awesome! > 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. OK, I now kind of understand what it does, but... >> 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? ... why is this behavior useful? I.e. when is it useful to have this function be idempotent? [... thinking ...] 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. -- Stefan From unknown Mon Jun 23 09:36:35 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: "Drew Adams" Subject: bug#2607 closed by Eli Zaretskii (Re: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern') Message-ID: References: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> X-Emacs-PR-Message: they-closed 2607 X-Emacs-PR-Package: emacs Reply-To: 2607@debbugs.gnu.org Date: Sat, 28 Mar 2009 12:35:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1238243703-28867-1" This is a multi-part message in MIME format... ------------=_1238243703-28867-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 . 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 by replying to this email. --=20 2607: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2607 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1238243703-28867-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 2607-done) by emacsbugs.donarmstrong.com; 28 Mar 2009 12:29:17 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mtaout6.012.net.il (mtaout6.012.net.il [84.95.2.16]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2SCTD40027533 for <2607-done@emacsbugs.donarmstrong.com>; Sat, 28 Mar 2009 05:29:15 -0700 Received: from conversion-daemon.i-mtaout6.012.net.il by i-mtaout6.012.net.il (HyperSendmail v2007.08) id <0KH700000UM1M300@i-mtaout6.012.net.il> for 2607-done@emacsbugs.donarmstrong.com; Sat, 28 Mar 2009 15:29:07 +0300 (IDT) Received: from HOME-C4E4A596F7 ([77.127.23.114]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KH7006OVUOID1D0@i-mtaout6.012.net.il>; Sat, 28 Mar 2009 15:29:07 +0300 (IDT) Date: Sat, 28 Mar 2009 15:27:04 +0300 From: Eli Zaretskii Subject: Re: bug#2607: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern' In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier Cc: 2607-done@debbugs.gnu.org, drew.adams@oracle.com Reply-to: Eli Zaretskii Message-id: References: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> > From: Stefan Monnier > Cc: 2607@emacsbugs.donarmstrong.com, drew.adams@oracle.com > 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. ------------=_1238243703-28867-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 9 Mar 2009 06:23:51 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n296NlZQ013966 for ; Sun, 8 Mar 2009 23:23:49 -0700 Received: from mail.gnu.org ([66.92.78.42]:35000 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LgYtv-0007fN-7T for emacs-pretest-bug@gnu.org; Mon, 09 Mar 2009 02:23:47 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LgYto-0003Hr-LV for emacs-pretest-bug@gnu.org; Mon, 09 Mar 2009 02:23:46 -0400 Received: from acsinet11.oracle.com ([141.146.126.233]:53665) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LgYto-0003Hh-3N for emacs-pretest-bug@gnu.org; Mon, 09 Mar 2009 02:23:40 -0400 Received: from acsinet13.oracle.com (acsinet13.oracle.com [141.146.126.235]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n296OFPA008619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Mar 2009 06:24:16 GMT Received: from acsmt703.oracle.com (acsmt703.oracle.com [141.146.40.81]) by acsinet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n296NmlH017911 for ; Mon, 9 Mar 2009 06:23:49 GMT Received: from dradamslap1 (/141.144.168.181) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Mar 2009 06:23:33 +0000 From: "Drew Adams" To: Subject: 23.0.90; `system-type' test in `shell-quote-wildcard-pattern' Date: Sun, 8 Mar 2009 23:23:39 -0700 Message-ID: <005601c9a07f$96946c50$0200a8c0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acmgf5YOpAFjtMUjTBuJDuQHV1dEtw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt703.oracle.com [141.146.40.81] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090204.49B4B5E6.021F:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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)' ------------=_1238243703-28867-1--