]> code.delx.au - gnu-emacs/blobdiff - lisp/dos-fns.el
(proced-after-send-signal-hook): Use defcustom.
[gnu-emacs] / lisp / dos-fns.el
index d58beec389788356b61d18750ab5d5a17d6af27f..37a1a9c1d16e5c9d0e8dff4ccf818576299b172e 100644 (file)
@@ -1,7 +1,7 @@
 ;;; dos-fns.el --- MS-Dos specific functions
 
 ;; Copyright (C) 1991, 1993, 1995, 1996, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Maintainer: Morten Welinder <terra@diku.dk>
 ;; Keywords: internal
@@ -186,6 +186,25 @@ shell requires it (see `w32-shell-dos-semantics')."
                    (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)
 
@@ -200,12 +219,21 @@ shell requires it (see `w32-shell-dos-semantics')."
 
 ;; File names defined in preloaded packages can be incorrect or
 ;; invalid if long file names were available during dumping, but not
-;; at runtime, and the default file name begins with a period.  Their
-;; defcustom's need to be reevaluated at startup.  To update the list
-;; of defcustom's below, run the command "M-x apropos-value RET ~/\. RET".
+;; at runtime, or vice versa, and if the default file name begins with
+;; a period.  Their defcustom's need to be reevaluated at startup.  To
+;; see if the list of defcustom's below is up to date, run the command
+;; "M-x apropos-value RET ~/\. RET".
 (defun dos-reevaluate-defcustoms ()
-  (custom-reevaluate-setting 'abbrev-file-name)
-  (custom-reevaluate-setting 'calc-settings-file)
+  ;; This was computed in paths.el, but that was at dump time.
+  (setq abbrev-file-name
+       (if (msdos-long-file-names)
+           "~/.abbrev_defs"
+         "~/_abbrev.defs"))
+  ;; This was computed in loaddefs.el, but that was at dump time.
+  (setq calc-settings-file
+       (if (msdos-long-file-names)
+           "~/.calc.el"
+         "~/_calc.el"))
   (custom-reevaluate-setting 'trash-directory))
 
 (add-hook 'before-init-hook 'dos-reevaluate-defcustoms)