all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Request to support Cygwin in convert-standard-filename function
@ 2016-06-12  2:51 Xi Shen
  2016-06-12  7:11 ` Eli Zaretskii
  2016-06-13 12:02 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Xi Shen @ 2016-06-12  2:51 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 957 bytes --]

Hello,

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.

I am eager to hear your feedback.


Thanks,
David

-- 

Thanks,
David S.

[-- Attachment #2: Type: text/html, Size: 1416 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Request to support Cygwin in convert-standard-filename function
  2016-06-12  2:51 Request to support Cygwin in convert-standard-filename function Xi Shen
@ 2016-06-12  7:11 ` Eli Zaretskii
  2016-06-12 10:33   ` Fwd: " Xi Shen
  2016-06-13 12:02 ` Stefan Monnier
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2016-06-12  7:11 UTC (permalink / raw)
  To: Xi Shen; +Cc: emacs-devel

> From: Xi Shen <davidshen84@gmail.com>
> 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.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Fwd: Request to support Cygwin in convert-standard-filename function
  2016-06-12  7:11 ` Eli Zaretskii
@ 2016-06-12 10:33   ` Xi Shen
  2016-06-12 11:32     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Xi Shen @ 2016-06-12 10:33 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

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 <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@gmail.com>
Cc: <emacs-devel@gnu.org>


> From: Xi Shen <davidshen84@gmail.com>
> 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.

[-- Attachment #2: Type: text/html, Size: 2861 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: Request to support Cygwin in convert-standard-filename function
  2016-06-12 10:33   ` Fwd: " Xi Shen
@ 2016-06-12 11:32     ` Nicolas Goaziou
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2016-06-12 11:32 UTC (permalink / raw)
  To: Xi Shen; +Cc: Emacs-orgmode@gnu.org

Hello,

Xi Shen <davidshen84@gmail.com> writes:

> 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.

Fair enough.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Request to support Cygwin in convert-standard-filename function
  2016-06-12  2:51 Request to support Cygwin in convert-standard-filename function Xi Shen
  2016-06-12  7:11 ` Eli Zaretskii
@ 2016-06-13 12:02 ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2016-06-13 12:02 UTC (permalink / raw)
  To: emacs-devel

> 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.

The output of convert-standard-filename is meant to be used *inside*
Emacs, not outside of it.

The purpose of convert-standard-filename is to convert a *standard* file
name such as ~/.emacs for those cases where this standard file name
happens not to work on the system (e.g. because file names can't start
with a ".").


        Stefan




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-13 12:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-12  2:51 Request to support Cygwin in convert-standard-filename function Xi Shen
2016-06-12  7:11 ` Eli Zaretskii
2016-06-12 10:33   ` Fwd: " Xi Shen
2016-06-12 11:32     ` Nicolas Goaziou
2016-06-13 12:02 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.