Mercurial > emacs
changeset 18872:8c7bcffd7327
(find-buffer-file-type-coding-system):
Use undecided-dos for dos-text file names.
Use undecided for non-existing untranslated file names.
author | Geoff Voelker <voelker@cs.washington.edu> |
---|---|
date | Sun, 20 Jul 1997 01:30:54 +0000 |
parents | 32c4a961d11f |
children | e05d51998190 |
files | lisp/dos-w32.el |
diffstat | 1 files changed, 28 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/dos-w32.el Sat Jul 19 08:15:46 1997 +0000 +++ b/lisp/dos-w32.el Sun Jul 20 01:30:54 1997 +0000 @@ -29,11 +29,6 @@ ;;; Code: -;;; Add %t: into the mode line format just after the open-paren. -(let ((tail (member " %[(" mode-line-format))) - (setcdr tail (cons (purecopy "%t:") - (cdr tail)))) - ;; Use ";" instead of ":" as a path separator (from files.el). (setq path-separator ";") @@ -92,36 +87,42 @@ (defun find-buffer-file-type-coding-system (command args) "Choose a coding system for a file operation. -If COMMAND is 'insert-file-contents', the coding system is chosen based -upon the filename, the contents of 'untranslated-filesystem-list' and -'file-name-buffer-file-type-alist', and whether the file exists: +If COMMAND is `insert-file-contents', the coding system is chosen based +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': 'no-conversion' - 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 text): 'emacs-mule-dos' + If it matches in `untranslated-filesystem-list': + If the file exists: `no-conversion' + If the file does not exist: `undecided' + 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' Otherwise: - If the file exists: 'undecided' - If the file does not exist: 'undecided-dos' + If the file exists: `undecided' + 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'." +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 `undecided-dos'." (let ((op (nth 0 command)) (target) (binary nil) (text nil) (undecided nil)) (cond ((eq op 'insert-file-contents) (setq target (nth 1 command)) - (setq binary (find-buffer-file-type target)) - (unless binary - (if (find-buffer-file-type-match target) - (setq text t) - (setq undecided (file-exists-p target))))) + (if (untranslated-file-p target) + (if (file-exists-p target) + (setq undecided t) + (setq binary t)) + (setq binary (find-buffer-file-type 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)) + (text '(undecided-dos . undecided-dos)) (undecided '(undecided . undecided)) (t '(undecided-dos . undecided-dos))))) @@ -214,11 +215,11 @@ (defun find-binary-process-coding-system (op args) "Choose a coding system for process I/O. The coding system for decode is 'no-conversion' if 'binary-process-output' -is non-nil, and 'emacs-mule-dos' otherwise. Similarly, the coding system +is non-nil, and 'undecided-dos' otherwise. Similarly, the coding system for encode is 'no-conversion' if 'binary-process-input' is non-nil, -and 'emacs-mule-dos' otherwise." - (let ((decode 'emacs-mule-dos) - (encode 'emacs-mule-dos)) +and 'undecided-dos' otherwise." + (let ((decode 'undecided-dos) + (encode 'undecided-dos)) (if binary-process-output (setq decode 'no-conversion)) (if binary-process-input