changeset 100691:89166beb2187

(dosified-file-name): New function.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 26 Dec 2008 15:01:34 +0000
parents bc724faa95e6
children 56d9b285d794
files lisp/dos-fns.el
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dos-fns.el	Fri Dec 26 15:01:10 2008 +0000
+++ b/lisp/dos-fns.el	Fri Dec 26 15:01:34 2008 +0000
@@ -186,6 +186,25 @@
 		    (dos-8+3-filename dir))
 		  string))))))
 
+;; This is for the sake of standard file names elsewhere in Emacs that
+;; are defined as constant strings or via defconst, and whose
+;; conversion via `convert-standard-filename' does not give good
+;; enough results.
+(defun dosified-file-name (file-name)
+  "Return a variant of FILE-NAME that is valid on MS-DOS filesystems.
+
+This function is for those rare cases where `convert-standard-filename'
+does not do a job that is good enough, e.g. if you need to preserve the
+file-name extension.  It recognizes only certain specific file names
+that are used in Emacs Lisp sources; any other file name will be
+returned unaltered."
+  (cond
+   ;; See files.el:dir-locals-file.
+   ((string= file-name ".dir-locals.el")
+    "_dir-locals.el")
+   (t
+    file-name)))
+
 ;; See dos-vars.el for defcustom.
 (defvar msdos-shells)