diff options
| author | Richard M. Stallman | 1994-04-24 22:25:52 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-24 22:25:52 +0000 |
| commit | 594cabd79ddc6eb293817f6040268ef7cc644be6 (patch) | |
| tree | 4969d496773d9c599faa0383df2de0a49acc2bd1 | |
| parent | a890e1b0e0febe63cec6575e20c5b51073c00e9f (diff) | |
| download | emacs-594cabd79ddc6eb293817f6040268ef7cc644be6.tar.gz emacs-594cabd79ddc6eb293817f6040268ef7cc644be6.zip | |
(mode-line-format): Put `mode-line-process' earlier.
(file-name-buffer-file-type-alist): Use nil or t, not 0 or 1.
(find-buffer-file-type): Handle that change.
| -rw-r--r-- | lisp/dos-fns.el | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el index 2272ea8583e..0ef0e44b9fa 100644 --- a/lisp/dos-fns.el +++ b/lisp/dos-fns.el | |||
| @@ -35,30 +35,30 @@ | |||
| 35 | 'global-mode-string | 35 | 'global-mode-string |
| 36 | (purecopy " %[(") | 36 | (purecopy " %[(") |
| 37 | (purecopy "%t:") | 37 | (purecopy "%t:") |
| 38 | 'mode-name 'minor-mode-alist "%n" 'mode-line-process | 38 | 'mode-name 'mode-line-process 'minor-mode-alist "%n" |
| 39 | (purecopy ")%]--") | 39 | (purecopy ")%]--") |
| 40 | (purecopy '(line-number-mode "L%l--")) | 40 | (purecopy '(line-number-mode "L%l--")) |
| 41 | (purecopy '(-3 . "%p")) | 41 | (purecopy '(-3 . "%p")) |
| 42 | (purecopy "-%-"))) | 42 | (purecopy "-%-"))) |
| 43 | 43 | ||
| 44 | ;; | ||
| 45 | ;; buffer-file-type (0 "text") (1 "binary") | ||
| 46 | ;; | ||
| 47 | (defvar file-name-buffer-file-type-alist | 44 | (defvar file-name-buffer-file-type-alist |
| 48 | '( | 45 | '( |
| 49 | ("[:/].*config.sys$" . 0) ; config.sys text | 46 | ("[:/].*config.sys$" . nil) ; config.sys text |
| 50 | ("\\.elc$" . 1) ; emacs stuff | 47 | ("\\.elc$" . t) ; emacs stuff |
| 51 | ("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|chk\\|out\\|bin\\|ico\\|pif\\)$" . 1) | 48 | ("\\.\\(obj\\|exe\\|com\\|lib\\|sys\\|chk\\|out\\|bin\\|ico\\|pif\\)$" . t) |
| 52 | ; MS-Dos stuff | 49 | ; MS-Dos stuff |
| 53 | ("\\.\\(arc\\|zip\\|pak\\|lzh\\|zoo\\)$" . 1) | 50 | ("\\.\\(arc\\|zip\\|pak\\|lzh\\|zoo\\)$" . t) |
| 54 | ; Packers | 51 | ; Packers |
| 55 | ("\\.\\(a\\|o\\|tar\\|z\\|gz\\|taz\\)$" . 1) | 52 | ("\\.\\(a\\|o\\|tar\\|z\\|gz\\|taz\\)$" . t) |
| 56 | ; Unix stuff | 53 | ; Unix stuff |
| 57 | ("\\.tp[ulpw]$" . 1) | 54 | ("\\.tp[ulpw]$" . t) |
| 58 | ; Borland Pascal stuff | 55 | ; Borland Pascal stuff |
| 59 | ("[:/]tags$" . 1 ) | 56 | ("[:/]tags$" . t ) |
| 60 | ; Emacs TAGS file | 57 | ; Emacs TAGS file |
| 61 | )) | 58 | ) |
| 59 | "*Alist for distinguishing text files from binary files. | ||
| 60 | Each element has the form (REGEXP . TYPE), where REGEXP is matched | ||
| 61 | against the file name, and TYPE is nil for text, t for binary.") | ||
| 62 | 62 | ||
| 63 | (defun find-buffer-file-type (filename) | 63 | (defun find-buffer-file-type (filename) |
| 64 | (let ((alist file-name-buffer-file-type-alist) | 64 | (let ((alist file-name-buffer-file-type-alist) |
| @@ -71,22 +71,22 @@ | |||
| 71 | (setq code (cdr (car alist)) | 71 | (setq code (cdr (car alist)) |
| 72 | found t)) | 72 | found t)) |
| 73 | (setq alist (cdr alist)))) | 73 | (setq alist (cdr alist)))) |
| 74 | (if code | 74 | (if found |
| 75 | (cond((numberp code) code) | 75 | (cond((memq code '(nil t)) code) |
| 76 | ((and (symbolp code) (fboundp code)) | 76 | ((and (symbolp code) (fboundp code)) |
| 77 | (funcall code filename))) | 77 | (funcall code filename))) |
| 78 | default-buffer-file-type))) | 78 | default-buffer-file-type))) |
| 79 | 79 | ||
| 80 | (defun find-file-binary (filename) | 80 | (defun find-file-binary (filename) |
| 81 | "Like find-file but always load the file as binary." | 81 | "Visit file FILENAME and treat it as binary." |
| 82 | (interactive "FFind file binary: ") | 82 | (interactive "FFind file binary: ") |
| 83 | (let ((file-name-buffer-file-type-alist '(("" . 1)))) | 83 | (let ((file-name-buffer-file-type-alist '(("" . t)))) |
| 84 | (find-file filename))) | 84 | (find-file filename))) |
| 85 | 85 | ||
| 86 | (defun find-file-text (filename) | 86 | (defun find-file-text (filename) |
| 87 | "Like find-file but always load the file as text." | 87 | "Visit file FILENAME and treat it as a text file." |
| 88 | (interactive "FFind file text: ") | 88 | (interactive "FFind file text: ") |
| 89 | (let ((file-name-buffer-file-type-alist '(("" . 0)))) | 89 | (let ((file-name-buffer-file-type-alist '(("" . nil)))) |
| 90 | (find-file filename))) | 90 | (find-file filename))) |
| 91 | 91 | ||
| 92 | (defun find-file-not-found-set-buffer-file-type () | 92 | (defun find-file-not-found-set-buffer-file-type () |