aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1996-05-17 22:36:39 +0000
committerKarl Heuer1996-05-17 22:36:39 +0000
commit60d5138f2d9e450da577af8dd33c69db65a5967b (patch)
treee27a2e76debc2bccd80c92e5bdb112d724df9bbe
parentd77f86d08d61fb1a8d2b6a0aced90ffc5760990f (diff)
downloademacs-60d5138f2d9e450da577af8dd33c69db65a5967b.tar.gz
emacs-60d5138f2d9e450da577af8dd33c69db65a5967b.zip
(path-separator, grep-null-device,
grep-regexp-alist, file-name-buffer-file-type-alist, find-buffer-file-type, find-file-not-found-set-buffer-file-type, find-file-binary, find-file-text, mode-line-format): Moved to dos-win32.el.
-rw-r--r--lisp/dos-fns.el72
1 files changed, 0 insertions, 72 deletions
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el
index 924f5a9b76a..b641a886a76 100644
--- a/lisp/dos-fns.el
+++ b/lisp/dos-fns.el
@@ -28,21 +28,6 @@
28 28
29;;; Code: 29;;; Code:
30 30
31;;; Add %t: into the mode line format just after the open-paren.
32(let ((tail (member " %[(" mode-line-format)))
33 (setcdr tail (cons (purecopy "%t:")
34 (cdr tail))))
35
36;; Use ";" instead of ":" as a path separator (from files.el).
37(setq path-separator ";")
38
39;; Set the null device (for compile.el).
40(setq grep-null-device "NUL")
41
42;; Set the grep regexp to match entries with drive letters.
43(setq grep-regexp-alist
44 '(("^\\(\\([a-zA-Z]:\\)?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 3)))
45
46;; This overrides a trivial definition in files.el. 31;; This overrides a trivial definition in files.el.
47(defun convert-standard-filename (filename) 32(defun convert-standard-filename (filename)
48 "Convert a standard file's name to something suitable for the current OS. 33 "Convert a standard file's name to something suitable for the current OS.
@@ -93,63 +78,6 @@ with a definition that really does change some file names."
93 (aset string (1- (length string)) lastchar)) 78 (aset string (1- (length string)) lastchar))
94 (concat dir string)))) 79 (concat dir string))))
95 80
96(defvar file-name-buffer-file-type-alist
97 '(
98 ("[:/].*config.sys$" . nil) ; config.sys text
99 ("\\.elc$" . t) ; emacs stuff
100 ("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|chk\\|out\\|bin\\|ico\\|pif\\)$" . t)
101 ; MS-Dos stuff
102 ("\\.\\(arc\\|zip\\|pak\\|lzh\\|zoo\\)$" . t)
103 ; Packers
104 ("\\.\\(a\\|o\\|tar\\|z\\|gz\\|taz\\)$" . t)
105 ; Unix stuff
106 ("\\.tp[ulpw]$" . t)
107 ; Borland Pascal stuff
108 ("[:/]tags$" . t)
109 ; Emacs TAGS file
110 )
111 "*Alist for distinguishing text files from binary files.
112Each element has the form (REGEXP . TYPE), where REGEXP is matched
113against the file name, and TYPE is nil for text, t for binary.")
114
115(defun find-buffer-file-type (filename)
116 (let ((alist file-name-buffer-file-type-alist)
117 (found nil)
118 (code nil))
119 (let ((case-fold-search t))
120 (setq filename (file-name-sans-versions filename))
121 (while (and (not found) alist)
122 (if (string-match (car (car alist)) filename)
123 (setq code (cdr (car alist))
124 found t))
125 (setq alist (cdr alist))))
126 (if found
127 (cond((memq code '(nil t)) code)
128 ((and (symbolp code) (fboundp code))
129 (funcall code filename)))
130 default-buffer-file-type)))
131
132(defun find-file-binary (filename)
133 "Visit file FILENAME and treat it as binary."
134 (interactive "FFind file binary: ")
135 (let ((file-name-buffer-file-type-alist '(("" . t))))
136 (find-file filename)))
137
138(defun find-file-text (filename)
139 "Visit file FILENAME and treat it as a text file."
140 (interactive "FFind file text: ")
141 (let ((file-name-buffer-file-type-alist '(("" . nil))))
142 (find-file filename)))
143
144(defun find-file-not-found-set-buffer-file-type ()
145 (save-excursion
146 (set-buffer (current-buffer))
147 (setq buffer-file-type (find-buffer-file-type (buffer-file-name))))
148 nil)
149
150;;; To set the default file type on new files.
151(add-hook 'find-file-not-found-hooks 'find-file-not-found-set-buffer-file-type)
152
153(defvar msdos-shells '("command.com" "4dos.com" "ndos.com") 81(defvar msdos-shells '("command.com" "4dos.com" "ndos.com")
154 "*List of shells that use `/c' instead of `-c' and a backslashed command.") 82 "*List of shells that use `/c' instead of `-c' and a backslashed command.")
155 83