diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-07-19 03:27:19 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-07-19 03:27:19 +0000 |
commit | dfbcdf5f5b4981518a267d6ff52aff6714793282 (patch) | |
tree | 543d6fd1dcd61c3f83d7abe055c270d8b420797a /lisp/dos-w32.el | |
parent | 0c8ee1a2e6cd4bfec2854cd1c2aeebe2a710a2eb (diff) | |
download | emacs-dfbcdf5f5b4981518a267d6ff52aff6714793282.tar.gz |
(find-buffer-file-type-coding-system):
Use emacs-mule-dos for text file names; use undecided-dos
for the last resort (instead of emacs-mule-dos).
Diffstat (limited to 'lisp/dos-w32.el')
-rw-r--r-- | lisp/dos-w32.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/dos-w32.el b/lisp/dos-w32.el index cb159e6fc6d..b5f52bb1716 100644 --- a/lisp/dos-w32.el +++ b/lisp/dos-w32.el @@ -102,27 +102,28 @@ upon the filename, the contents of 'untranslated-filesystem-list' and If the match is nil (for text): 'emacs-mule-dos' Otherwise: If the file exists: 'undecided' - If the file does not exist: 'emacs-mule-dos' + If the file does not exist: 'undecided-dos' If COMMAND is 'write-region', the coding system is chosen based upon the value of 'buffer-file-type': If t, the coding system is 'no-conversion', otherwise it is 'emacs-mule-dos'." (let ((op (nth 0 command)) (target) - (binary) + (binary nil) (text nil) (undecided nil)) (cond ((eq op 'insert-file-contents) (setq target (nth 1 command)) (setq binary (find-buffer-file-type target)) - (if (not binary) - (setq undecided - (and (file-exists-p target) - (not (find-buffer-file-type-match target)))))) + (unless binary + (if (find-buffer-file-type-match target) + (setq text t) + (setq undecided (file-exists-p target))))) ((eq op 'write-region) (setq binary buffer-file-type))) (cond (binary '(no-conversion . no-conversion)) + (text '(emacs-mule-dos . emacs-mule-dos)) (undecided '(undecided . undecided)) - (t '(emacs-mule-dos . emacs-mule-dos))))) + (t '(undecided-dos . undecided-dos))))) (modify-coding-system-alist 'file "" 'find-buffer-file-type-coding-system) |