Merge pull request #2233 from tesch1/tesch1-emacs-patch-1

fix emacs modeline parsing
This commit is contained in:
Arfon Smith
2015-03-31 19:27:33 -05:00
15 changed files with 49 additions and 3 deletions

View File

@@ -3134,6 +3134,8 @@ Tea:
Text:
type: prose
wrap: true
aliases:
- fundamental
extensions:
- .txt
- .fr

View File

@@ -1,7 +1,7 @@
module Linguist
module Strategy
class Modeline
EmacsModeline = /-\*-\s*mode:\s*(\w+);?\s*-\*-/i
EmacsModeline = /-\*-\s*(?:(?!mode)[\w-]+\s*:\s*(?:[\w+-]+)\s*;?\s*)*(?:mode\s*:)?\s*([\w+-]+)\s*(?:;\s*(?!mode)[\w-]+\s*:\s*[\w+-]+\s*)*;?\s*-\*-/i
VimModeline = /\/\*\s*vim:\s*set\s*(?:ft|filetype)=(\w+):\s*\*\//i
# Public: Detects language based on Vim and Emacs modelines