github/linguist — pull request #340 by kdt3rd (2013-01-03 01:10:12+00:00)
Title: Support for files with no extension

This commit adds some rudimentary support for files with no extension that are source code.

The scenario commonly arises with C++ headers - a common pattern is to not use a .h extension - Qt has no-extension versions of it's files, and libstdc++ is the canonical example. Some other libraries (like the one I'm working on) also use this pattern.

The solution I'm proposing looks for an editor mode tag comment line in the file, and extracts the mode, which can then be specified as an item in a list for a particular language. Currently implemented are tag searches for vi/vim and for one case of emacs. Others are easily added, I just have no experience with those tags, and the modelines can of course be specified in any language