From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] system-type cygwin with window-system w32 Date: Mon, 18 Jul 2011 00:01:30 -0700 Message-ID: <4E23DA4A.1080301@gmail.com> References: <4E2377E2.1020804@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig96E1389C898D9584948853E6" X-Trace: dough.gmane.org 1310972855 31079 80.91.229.12 (18 Jul 2011 07:07:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2011 07:07:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 18 09:07:27 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 1QihvJ-0006J4-Ut for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 09:07:26 +0200 Original-Received: from localhost ([::1]:53188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QihvI-00086R-P3 for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2011 03:07:24 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qihpo-0006l2-4M for emacs-devel@gnu.org; Mon, 18 Jul 2011 03:01:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qihpm-0000qV-5Y for emacs-devel@gnu.org; Mon, 18 Jul 2011 03:01:43 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:40712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qihpj-0000pr-Ee; Mon, 18 Jul 2011 03:01:39 -0400 Original-Received: by iwn8 with SMTP id 8so3075093iwn.0 for ; Mon, 18 Jul 2011 00:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; bh=QbMBKCpweQh8fCHjBfxNZR9RqhvY+LbZS+b5TaEZ7l8=; b=Fk3w3vALt4d82Pd8tiMH26tnvLW2kaPGkbf9VeHkIUo8Op6QkpczGvvVpLd6nD/IrT bmav1OpXaKb9gbe/rfXea2P81VE9aOQSKohXweNfhGq9OwoeqVnIWhyLpavW3NsCkLdt 4qYouheQ3VkAG9SUBqCLnkEpqGnt3eJN6AdoI= Original-Received: by 10.42.28.10 with SMTP id l10mr7373600icc.299.1310972498537; Mon, 18 Jul 2011 00:01:38 -0700 (PDT) Original-Received: from [192.168.1.2] (c-24-18-179-193.hsd1.wa.comcast.net [24.18.179.193]) by mx.google.com with ESMTPS id v3sm2727821ibh.67.2011.07.18.00.01.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jul 2011 00:01:37 -0700 (PDT) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: X-Enigmail-Version: 1.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.169 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:142089 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig96E1389C898D9584948853E6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/17/11 11:53 PM, Eli Zaretskii wrote: > Could you please explain this part of the patch: >=20 >> /* Create the dialog with PROMPT as title, using DIR as initial >> directory and using "*" as pattern. */ >> - dir =3D Fexpand_file_name (dir, Qnil); >> - strncpy (init_dir, SDATA (ENCODE_FILE (dir)), MAX_PATH); >> - init_dir[MAX_PATH] =3D '\0'; >> - unixtodos_filename (init_dir); >> - >> - if (STRINGP (default_filename)) >> - { >> - char *file_name_only; >> - char *full_path_name =3D SDATA (ENCODE_FILE (default_filename))= ; >> - >> - unixtodos_filename (full_path_name); >> - >> - file_name_only =3D strrchr (full_path_name, '\\'); >> - if (!file_name_only) >> - file_name_only =3D full_path_name; >> - else >> - file_name_only++; >> - >> - strncpy (filename, file_name_only, MAX_PATH); >> - filename[MAX_PATH] =3D '\0'; >> - } >> - else >> - filename[0] =3D '\0'; >> - >> - /* The code in file_dialog_callback that attempts to set the text >> - of the file name edit window when handling the CDN_INITDONE >> - WM_NOTIFY message does not work. Setting filename to "Current >> - Directory" in the only_dir_p case here does work however. */ >> - if (filename[0] =3D=3D 0 && ! NILP (only_dir_p)) >> - strcpy (filename, "Current Directory"); >> + to_unicode (Fexpand_file_name (dir, Qnil), &dir); >> + >> + to_unicode (build_string ("All Files (*.*)\0*.*\0Directories\0*|*\0= \0"), >> + &filter); >=20 > 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? IIUC, Unicode is strictly a superset of all the single-byte encoding schemes supported by Windows. > If my analysis is correct, could you please explain the rationale for > this change? 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? (I want to stub out the path conversion functions for native NT builds.) --------------enig96E1389C898D9584948853E6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk4j2k4ACgkQ17c2LVA10VtE8wCgur4UubP1kzQhbENTC5ZASvto slkAnRFijVvQJlfIInN2tpOoaRVdRq6T =13eq -----END PGP SIGNATURE----- --------------enig96E1389C898D9584948853E6--