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: [PATCH] system-type cygwin with window-system w32 Date: Mon, 18 Jul 2011 05:04:25 -0400 Message-ID: References: <4E2377E2.1020804@gmail.com> <4E23DA4A.1080301@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1310980763 10835 80.91.229.12 (18 Jul 2011 09:19:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2011 09:19:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 18 11:19:19 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qijyv-0000zq-TZ for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 11:19:18 +0200 Original-Received: from localhost ([::1]:48306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qijyu-0007kf-R8 for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 05:19:16 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:45696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qijkb-0004hB-6W for emacs-devel@gnu.org; Mon, 18 Jul 2011 05:04:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QijkY-0000Iw-8P for emacs-devel@gnu.org; Mon, 18 Jul 2011 05:04:28 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:34099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QijkX-0000Is-T5 for emacs-devel@gnu.org; Mon, 18 Jul 2011 05:04:26 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QijkX-0005aX-Dd; Mon, 18 Jul 2011 05:04:25 -0400 In-reply-to: <4E23DA4A.1080301@gmail.com> (message from Daniel Colascione on Mon, 18 Jul 2011 00:01:30 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142093 Archived-At: > Date: Mon, 18 Jul 2011 00:01:30 -0700 > From: Daniel Colascione > CC: emacs-devel@gnu.org > > > AFAICT, to_unicode encodes the file name in UTF-16. If so, this will > > not work in the native Windows build, because it does not use Unicode > > APIs for file names. > > Not today, no. > > > In the original code, ENCODE_FILE would use the > > ANSI encoding, not UTF-16. So, unless I'm missing something, the > > replacement is not equivalent to the original, and could break the > > native build. > > Yes, the change would make Emacs Unicode-only --- but every Windows OS > in common use supports unicode. Why would requiring unicode support be > a problem? Two reasons: (1) we still support running Emacs on Windows 9X, where the Unicode file APIs are (AFAIK) not supported, even if unicows.dll is installed; and (2) going Unicode means that all the existing APIs used by Emacs will have to be switched to Unicode. The latter part is a formidable job, involving at the very least reviewing all the file-related code in w32*.c for compatibility. I'm quite sure a large part of that will break, e.g. because it uses `char *' instead of `wchar *' or TCHAR etc. In addition, Posix-like interfaces will need to be amended to use their wide-character counterparts, or emulated with low-level Win32 APIs. Non-file APIs are likely to need similar changes as well, because file names are sometimes read or written from and to other kinds of objects, such as the Registry. I'm all for such a migration, but it's a very large job, and making the change in some small part of the code will simply break Emacs, rather than improve it. > The change needed to be made anyway --- we need to translate between NT > and Cygwin paths now --- so why not transition to unicode at the same > time? See above: it's a much larger job than that. Witness how much time it took Cygwin, with dedicated developers, to make this migration.