rebasing #1184 onto the Nov 2014 version

since #1184 wasn't merged and rebasing was too much work I recreated the patch.
@bkeepers , I'm actually not sure if this is needed any longer. If I have a folder in my .gitignore, will linguist ignore it as well?