aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-07-19 03:27:19 +0000
committerRichard M. Stallman1997-07-19 03:27:19 +0000
commitdfbcdf5f5b4981518a267d6ff52aff6714793282 (patch)
tree543d6fd1dcd61c3f83d7abe055c270d8b420797a
parent0c8ee1a2e6cd4bfec2854cd1c2aeebe2a710a2eb (diff)
downloademacs-dfbcdf5f5b4981518a267d6ff52aff6714793282.tar.gz
emacs-dfbcdf5f5b4981518a267d6ff52aff6714793282.zip
(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).
-rw-r--r--lisp/dos-w32.el15
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
102 If the match is nil (for text): 'emacs-mule-dos' 102 If the match is nil (for text): 'emacs-mule-dos'
103 Otherwise: 103 Otherwise:
104 If the file exists: 'undecided' 104 If the file exists: 'undecided'
105 If the file does not exist: 'emacs-mule-dos' 105 If the file does not exist: 'undecided-dos'
106 106
107If COMMAND is 'write-region', the coding system is chosen based 107If COMMAND is 'write-region', the coding system is chosen based
108upon the value of 'buffer-file-type': If t, the coding system is 108upon the value of 'buffer-file-type': If t, the coding system is
109'no-conversion', otherwise it is 'emacs-mule-dos'." 109'no-conversion', otherwise it is 'emacs-mule-dos'."
110 (let ((op (nth 0 command)) 110 (let ((op (nth 0 command))
111 (target) 111 (target)
112 (binary) 112 (binary nil) (text nil)
113 (undecided nil)) 113 (undecided nil))
114 (cond ((eq op 'insert-file-contents) 114 (cond ((eq op 'insert-file-contents)
115 (setq target (nth 1 command)) 115 (setq target (nth 1 command))
116 (setq binary (find-buffer-file-type target)) 116 (setq binary (find-buffer-file-type target))
117 (if (not binary) 117 (unless binary
118 (setq undecided 118 (if (find-buffer-file-type-match target)
119 (and (file-exists-p target) 119 (setq text t)
120 (not (find-buffer-file-type-match target)))))) 120 (setq undecided (file-exists-p target)))))
121 ((eq op 'write-region) 121 ((eq op 'write-region)
122 (setq binary buffer-file-type))) 122 (setq binary buffer-file-type)))
123 (cond (binary '(no-conversion . no-conversion)) 123 (cond (binary '(no-conversion . no-conversion))
124 (text '(emacs-mule-dos . emacs-mule-dos))
124 (undecided '(undecided . undecided)) 125 (undecided '(undecided . undecided))
125 (t '(emacs-mule-dos . emacs-mule-dos))))) 126 (t '(undecided-dos . undecided-dos)))))
126 127
127(modify-coding-system-alist 'file "" 'find-buffer-file-type-coding-system) 128(modify-coding-system-alist 'file "" 'find-buffer-file-type-coding-system)
128 129