From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xi Shen Subject: Fwd: Request to support Cygwin in convert-standard-filename function Date: Sun, 12 Jun 2016 10:33:50 +0000 Message-ID: References: <837fduhofh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d48004de9f50535124f54 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bC2iQ-0000Pi-UC for Emacs-orgmode@gnu.org; Sun, 12 Jun 2016 06:34:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bC2iO-0006Vd-IM for Emacs-orgmode@gnu.org; Sun, 12 Jun 2016 06:34:01 -0400 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:34950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bC2iO-0006VX-BM for Emacs-orgmode@gnu.org; Sun, 12 Jun 2016 06:34:00 -0400 Received: by mail-oi0-x230.google.com with SMTP id w5so92152409oib.2 for ; Sun, 12 Jun 2016 03:34:00 -0700 (PDT) In-Reply-To: <837fduhofh.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: "Emacs-orgmode@gnu.org" --001a113d48004de9f50535124f54 Content-Type: text/plain; charset=UTF-8 Hi Nicolas, So according to Emacs upstream developer Eli' reply, the current `convert-standard-filename` function's result is as expected. Since the Cygwin environment is defined as a "Posix" environment. In my patch, I was trying to call a Windows command inside a Posix environment, and intentionally pass a file path in Windows format. This is a very special case, and should be taken care of individually. So I think I will update my patch to add a `org-babel-sql-convert-filename` function. Thanks, David ---------- Forwarded message --------- From: Eli Zaretskii Date: Sun, Jun 12, 2016 at 3:10 PM Subject: Re: Request to support Cygwin in convert-standard-filename function To: Xi Shen Cc: > From: Xi Shen > Date: Sun, 12 Jun 2016 02:51:14 +0000 > > I encounter a problem with `convert-standard-filename`, > https://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-File-Names.html. I call this function > within a Cygwin environment, and this function could not return me a MS-DOS/Windows format path. I think it > treats Cygwin environment as a normal *nix environment. > > In Cygwin environment, the Emacs has a function called `cygwin-convert-file-name-to-windows` which > converts a expanded path to a Windows path, e.g.: > > /cygdrive/c/Windows => c:\Windows > > According to the description of the `convert-standard-filename`, it is expected to be used only in places where > the callee wants to convert a *nix path to the underline OS path. I think it is appropriate we invoke the > `cygwin-convert-file-name-to-windows` function inside the `convert-standard-filename` function if it is called > within a Cygwin environment. Yes, Cygwin is a Posix environment, and convert-standard-filename is documented to be a no-op in such an environment. For the conversion you need, you can call cygwin-convert-file-name-to-windows directly. -- Thanks, David S. --001a113d48004de9f50535124f54 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Nicolas,

So according to Emacs upstr= eam developer Eli' reply, the current `convert-standard-filename` funct= ion's result is as expected. Since the Cygwin environment is defined as= a "Posix" environment. In my patch, I was trying to call a Windo= ws command inside a Posix environment, and intentionally pass a file path i= n Windows format. This is a very special case, and should be taken care of = individually.

So I think I will update my patch to= add a `org-babel-sql-convert-filename` function.

=
Thanks,
David


---------- Forwarded message ---------
From: E= li Zaretskii <eliz@gnu= .org>
Date: Sun, Jun 12, 2016 at 3:10 PM
Subject: Re: Request = to support Cygwin in convert-standard-filename function
To: Xi Shen <= davidshen84@gmai= l.com>
Cc: <emacs-devel@gnu.org>


> From: Xi Shen <= ;davidshen84@gma= il.com>
> Date: Sun, 12 Jun 2016 02:51:14 +0000
>
> I encounter a problem with `convert-standard-filename`,
> https://www.g= nu.org/software/emacs/manual/html_node/elisp/Standard-File-Names.html. = I call this function
> within a Cygwin environment, and this function could not return me a M= S-DOS/Windows format path. I think it
> treats Cygwin environment as a normal *nix environment.
>
> In Cygwin environment, the Emacs has a function called `cygwin-convert= -file-name-to-windows` which
> converts a expanded path to a Windows path, e.g.:
>
> /cygdrive/c/Windows =3D> c:\Windows
>
> According to the description of the `convert-standard-filename`, it is= expected to be used only in places where
> the callee wants to convert a *nix path to the underline OS path. I th= ink it is appropriate we invoke the
> `cygwin-convert-file-name-to-windows` function inside the `convert-sta= ndard-filename` function if it is called
> within a Cygwin environment.

Yes, Cygwin is a Posix environment, and convert-standard-filename is
documented to be a no-op in such an environment.

For the conversion you need, you can call
cygwin-convert-file-name-to-windows directly.
--

Thanks,
David S.

--001a113d48004de9f50535124f54--