(defun magic:find-file-noselect (file)
(let* ((codesys (intern (magic:file file :mime-encoding)))
(coding-system-for-read codesys)
- (buf (create-file-buffer file))
- (coding nil))
+ (buf (create-file-buffer file)))
(with-current-buffer buf
- (insert-file-contents file t)
- (hack-local-variables)
- (when (and coding (not (eq coding codesys)))
- (let ((coding-system-for-read coding))
- (set-buffer-file-coding-system coding)
- (insert-file-contents file t nil nil t)))
- (after-find-file nil t))
+ (let ((coding nil))
+ (insert-file-contents file t)
+ (hack-local-variables)
+ (when (and coding (not (eq coding codesys)))
+ (let ((coding-system-for-read coding))
+ (set-buffer-file-coding-system coding)
+ (insert-file-contents file t nil nil t)))
+ (after-find-file nil t)))
buf))
;;;###autoload