-;; Return the pair matching filename on file-name-buffer-file-type-alist,
-;; or nil otherwise.
-(defun find-buffer-file-type-match (filename)
- (let ((alist file-name-buffer-file-type-alist)
- (found nil))
- (let ((case-fold-search t))
- (setq filename (file-name-sans-versions filename))
- (while (and (not found) alist)
- (if (string-match (car (car alist)) filename)
- (setq found (car alist)))
- (setq alist (cdr alist)))
- found)))
-
-;; Don't check for untranslated file systems here.
-(defun find-buffer-file-type (filename)
- (let ((match (find-buffer-file-type-match filename))
- (code))
- (if (not match)
- (default-value 'buffer-file-type)
- (setq code (cdr match))
- (cond ((memq code '(nil t)) code)
- ((and (symbolp code) (fboundp code))
- (funcall code filename))))))
-
-(setq-default buffer-file-coding-system 'undecided-dos)