From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Request to support Cygwin in convert-standard-filename function Date: Sun, 12 Jun 2016 10:11:14 +0300 Message-ID: <837fduhofh.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1465715468 32286 80.91.229.3 (12 Jun 2016 07:11:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jun 2016 07:11:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: Xi Shen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 12 09:11:03 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bBzXz-0006By-Bz for ged-emacs-devel@m.gmane.org; Sun, 12 Jun 2016 09:11:03 +0200 Original-Received: from localhost ([::1]:50042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBzXy-0005bd-Ha for ged-emacs-devel@m.gmane.org; Sun, 12 Jun 2016 03:11:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBzXT-0005bY-PI for emacs-devel@gnu.org; Sun, 12 Jun 2016 03:10:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBzXO-00013X-MB for emacs-devel@gnu.org; Sun, 12 Jun 2016 03:10:30 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBzXO-00013T-J5; Sun, 12 Jun 2016 03:10:26 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1949 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bBzXN-0000Ad-Iu; Sun, 12 Jun 2016 03:10:26 -0400 In-reply-to: (message from Xi Shen on Sun, 12 Jun 2016 02:51:14 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204306 Archived-At: > 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.