]> code.delx.au - gnu-emacs/commitdiff
Updated documentation.
authorEli Zaretskii <eliz@gnu.org>
Sat, 7 Dec 2013 16:51:33 +0000 (18:51 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 7 Dec 2013 16:51:33 +0000 (18:51 +0200)
doc/emacs/mule.texi
doc/lispref/nonascii.texi
etc/NEWS
src/fileio.c

index ebddc46be9400fedcfde7ed18b0a1e0090aef184..6efbc2b7190cfe4f3a9aa401ec7a0722a68c428c 100644 (file)
@@ -1130,6 +1130,21 @@ In the default language environment, non-@acronym{ASCII} characters in
 file names are not encoded specially; they appear in the file system
 using the internal Emacs representation.
 
+@cindex file-name encoding, MS-Windows
+@vindex w32-unicode-filenames
+  When Emacs runs on MS-Windows versions that are descendants of the
+NT family (Windows 2000, XP, Vista, Windows 7, and Windows 8), the
+value of @code{file-name-coding-system} is largely ignored, as Emacs
+by default uses APIs that allow to pass Unicode file names directly.
+By contrast, on Windows 9X, file names are encoded using
+@code{file-name-coding-system}, which should be set to the codepage
+(@pxref{Coding Systems, codepage}) pertinent for the current system
+locale.  The value of the variable @code{w32-unicode-filenames}
+controls whether Emacs uses the Unicode APIs when it calls OS
+functions that accept file names.  This variable is set by the startup
+code to @code{nil} on Windows 9X, and to @code{t} on newer versions of
+MS-Windows.
+
   @strong{Warning:} if you change @code{file-name-coding-system} (or the
 language environment) in the middle of an Emacs session, problems can
 result if you have already visited files whose names were encoded using
index 96adb629f37210a9e5b67bc0a2c2561a97224fcd..4132c1f8de0fc7205d5d3fcb1bcb2f04416f590d 100644 (file)
@@ -1108,6 +1108,16 @@ visited file name, saving may use the wrong file name, or it may get
 an error.  If such a problem happens, use @kbd{C-x C-w} to specify a
 new file name for that buffer.
 
+@cindex file-name encoding, MS-Windows
+  On Windows 2000 and later, Emacs by default uses Unicode APIs to
+pass file names to the OS, so the value of
+@code{file-name-coding-system} is largely ignored.  Lisp applications
+that need to encode or decode file names on the Lisp level should use
+@code{utf-8} coding-system when @code{system-type} is
+@code{windows-nt}; the conversion of UTF-8 encoded file names to the
+encoding appropriate for communicating with the OS is performed
+internally by Emacs.
+
 @node Lisp and Coding Systems
 @subsection Coding Systems in Lisp
 
index 132c461b25821876c4ad521e2a13de7c667ca215..5f6cf12fb24053313a41da1e111837e76898f0a1 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -930,6 +930,14 @@ files are in share/emacs/VERSION/etc.  (Emacs knows about all these
 directories and will find the files in there automatically; there's no
 need to set any variables due to this change.)
 
++++
+** Emacs on Windows 2000 and later can now access files and directories
+whose names cannot be encoded in the current system codepage.
+
+The new variable `w32-unicode-filenames' controls this feature: if it
+is t, Emacs uses Unicode APIs to pass file names to system calls,
+which lifts the limitation of file names to the current locale.
+
 +++
 ** The "generate a backtrace on fatal error" feature now works on MS Windows.
 The backtrace is written to the 'emacs_backtrace.txt' file in the
index e5347ce765ad48b9eefd4d41cab59ccafb31aacf..a98ed6b9fa502b1cd0f27f3c5c1b936635027220 100644 (file)
@@ -5849,7 +5849,10 @@ syms_of_fileio (void)
 
   DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system,
               doc: /* Coding system for encoding file names.
-If it is nil, `default-file-name-coding-system' (which see) is used.  */);
+If it is nil, `default-file-name-coding-system' (which see) is used.
+
+On MS-Windows, the value of this variable is largely ignored if
+\`w32-unicode-filenames' (which see) is non-nil.  */);
   Vfile_name_coding_system = Qnil;
 
   DEFVAR_LISP ("default-file-name-coding-system",
@@ -5860,7 +5863,10 @@ This variable is used only when `file-name-coding-system' is nil.
 This variable is set/changed by the command `set-language-environment'.
 User should not set this variable manually,
 instead use `file-name-coding-system' to get a constant encoding
-of file names regardless of the current language environment.  */);
+of file names regardless of the current language environment.
+
+On MS-Windows, the value of this variable is largely ignored if
+\`w32-unicode-filenames' (which see) is non-nil.  */);
   Vdefault_file_name_coding_system = Qnil;
 
   DEFSYM (Qformat_decode, "format-decode");