From 647519fd489e892c99a8db14ef7562e640991ec8 Mon Sep 17 00:00:00 2001 From: Thomas Hintz Date: Wed, 20 Apr 2016 10:11:39 -0700 Subject: [PATCH] Try to guess language by emacs major mode before file extension. The explicit language specified in an emacs file local variable is going to be more correct than the file extension. --- highlight.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/highlight.scm b/highlight.scm index f0da903..9961f60 100644 --- a/highlight.scm +++ b/highlight.scm @@ -65,8 +65,8 @@ ((html) 'html) (else #f))) -(let ((type (or (guess-type-by-file-extension *file*) - (guess-type-by-emacs-major-mode-variable *file-contents*)))) +(let ((type (or (guess-type-by-emacs-major-mode-variable *file-contents*) + (guess-type-by-file-extension *file*)))) (if (not type) (begin (display *file-contents*) (exit 0)) (begin