[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Language identification

From: Stephen J. Turnbull
Subject: Re: Language identification
Date: Sat, 29 Aug 2009 13:11:27 +0900

Stefan Monnier writes:

 > > The great majority that I see are correctly identified by file(1) (I
 > > believe using libmagic), however, by parsing the shebang.
 > Oh, so they're executables with a shebang.  That's OK we don't need
 > `file' for that since we have interpreter-mode-alist.  Emacs should
 > already DTRT for them.

Sure.  Maybe there's a better way.  Maybe libmagic is it.  Maybe not.

However, you asked "how often do you see files containing programming
languages without an extension?"  The answer is, it's very common, but
the most common case is Unix command scripts with shebangs, which file
handles just as well as Emacs does.

 > I've had
 >   (setq auto-mode-alist (append auto-mode-alist '(("\\.[^/.]+\\'" ignore 
 > t))))
 > in my .emacs for eons to cover such cases.

Well, maybe it's time to move it from your .emacs to core emacs?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]