From: Richard M. Stallman Date: Tue, 12 May 1998 23:09:35 +0000 (+0000) Subject: (after-insert-file-set-buffer-file-coding-system): X-Git-Tag: emacs-20.3~1036 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ccb77b4efd5653c269845d2aa6206ddc70d0ef7c;p=emacs.git (after-insert-file-set-buffer-file-coding-system): Don't make buffer unibyte unless we seem to be visiting a file. --- diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 82d9cbcddc9..831d2811897 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -845,10 +845,12 @@ function by default." (modified-p (buffer-modified-p))) (when coding-system (set-buffer-file-coding-system coding-system) - (if (or (eq coding-system 'no-conversion) - (eq (coding-system-type coding-system) 5)) - ;; It seems that random 8-bit codes are read. We had - ;; better edit this buffer without multibyte characters. + (if (and (or (eq coding-system 'no-conversion) + (eq (coding-system-type coding-system) 5)) + ;; If buffer was unmodified, we must be visiting it. + (not modified-p)) + ;; For coding systems no-conversion and raw-text..., + ;; edit the buffer as unibyte. (set-buffer-multibyte nil)) (set-buffer-modified-p modified-p)))) nil)