syntax: c: recognize some C++ header files by their Emacs modeline

For extensionless files, recognize C/C++ ones from the mode name
between the -*- marks on the first line.

This addresses https://savannah.gnu.org/patch/?9719.

Inspired-by: Devin Hussey <husseydevin@gmail.com>
This commit is contained in:
Benno Schulenberg 2019-10-06 11:29:48 +02:00
parent ff0e01a69e
commit 2698a2ba68
1 changed files with 1 additions and 0 deletions

View File

@ -1,6 +1,7 @@
## Here is an example for C/C++.
syntax c "\.([ch](pp|xx)?|C|cc|c\+\+|cu|H|hh|ii?)$"
header "-\*-.*\<C(\+\+)?((;|\s).*)?-\*-"
magic "^(C|C\+\+) (source|program)"
comment "//"