Commit 087fc47a authored by Juanma Barranquero's avatar Juanma Barranquero

Turn `directory-sep-char' into a noop.

* lisp/subr.el (directory-sep-char): Move from fileio.c and make a defconst.

* src/emacs.c (decode_env_path): Don't check DIRECTORY_SEP,
  call dostounix_filename directly.

* src/fileio.c (CORRECT_DIR_SEPS): Remove.
  (Ffile_name_directory, directory_file_name, Fexpand_file_name)
  (Fsubstitute_in_file_name): Use dostounix_filename instead.
  (file_name_as_directory): Use dostounix_filename, DIRECTORY_SEP.
  (syms_of_fileio) <directory-sep-char>: Move to subr.el.

* src/lisp.h [WINDOWSNT] (Vdirectory_sep_char): Don't declare.
  (DIRECTORY_SEP): Define unconditionally.

* src/w32proc.c (CORRECT_DIR_SEPS): Remove.
  (Fw32_short_file_name, Fw32_long_file_name): Use dostounix_filename.

* src/s/ms-w32.h (DIRECTORY_SEP): Remove.
parent 4f201088
2010-06-04 Juanma Barranquero <lekktu@gmail.com>
* subr.el (directory-sep-char): Move from fileio.c and make a defconst.
2010-06-04 Michael Albinus <michael.albinus@gmx.de> 2010-06-04 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/". * net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
......
...@@ -1089,7 +1089,11 @@ is converted into a string by expressing it in decimal." ...@@ -1089,7 +1089,11 @@ is converted into a string by expressing it in decimal."
(make-obsolete 'process-filter-multibyte-p nil "23.1") (make-obsolete 'process-filter-multibyte-p nil "23.1")
(make-obsolete 'set-process-filter-multibyte nil "23.1") (make-obsolete 'set-process-filter-multibyte nil "23.1")
(make-obsolete-variable 'directory-sep-char "do not use it." "21.1") (defconst directory-sep-char ?/
"Directory separator character for built-in functions that return file names.
The value is always ?/.")
(make-obsolete-variable 'directory-sep-char "do not use it, just use `/'." "21.1")
(make-obsolete-variable (make-obsolete-variable
'mode-line-inverse-video 'mode-line-inverse-video
"use the appropriate faces instead." "use the appropriate faces instead."
......
2010-06-04 Juanma Barranquero <lekktu@gmail.com>
Turn `directory-sep-char' into a noop.
* lisp.h [WINDOWSNT] (Vdirectory_sep_char): Don't declare.
(DIRECTORY_SEP): Define unconditionally.
* s/ms-w32.h (DIRECTORY_SEP): Remove.
* emacs.c (decode_env_path): Don't check DIRECTORY_SEP,
call dostounix_filename directly.
* fileio.c (CORRECT_DIR_SEPS): Remove.
(Ffile_name_directory, directory_file_name, Fexpand_file_name)
(Fsubstitute_in_file_name): Use dostounix_filename instead.
(file_name_as_directory): Use dostounix_filename, DIRECTORY_SEP.
(syms_of_fileio) <directory-sep-char>: Move to subr.el.
* w32proc.c (CORRECT_DIR_SEPS): Remove.
(Fw32_short_file_name, Fw32_long_file_name): Use dostounix_filename.
2010-06-03 Dan Nicolaescu <dann@ics.uci.edu> 2010-06-03 Dan Nicolaescu <dann@ics.uci.edu>
Move UNEXEC definition to autoconf. Move UNEXEC definition to autoconf.
......
...@@ -1723,7 +1723,7 @@ main (int argc, char **argv) ...@@ -1723,7 +1723,7 @@ main (int argc, char **argv)
#endif #endif
init_window (); init_window ();
init_font (); init_font ();
if (!initialized) if (!initialized)
{ {
char *file; char *file;
...@@ -2384,10 +2384,7 @@ decode_env_path (evarname, defalt) ...@@ -2384,10 +2384,7 @@ decode_env_path (evarname, defalt)
strcpy (p, path); strcpy (p, path);
path = p; path = p;
if ('/' == DIRECTORY_SEP) dostounix_filename (path);
dostounix_filename (path);
else
unixtodos_filename (path);
} }
#endif #endif
lpath = Qnil; lpath = Qnil;
......
...@@ -83,10 +83,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -83,10 +83,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif #endif
#ifdef DOS_NT #ifdef DOS_NT
#define CORRECT_DIR_SEPS(s) \
do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
else unixtodos_filename (s); \
} while (0)
/* On Windows, drive letters must be alphabetic - on DOS, the Netware /* On Windows, drive letters must be alphabetic - on DOS, the Netware
redirector allows the six letters between 'Z' and 'a' as well. */ redirector allows the six letters between 'Z' and 'a' as well. */
#ifdef MSDOS #ifdef MSDOS
...@@ -474,7 +470,7 @@ Given a Unix syntax file name, returns a string ending in slash. */) ...@@ -474,7 +470,7 @@ Given a Unix syntax file name, returns a string ending in slash. */)
p = beg + strlen (beg); p = beg + strlen (beg);
} }
} }
CORRECT_DIR_SEPS (beg); dostounix_filename (beg);
#endif /* DOS_NT */ #endif /* DOS_NT */
return make_specified_string (beg, -1, p - beg, STRING_MULTIBYTE (filename)); return make_specified_string (beg, -1, p - beg, STRING_MULTIBYTE (filename));
...@@ -561,12 +557,11 @@ file_name_as_directory (out, in) ...@@ -561,12 +557,11 @@ file_name_as_directory (out, in)
/* For Unix syntax, Append a slash if necessary */ /* For Unix syntax, Append a slash if necessary */
if (!IS_DIRECTORY_SEP (out[size])) if (!IS_DIRECTORY_SEP (out[size]))
{ {
/* Cannot use DIRECTORY_SEP, which could have any value */ out[size + 1] = DIRECTORY_SEP;
out[size + 1] = '/';
out[size + 2] = '\0'; out[size + 2] = '\0';
} }
#ifdef DOS_NT #ifdef DOS_NT
CORRECT_DIR_SEPS (out); dostounix_filename (out);
#endif #endif
return out; return out;
} }
...@@ -627,7 +622,7 @@ directory_file_name (src, dst) ...@@ -627,7 +622,7 @@ directory_file_name (src, dst)
) )
dst[slen - 1] = 0; dst[slen - 1] = 0;
#ifdef DOS_NT #ifdef DOS_NT
CORRECT_DIR_SEPS (dst); dostounix_filename (dst);
#endif #endif
return 1; return 1;
} }
...@@ -1032,10 +1027,9 @@ filesystem tree, not (expand-file-name ".." dirname). */) ...@@ -1032,10 +1027,9 @@ filesystem tree, not (expand-file-name ".." dirname). */)
if (!lose) if (!lose)
{ {
#ifdef DOS_NT #ifdef DOS_NT
/* Make sure directories are all separated with / or \ as /* Make sure directories are all separated with /, but
desired, but avoid allocation of a new string when not avoid allocation of a new string when not required. */
required. */ dostounix_filename (nm);
CORRECT_DIR_SEPS (nm);
#ifdef WINDOWSNT #ifdef WINDOWSNT
if (IS_DIRECTORY_SEP (nm[1])) if (IS_DIRECTORY_SEP (nm[1]))
{ {
...@@ -1381,7 +1375,7 @@ filesystem tree, not (expand-file-name ".." dirname). */) ...@@ -1381,7 +1375,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
target[0] = '/'; target[0] = '/';
target[1] = ':'; target[1] = ':';
} }
CORRECT_DIR_SEPS (target); dostounix_filename (target);
#endif /* DOS_NT */ #endif /* DOS_NT */
result = make_specified_string (target, -1, o - target, multibyte); result = make_specified_string (target, -1, o - target, multibyte);
...@@ -1659,7 +1653,7 @@ those `/' is discarded. */) ...@@ -1659,7 +1653,7 @@ those `/' is discarded. */)
bcopy (SDATA (filename), nm, SBYTES (filename) + 1); bcopy (SDATA (filename), nm, SBYTES (filename) + 1);
#ifdef DOS_NT #ifdef DOS_NT
CORRECT_DIR_SEPS (nm); dostounix_filename (nm);
substituted = (strcmp (nm, SDATA (filename)) != 0); substituted = (strcmp (nm, SDATA (filename)) != 0);
#endif #endif
endp = nm + SBYTES (filename); endp = nm + SBYTES (filename);
...@@ -5787,11 +5781,6 @@ of file names regardless of the current language environment. */); ...@@ -5787,11 +5781,6 @@ of file names regardless of the current language environment. */);
Fput (Qfile_date_error, Qerror_message, Fput (Qfile_date_error, Qerror_message,
make_pure_c_string ("Cannot set file date")); make_pure_c_string ("Cannot set file date"));
DEFVAR_LISP ("directory-sep-char", &Vdirectory_sep_char,
doc: /* Directory separator character for built-in functions that return file names.
The value is always ?/. Don't use this variable, just use `/'. */);
XSETFASTINT (Vdirectory_sep_char, '/');
DEFVAR_LISP ("file-name-handler-alist", &Vfile_name_handler_alist, DEFVAR_LISP ("file-name-handler-alist", &Vfile_name_handler_alist,
doc: /* *Alist of elements (REGEXP . HANDLER) for file names handled specially. doc: /* *Alist of elements (REGEXP . HANDLER) for file names handled specially.
If a file name matches REGEXP, then all I/O on that file is done by calling If a file name matches REGEXP, then all I/O on that file is done by calling
......
...@@ -3509,16 +3509,10 @@ extern char *egetenv P_ ((char *)); ...@@ -3509,16 +3509,10 @@ extern char *egetenv P_ ((char *));
extern void init_system_name P_ ((void)); extern void init_system_name P_ ((void));
/* Some systems (e.g., NT) use a different path separator than Unix, /* Some systems (e.g., NT) use a different path separator than Unix,
in addition to a device separator. Default the path separator in addition to a device separator. Set the path separator
to '/', and don't test for a device separator in IS_ANY_SEP. */ to '/', and don't test for a device separator in IS_ANY_SEP. */
#ifdef WINDOWSNT
extern Lisp_Object Vdirectory_sep_char;
#endif
#ifndef DIRECTORY_SEP
#define DIRECTORY_SEP '/' #define DIRECTORY_SEP '/'
#endif
#ifndef IS_DIRECTORY_SEP #ifndef IS_DIRECTORY_SEP
#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
#endif #endif
......
...@@ -95,9 +95,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -95,9 +95,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
your system and must be used only through an encapsulation (which your system and must be used only through an encapsulation (which
you should place, by convention, in sysdep.c). */ you should place, by convention, in sysdep.c). */
/* Define this to be the separator between path elements. */
#define DIRECTORY_SEP XINT (Vdirectory_sep_char)
/* Define this to be the separator between devices and paths. */ /* Define this to be the separator between devices and paths. */
#define DEVICE_SEP ':' #define DEVICE_SEP ':'
......
...@@ -1762,12 +1762,6 @@ socket connections still exist. */) ...@@ -1762,12 +1762,6 @@ socket connections still exist. */)
/* Some miscellaneous functions that are Windows specific, but not GUI /* Some miscellaneous functions that are Windows specific, but not GUI
specific (ie. are applicable in terminal or batch mode as well). */ specific (ie. are applicable in terminal or batch mode as well). */
/* lifted from fileio.c */
#define CORRECT_DIR_SEPS(s) \
do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
else unixtodos_filename (s); \
} while (0)
DEFUN ("w32-short-file-name", Fw32_short_file_name, Sw32_short_file_name, 1, 1, 0, DEFUN ("w32-short-file-name", Fw32_short_file_name, Sw32_short_file_name, 1, 1, 0,
doc: /* Return the short file name version (8.3) of the full path of FILENAME. doc: /* Return the short file name version (8.3) of the full path of FILENAME.
If FILENAME does not exist, return nil. If FILENAME does not exist, return nil.
...@@ -1786,7 +1780,7 @@ All path elements in FILENAME are converted to their short names. */) ...@@ -1786,7 +1780,7 @@ All path elements in FILENAME are converted to their short names. */)
if (GetShortPathName (SDATA (ENCODE_FILE (filename)), shortname, MAX_PATH) == 0) if (GetShortPathName (SDATA (ENCODE_FILE (filename)), shortname, MAX_PATH) == 0)
return Qnil; return Qnil;
CORRECT_DIR_SEPS (shortname); dostounix_filename (shortname);
return build_string (shortname); return build_string (shortname);
} }
...@@ -1815,7 +1809,7 @@ All path elements in FILENAME are converted to their long names. */) ...@@ -1815,7 +1809,7 @@ All path elements in FILENAME are converted to their long names. */)
if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, MAX_PATH)) if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, MAX_PATH))
return Qnil; return Qnil;
CORRECT_DIR_SEPS (longname); dostounix_filename (longname);
/* If we were passed only a drive, make sure that a slash is not appended /* If we were passed only a drive, make sure that a slash is not appended
for consistency with directories. Allow for drive mapping via SUBST for consistency with directories. Allow for drive mapping via SUBST
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment