]> code.delx.au - gnu-emacs/blobdiff - lisp/dos-w32.el
(file-name-buffer-file-type-alist): Add knowledge of .sx[dmicw] file
[gnu-emacs] / lisp / dos-w32.el
index 901c7bac141ee37cb0d4a602eca3389ca4b27bf8..3da2e99e65821793e7c4d1ed3dc7898ad0485ac6 100644 (file)
@@ -1,4 +1,4 @@
-;;; dos-w32.el --- Functions shared among MS-DOS and W32 (NT/95) platforms
+;; dos-w32.el --- Functions shared among MS-DOS and W32 (NT/95) platforms
 
 ;; Copyright (C) 1996 Free Software Foundation, Inc.
 
 ;; Set the null device (for compile.el).
 (setq null-device "NUL")
 
-;; Set the grep regexp to match entries with drive letters.
-(setq grep-regexp-alist
-  '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3)))
-
 ;; For distinguishing file types based upon suffixes.
 (defvar file-name-buffer-file-type-alist
   '(
                                        ; Packers
     ("\\.\\(a\\|o\\|tar\\|z\\|gz\\|taz\\|jar\\)$" . t)
                                        ; Unix stuff
-    ("\\.tp[ulpw]$" . t)
-                                       ; Borland Pascal stuff
-    ("[:/]tags$" . nil)
-                                       ; Emacs TAGS file
+    ("\\.sx[dmicw]$" . t)              ; Open office
+    ("\\.tp[ulpw]$" . t)               ; borland Pascal stuff
+    ("[:/]tags$" . nil)                        ; emacs TAGS file
     )
   "*Alist for distinguishing text files from binary files.
 Each element has the form (REGEXP . TYPE), where REGEXP is matched
@@ -98,8 +93,8 @@ upon the filename, the contents of `untranslated-filesystem-list' and
 `file-name-buffer-file-type-alist', and whether the file exists:
 
   If it matches in `untranslated-filesystem-list':
-    If the file exists:                                        `no-conversion'
-    If the file does not exist:                                `undecided'
+    If the file exists:                                        `undecided'
+    If the file does not exist:                                `undecided-unix'
   If it matches in `file-name-buffer-file-type-alist':
     If the match is t (for binary):                    `no-conversion'
     If the match is nil (for dos-text):                        `undecided-dos'
@@ -128,7 +123,7 @@ set to the appropriate coding system, and the value of
        (target)
        (binary nil) (text nil)
        (undecided nil) (undecided-unix nil))
-    (cond ((eq op 'insert-file-contents) 
+    (cond ((eq op 'insert-file-contents)
           (setq target (nth 1 command))
           ;; First check for a file name that indicates
           ;; it is truly binary.
@@ -162,13 +157,13 @@ set to the appropriate coding system, and the value of
 
 (modify-coding-system-alist 'file "" 'find-buffer-file-type-coding-system)
 
-(defun find-file-binary (filename) 
+(defun find-file-binary (filename)
   "Visit file FILENAME and treat it as binary."
   (interactive "FFind file binary: ")
   (let ((file-name-buffer-file-type-alist '(("" . t))))
     (find-file filename)))
 
-(defun find-file-text (filename) 
+(defun find-file-text (filename)
   "Visit file FILENAME and treat it as a text file."
   (interactive "FFind file text: ")
   (let ((file-name-buffer-file-type-alist '(("" . nil))))
@@ -190,12 +185,12 @@ set to the appropriate coding system, and the value of
       (setq buffer-file-type (eq buffer-file-coding-system 'no-conversion)))))
 
 ;;; To set the default coding system on new files.
-(add-hook 'find-file-not-found-hooks 
+(add-hook 'find-file-not-found-hooks
          'find-file-not-found-set-buffer-file-coding-system)
 
 ;;; To accomodate filesystems that do not require CR/LF translation.
 (defvar untranslated-filesystem-list nil
-  "List of filesystems that require no CR/LF translation when reading 
+  "List of filesystems that require no CR/LF translation when reading
 and writing files.  Each filesystem in the list is a string naming
 the directory prefix corresponding to the filesystem.")
 
@@ -206,8 +201,8 @@ dealing with untranslated filesystems."
       ;; The canonical form for DOS/W32 is with A-Z downcased and all
       ;; directory separators changed to directory-sep-char.
       (let ((name nil))
-       (setq name (mapconcat 
-                   '(lambda (char) 
+       (setq name (mapconcat
+                   '(lambda (char)
                       (if (and (<= ?A char) (<= char ?Z))
                           (char-to-string (+ (- char ?A) ?a))
                         (char-to-string char)))
@@ -223,7 +218,7 @@ dealing with untranslated filesystems."
     filename))
 
 (defun untranslated-file-p (filename)
-  "Return t if FILENAME is on a filesystem that does not require 
+  "Return t if FILENAME is on a filesystem that does not require
 CR/LF translation, and nil otherwise."
   (let ((fs (untranslated-canonical-name filename))
        (ufs-list untranslated-filesystem-list)
@@ -237,7 +232,7 @@ CR/LF translation, and nil otherwise."
 (defun add-untranslated-filesystem (filesystem)
   "Add FILESYSTEM to the list of filesystems that do not require
 CR/LF translation.  FILESYSTEM is a string containing the directory
-prefix corresponding to the filesystem.  For example, for a Unix 
+prefix corresponding to the filesystem.  For example, for a Unix
 filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
   ;; We use "D", not "f", to avoid confusing the user: "f" prompts
   ;; with a directory, but RET returns the current buffer's file, not
@@ -250,12 +245,12 @@ filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
            (cons fs untranslated-filesystem-list)))))
 
 (defun remove-untranslated-filesystem (filesystem)
-  "Remove FILESYSTEM from the list of filesystems that do not require 
+  "Remove FILESYSTEM from the list of filesystems that do not require
 CR/LF translation.  FILESYSTEM is a string containing the directory
-prefix corresponding to the filesystem.  For example, for a Unix 
+prefix corresponding to the filesystem.  For example, for a Unix
 filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"."
   (interactive "fUntranslated file system: ")
-  (setq untranslated-filesystem-list 
+  (setq untranslated-filesystem-list
        (delete (untranslated-canonical-name filesystem)
                untranslated-filesystem-list)))