From 98d8b17e45bb1246df61e51f8917b98faa9f1cdd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 15 May 2010 11:31:40 +0300 Subject: Don't override standard definition of convert-standard-filename. Add obsolete aliases for dos-fns.el functions. files.el (convert-standard-filename): Call w32-convert-standard-filename and dos-convert-standard-filename on the corresponding systems. w32-fns.el (w32-convert-standard-filename): Rename from convert-standard-filename. Doc fix. dos-fns.el (dos-convert-standard-filename): Doc fix. (convert-standard-filename): Don't defalias. (register-name-alist, make-register, register-value) (set-register-value, intdos): Obsolete aliases for the corresponding dos-* functions and variables. (dos-intdos): Add a doc string. --- lisp/files.el | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index 83ae91dd63a..d4c05bdc5d6 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -574,6 +574,9 @@ Runs the usual ange-ftp hook, but only for completion operations." (inhibit-file-name-operation op)) (apply op args)))) +(declare-function dos-convert-standard-filename "dos-fns.el" (filename)) +(declare-function w32-convert-standard-filename "w32-fns.el" (filename)) + (defun convert-standard-filename (filename) "Convert a standard file's name to something suitable for the OS. This means to guarantee valid names and perhaps to canonicalize @@ -591,15 +594,20 @@ and also turn slashes into backslashes if the shell requires it (see `w32-shell-dos-semantics'). See Info node `(elisp)Standard File Names' for more details." - (if (eq system-type 'cygwin) - (let ((name (copy-sequence filename)) - (start 0)) - ;; Replace invalid filename characters with ! - (while (string-match "[?*:<>|\"\000-\037]" name start) - (aset name (match-beginning 0) ?!) - (setq start (match-end 0))) - name) - filename)) + (cond + ((eq system-type 'cygwin) + (let ((name (copy-sequence filename)) + (start 0)) + ;; Replace invalid filename characters with ! + (while (string-match "[?*:<>|\"\000-\037]" name start) + (aset name (match-beginning 0) ?!) + (setq start (match-end 0))) + name)) + ((eq system-type 'windows-nt) + (w32-convert-standard-filename filename)) + ((eq system-type 'ms-dos) + (dos-convert-standard-filename filename)) + (t filename))) (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial) "Read directory name, prompting with PROMPT and completing in directory DIR. -- cgit v1.2.3