{"action":"opened","issue":{"url":"https://api.github.com/repos/github/linguist/issues/2230","labels_url":"https://api.github.com/repos/github/linguist/issues/2230/labels{/name}","comments_url":"https://api.github.com/repos/github/linguist/issues/2230/comments","events_url":"https://api.github.com/repos/github/linguist/issues/2230/events","html_url":"https://github.com/github/linguist/issues/2230","id":61608964,"number":2230,"title":"incorrect detection of emacs per-file \"mode line\"","user":{"login":"tesch1","id":322607,"avatar_url":"https://avatars.githubusercontent.com/u/322607?v=3","gravatar_id":"","url":"https://api.github.com/users/tesch1","html_url":"https://github.com/tesch1","followers_url":"https://api.github.com/users/tesch1/followers","following_url":"https://api.github.com/users/tesch1/following{/other_user}","gists_url":"https://api.github.com/users/tesch1/gists{/gist_id}","starred_url":"https://api.github.com/users/tesch1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tesch1/subscriptions","organizations_url":"https://api.github.com/users/tesch1/orgs","repos_url":"https://api.github.com/users/tesch1/repos","events_url":"https://api.github.com/users/tesch1/events{/privacy}","received_events_url":"https://api.github.com/users/tesch1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-14T13:39:56Z","updated_at":"2015-03-14T13:39:56Z","closed_at":null,"body":"Many c++ library files have no extension.\r\nThe way to tell emacs to parse a file as c++ is to add in-file variable specifications, such as:\r\n// -*- c++ -*-\r\nor\r\n// -*- C++ -*-\r\nor\r\n// -*- mode: c++ -*-\r\nor\r\n// -*- mode: C++ -*-\r\nor\r\n/* Local Variables: */\r\n/* mode:c++         */\r\n/* comment-column:0 */\r\n/* End:             */\r\n\r\nAn example of one very common usage: https://github.com/google/libcxx/blob/master/include/iostream\r\n\r\nlinguist doesn't recognize these correctly, rather it seems to want a line like this:\r\n// -*- mode: cpp -*-\r\nwhich is wrong, because \"cpp\" is not a valid emacs major mode, and will not work in emacs.  Linguist is also unable to recognize the common short-hand:\r\n// -*- c++ -*-\r\nand even the non-sensical (but conforming to linguist's mistaken assumption that there's an emacs mode called 'cpp') doesn't work:\r\n// -*- cpp -*-\r\n\r\nFor a description of the two methods that Emacs reads file modes (local variables, actually) from a file, please see:\r\nhttp://ergoemacs.org/emacs_manual/emacs/Specifying-File-Variables.html\r\n\r\nFor a description of the general mechanism that Emacs (and Emacsen) use to choose a major mode: http://ergoemacs.org/emacs_manual/emacs/Choosing-Modes.html\r\n\r\nSorry I dont have time to fix this with a push request, but I hope a clear description of the issue helps.\r\n"}}