]> code.delx.au - gnu-emacs/blobdiff - lisp/dos-fns.el
Add new function dom-remove-node
[gnu-emacs] / lisp / dos-fns.el
index b917acd588c3b7c19fc85bf4927db87eac344929..7188ae0bce7346e032dff8bf71dbaec1ca3f6950 100644 (file)
@@ -1,10 +1,11 @@
 ;;; dos-fns.el --- MS-Dos specific functions
 
-;; Copyright (C) 1991, 1993, 1995, 1996, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1993, 1995-1996, 2001-2016 Free Software
+;; Foundation, Inc.
 
 ;; Maintainer: Morten Welinder <terra@diku.dk>
 ;; Keywords: internal
+;; Package: emacs
 
 ;; This file is part of GNU Emacs.
 
 (declare-function int86 "dosfns.c")
 (declare-function msdos-long-file-names "msdos.c")
 
-;; This overrides a trivial definition in files.el.
-(defun convert-standard-filename (filename)
-  "Convert a standard file's name to something suitable for the current OS.
+;; See convert-standard-filename in files.el.
+(defun dos-convert-standard-filename (filename)
+  "Convert a standard file's name to something suitable for MS-DOS.
 This means to guarantee valid names and perhaps to canonicalize
 certain patterns.
 
+This function is called by `convert-standard-filename'.
+
 On Windows and DOS, replace invalid characters.  On DOS, make
-sure to obey the 8.3 limitations.  On Windows, turn Cygwin names
-into native names, and also turn slashes into backslashes if the
-shell requires it (see `w32-shell-dos-semantics')."
+sure to obey the 8.3 limitations."
   (if (or (not (stringp filename))
          ;; This catches the case where FILENAME is "x:" or "x:/" or
          ;; "/", thus preventing infinite recursion.
@@ -48,7 +49,7 @@ shell requires it (see `w32-shell-dos-semantics')."
     (let ((flen (length filename)))
       ;; If FILENAME has a trailing slash, remove it and recurse.
       (if (memq (aref filename (1- flen)) '(?/ ?\\))
-         (concat (convert-standard-filename
+         (concat (dos-convert-standard-filename
                   (substring filename 0 (1- flen)))
                  "/")
        (let* (;; ange-ftp gets in the way for names like "/foo:bar".
@@ -97,7 +98,7 @@ shell requires it (see `w32-shell-dos-semantics')."
                            string))
              (aset string i ?_))
            ;; If we don't have a period in the first 8 chars, insert one.
-           ;; This enables to have 3 more characters from the original
+           ;; This enables having 3 more characters from the original
            ;; name in the extension.
            (if (> (or (string-match "\\." string) (length string))
                   8)
@@ -122,10 +123,10 @@ shell requires it (see `w32-shell-dos-semantics')."
                (aset string (1- (length string)) lastchar))))
          (concat (if (and (stringp dir)
                           (memq (aref dir dlen-m-1) '(?/ ?\\)))
-                     (concat (convert-standard-filename
+                     (concat (dos-convert-standard-filename
                               (substring dir 0 dlen-m-1))
                              "/")
-                   (convert-standard-filename dir))
+                   (dos-convert-standard-filename dir))
                  string))))))
 
 (defun dos-8+3-filename (filename)
@@ -158,7 +159,7 @@ shell requires it (see `w32-shell-dos-semantics')."
               (string (copy-sequence (file-name-nondirectory filename)))
               (strlen (length string))
               (lastchar (aref string (1- strlen)))
-              firstdot)
+              firstdot)
          (setq firstdot (string-match "\\." string))
          (cond
           (firstdot
@@ -188,20 +189,20 @@ shell requires it (see `w32-shell-dos-semantics')."
 
 ;; 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
+;; conversion via `dos-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'
+This function is for those rare cases where `dos-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")
+   ((string= file-name ".dir-locals")
+    "_dir-locals")
    (t
     file-name)))
 
@@ -209,13 +210,13 @@ returned unaltered."
 (defvar msdos-shells)
 
 ;; Override settings chosen at startup.
-(defun set-default-process-coding-system ()
+(defun dos-set-default-process-coding-system ()
   (setq default-process-coding-system
        (if (default-value 'enable-multibyte-characters)
            '(undecided-dos . undecided-dos)
          '(raw-text-dos . raw-text-dos))))
 
-(add-hook 'before-init-hook 'set-default-process-coding-system)
+(add-hook 'before-init-hook 'dos-set-default-process-coding-system)
 
 ;; File names defined in preloaded packages can be incorrect or
 ;; invalid if long file names were available during dumping, but not
@@ -232,17 +233,22 @@ returned unaltered."
 
 (add-hook 'before-init-hook 'dos-reevaluate-defcustoms)
 
-(defvar register-name-alist
+(define-obsolete-variable-alias
+  'register-name-alist 'dos-register-name-alist "24.1")
+
+(defvar dos-register-name-alist
   '((ax . 0) (bx . 1) (cx . 2) (dx . 3) (si . 4) (di . 5)
     (cflag . 6) (flags . 7)
     (al . (0 . 0)) (bl . (1 . 0)) (cl . (2 . 0)) (dl . (3 . 0))
     (ah . (0 . 1)) (bh . (1 . 1)) (ch . (2 . 1)) (dh . (3 . 1))))
 
-(defun make-register ()
+(defun dos-make-register ()
   (make-vector 8 0))
 
-(defun register-value (regs name)
-  (let ((where (cdr (assoc name register-name-alist))))
+(define-obsolete-function-alias 'make-register 'dos-make-register "24.1")
+
+(defun dos-register-value (regs name)
+  (let ((where (cdr (assoc name dos-register-name-alist))))
     (cond ((consp where)
           (let ((tem (aref regs (car where))))
             (if (zerop (cdr where))
@@ -252,10 +258,12 @@ returned unaltered."
           (aref regs where))
          (t nil))))
 
-(defun set-register-value (regs name value)
+(define-obsolete-function-alias 'register-value 'dos-register-value "24.1")
+
+(defun dos-set-register-value (regs name value)
   (and (numberp value)
        (>= value 0)
-       (let ((where (cdr (assoc name register-name-alist))))
+       (let ((where (cdr (assoc name dos-register-name-alist))))
         (cond ((consp where)
                (let ((tem (aref regs (car where)))
                      (value (logand value 255)))
@@ -268,18 +276,29 @@ returned unaltered."
                (aset regs where (logand value 65535))))))
   regs)
 
-(defsubst intdos (regs)
+(define-obsolete-function-alias
+  'set-register-value 'dos-set-register-value "24.1")
+
+(defsubst dos-intdos (regs)
+  "Issue the DOS Int 21h with registers REGS.
+
+REGS should be a vector produced by `dos-make-register'
+and `dos-set-register-value', which see."
   (int86 33 regs))
 
+(define-obsolete-function-alias 'intdos 'dos-intdos "24.1")
+
 ;; Backward compatibility for obsolescent functions which
 ;; set screen size.
 
-(defun mode25 ()
+(defun dos-mode25 ()
   "Changes the number of screen rows to 25."
   (interactive)
   (set-frame-size (selected-frame) 80 25))
 
-(defun mode4350 ()
+(define-obsolete-function-alias 'mode25 'dos-mode25 "24.1")
+
+(defun dos-mode4350 ()
   "Changes the number of rows to 43 or 50.
 Emacs always tries to set the screen height to 50 rows first.
 If this fails, it will try to set it to 43 rows, on the assumption
@@ -290,7 +309,8 @@ that your video hardware might not support 50-line mode."
       nil  ; the original built-in function returned nil
     (set-frame-size (selected-frame) 80 43)))
 
+(define-obsolete-function-alias 'mode4350 'dos-mode4350 "24.1")
+
 (provide 'dos-fns)
 
-;; arch-tag: 00b03579-8ebb-4a02-8762-5c5a929774ad
 ;;; dos-fns.el ends here