From 1ab0c851fc0f1d2e1c54196bfaeb67a3bd916741 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 26 Dec 2012 23:55:14 -0800 Subject: [PATCH] Document cygwin-convert-file-name-{to|from}-windows * doc/lispref/files.texi (File Names): Mention Cygwin conversion functions. * src/cygw32.c (Fcygwin_convert_file_name_to_windows) (Fcygwin_convert_file_name_from_windows): Doc fixes. * etc/NEWS: Related markup. --- doc/lispref/ChangeLog | 4 ++++ doc/lispref/files.texi | 10 +++++++++- etc/NEWS | 4 +++- src/ChangeLog | 5 +++++ src/cygw32.c | 18 ++++++++++-------- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 09c70226d5d..f77e68aadc4 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2012-12-27 Glenn Morris + + * files.texi (File Names): Mention Cygwin conversion functions. + 2012-12-22 Martin Rudalics * windows.texi (Selecting Windows): Reword description of diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 863acbe3949..fc01b1cd187 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1699,12 +1699,20 @@ how to manipulate file names. can operate on file names that do not refer to an existing file or directory. +@findex cygwin-convert-file-name-from-windows +@findex cygwin-convert-file-name-to-windows +@cindex MS-Windows file-name syntax +@cindex converting file names from/to MS-Windows syntax On MS-DOS and MS-Windows, these functions (like the function that actually operate on files) accept MS-DOS or MS-Windows file-name syntax, where backslashes separate the components, as well as Unix syntax; but they always return Unix syntax. This enables Lisp programs to specify file names in Unix syntax and work properly on all systems without -change. +change.@footnote{In MS-Windows versions of Emacs compiled for the Cygwin +environment, you can use the functions +@code{cygwin-convert-file-name-to-windows} and +@code{cygwin-convert-file-name-from-windows} to convert between the +two file-name syntaxes.} @menu * File Name Components:: The directory part of a file name, and the rest. diff --git a/etc/NEWS b/etc/NEWS index 4cf2e9d6da9..292d2d04a13 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -997,14 +997,16 @@ takes precedence over most other maps for a short while (normally one key). ** Cygwin builds can use the native MS Windows user interface. Pass --with-w32 to configure. The default remains the X11 interface. ++++ ** Two new functions are available in Cygwin builds: `cygwin-convert-file-name-from-windows' and `cygwin-convert-file-name-to-windows'. These functions allow Lisp code to access the Cygwin file-name mapping machinery to convert between Cygwin and Windows-native file and directory names. +--- ** When invoked with the -nw switch to run on the Windows text-mode terminal, -Emacs now supports mouse highlight, help-echo (in the echo area), and +Emacs now supports `mouse-highlight', help-echo (in the echo area), and `mouse-autoselect-window'. +++ diff --git a/src/ChangeLog b/src/ChangeLog index c8cc486a9de..fccdc1dfcae 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-12-27 Glenn Morris + + * cygw32.c (Fcygwin_convert_file_name_to_windows) + (Fcygwin_convert_file_name_from_windows): Doc fixes. + 2012-12-24 Eli Zaretskii * fileio.c (file_name_as_directory, directory_file_name): Accept diff --git a/src/cygw32.c b/src/cygw32.c index d9777d5e22e..5873a05dcf0 100644 --- a/src/cygw32.c +++ b/src/cygw32.c @@ -110,23 +110,25 @@ DEFUN ("cygwin-convert-file-name-to-windows", Fcygwin_convert_file_name_to_windows, Scygwin_convert_file_name_to_windows, 1, 2, 0, - doc: /* Convert PATH to a Windows path. If ABSOLUTE-P is -non-nil, return an absolute path.*/) - (Lisp_Object path, Lisp_Object absolute_p) + doc: /* Convert a Cygwin file name FILE to a Windows-style file name. +If ABSOLUTE-P is non-nil, return an absolute file name. +For the reverse operation, see `cygwin-convert-file-name-from-windows'. */) + (Lisp_Object file, Lisp_Object absolute_p) { return from_unicode ( - conv_filename_to_w32_unicode (path, EQ (absolute_p, Qnil) ? 0 : 1)); + conv_filename_to_w32_unicode (file, EQ (absolute_p, Qnil) ? 0 : 1)); } DEFUN ("cygwin-convert-file-name-from-windows", Fcygwin_convert_file_name_from_windows, Scygwin_convert_file_name_from_windows, 1, 2, 0, - doc: /* Convert a Windows path to a Cygwin path. If ABSOLUTE-P -is non-nil, return an absolute path.*/) - (Lisp_Object path, Lisp_Object absolute_p) + doc: /* Convert a Windows-style file name FILE to a Cygwin file name. +If ABSOLUTE-P is non-nil, return an absolute file name. +For the reverse operation, see `cygwin-convert-file-name-to-windows'. */) + (Lisp_Object file, Lisp_Object absolute_p) { - return conv_filename_from_w32_unicode (to_unicode (path, &path), + return conv_filename_from_w32_unicode (to_unicode (file, &file), EQ (absolute_p, Qnil) ? 0 : 1); } -- 2.11.4.GIT