From d71d711415e9b18383adb82b2d890eac95b82bdf Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 27 Oct 2000 19:24:25 +0000 Subject: [PATCH] (find-file-not-found-set-buffer-file-coding-system): Don't call find-buffer-file-type-coding-system. Instead, just set eol-type to -unix if inhibit-eol-conversion is in effect, or if the file is on an untranslated filesystem. (add-untranslated-filesystem): Use "D" instead of "f" inside interactive. --- lisp/ChangeLog | 9 +++++++++ lisp/dos-w32.el | 19 ++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ba2dc59c30..da199782251 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2000-10-27 Eli Zaretskii + + * dos-w32.el (find-file-not-found-set-buffer-file-coding-system): + Don't call find-buffer-file-type-coding-system. Instead, just + set eol-type to -unix if inhibit-eol-conversion is in effect, or + if the file is on an untranslated filesystem. + (add-untranslated-filesystem): Use "D" instead of "f" inside + interactive. + 2000-10-27 Dave Love * textmodes/refill.el (refill-late-fill-paragraph-function): New diff --git a/lisp/dos-w32.el b/lisp/dos-w32.el index 83eb895dc80..901c7bac141 100644 --- a/lisp/dos-w32.el +++ b/lisp/dos-w32.el @@ -177,10 +177,16 @@ set to the appropriate coding system, and the value of (defun find-file-not-found-set-buffer-file-coding-system () (save-excursion (set-buffer (current-buffer)) - (let* ((dummy-insert-op (list 'insert-file-contents (buffer-file-name))) - (coding-system-pair - (find-buffer-file-type-coding-system dummy-insert-op))) - (setq buffer-file-coding-system (car coding-system-pair)) + (let ((coding buffer-file-coding-system)) + ;; buffer-file-coding-system is already set by + ;; find-operation-coding-system, which was called from + ;; insert-file-contents. All that's left is to change + ;; the EOL conversion, if required by the user. + (when (and (null coding-system-for-read) + (or inhibit-eol-conversion + (untranslated-file-p (buffer-file-name)))) + (setq coding (coding-system-change-eol-conversion coding 0)) + (setq buffer-file-coding-system coding)) (setq buffer-file-type (eq buffer-file-coding-system 'no-conversion))))) ;;; To set the default coding system on new files. @@ -233,7 +239,10 @@ CR/LF translation, and nil otherwise." CR/LF translation. FILESYSTEM is a string containing the directory prefix corresponding to the filesystem. For example, for a Unix filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"." - (interactive "fUntranslated file system: ") + ;; We use "D", not "f", to avoid confusing the user: "f" prompts + ;; with a directory, but RET returns the current buffer's file, not + ;; its directory. + (interactive "DUntranslated file system: ") (let ((fs (untranslated-canonical-name filesystem))) (if (member fs untranslated-filesystem-list) untranslated-filesystem-list -- 2.39.2