commit bacb0f717dbe6f5d2311bda2ed937b910a56ed93
parent 11a3bc484c7f60657402ab80f649f4356f0ad11e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 19 Nov 2017 11:10:53 +0100
syntax: adjust the magic strings for the changes since file-5.10
Since file-5.10 (end of 2011), libmagic identifies a C file in most
cases as "C source" instead of as "C program". Nano's magic strings
for some other files didn't match any more what file-5.32 currently
produces, either. So, they have been adjusted, new ones added, and
old ones deleted.
This fixes https://savannah.gnu.org/bugs/?52445.
Diffstat:
22 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/syntax/asm.nanorc b/syntax/asm.nanorc
@@ -1,7 +1,7 @@
## Here is an example for assembler.
syntax "asm" "\.(S|s|asm)$"
-magic "[Aa]ssembl(y|er)"
+magic "assembler source"
comment "//"
color red "\<[A-Z_]{2,}\>"
diff --git a/syntax/awk.nanorc b/syntax/awk.nanorc
@@ -1,7 +1,7 @@
## Here is an example for awk.
syntax "awk" "\.awk$"
-magic "awk.*script text"
+magic "awk script"
comment "#"
# Records.
diff --git a/syntax/c.nanorc b/syntax/c.nanorc
@@ -1,7 +1,7 @@
## Here is an example for C/C++.
syntax "c" "\.(c(c|pp|xx|\+\+)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
-magic "(ASCII|UTF-8 Unicode) C(\+\+)? program text"
+magic "^(C|C\+\+) (source|program)"
comment "//"
# Constants.
diff --git a/syntax/elisp.nanorc b/syntax/elisp.nanorc
@@ -1,6 +1,7 @@
## Here is an example for Emacs Lisp.
syntax "elisp" "\.el$"
+magic "Lisp/Scheme program"
comment ";"
# Basic functions/macros
diff --git a/syntax/guile.nanorc b/syntax/guile.nanorc
@@ -2,7 +2,6 @@
syntax "guile" "\.scm$"
header "^#!.*guile"
-magic "guile"
comment ";"
# Basic scheme functions
diff --git a/syntax/html.nanorc b/syntax/html.nanorc
@@ -1,7 +1,7 @@
## Here is an example for HTML.
syntax "html" "\.html?$"
-magic "HTML document text"
+magic "HTML document"
comment "<!--|-->"
# Tags:
diff --git a/syntax/lua.nanorc b/syntax/lua.nanorc
@@ -5,6 +5,7 @@
## Version: 2011-05-05
syntax "lua" "\.lua$"
+magic "Lua script"
comment "--"
color brightwhite "\[\[.*\]\]"
diff --git a/syntax/makefile.nanorc b/syntax/makefile.nanorc
@@ -1,6 +1,7 @@
## Here is an example for Makefiles.
syntax "makefile" "Makefile[^/]*$" "\.(make|mk)$"
+magic "makefile script"
comment "#"
color red "[:=]"
diff --git a/syntax/man.nanorc b/syntax/man.nanorc
@@ -1,7 +1,7 @@
## Here is an example for manpages.
syntax "man" "\.[1-9]x?$"
-magic "troff or preprocessor input text"
+magic "troff or preprocessor input"
comment ".\""
color green "\.(SH|SS|TH) .*$"
diff --git a/syntax/objc.nanorc b/syntax/objc.nanorc
@@ -1,6 +1,7 @@
## Here is an example for C/C++/Obj-C.
syntax "m" "\.m$"
+magic "Objective-C source"
comment "//"
# Stuffs,
diff --git a/syntax/ocaml.nanorc b/syntax/ocaml.nanorc
@@ -1,6 +1,7 @@
## Syntax highlighting for OCaml.
syntax "ocaml" "\.mli?$"
+magic "OCaml"
comment "(*|*)"
# Uid:
diff --git a/syntax/patch.nanorc b/syntax/patch.nanorc
@@ -1,7 +1,7 @@
## Here is an example for patch files.
syntax "patch" "\.(patch|diff|debdiff)$"
-magic "diff output text"
+magic "diff output"
# There is no official support for comments in patch files.
comment ""
diff --git a/syntax/perl.nanorc b/syntax/perl.nanorc
@@ -2,7 +2,7 @@
syntax "perl" "\.p[lm]$"
header "^#!.*perl[-0-9._]*"
-magic "Perl script text"
+magic "Perl script"
comment "#"
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
diff --git a/syntax/php.nanorc b/syntax/php.nanorc
@@ -1,7 +1,7 @@
## Here is an example for PHP.
syntax "php" "\.ph(p[23457s~]?|tml)$"
-magic "PHP script text"
+magic "PHP script"
comment "//"
# PHP markings.
diff --git a/syntax/postgresql.nanorc b/syntax/postgresql.nanorc
@@ -1,7 +1,6 @@
## Here is an example for PostgreSQL.
syntax "sql" "\.sql[2345s~]?$"
-magic "PostgreSQL script text"
comment "-- "
# Functions.
diff --git a/syntax/python.nanorc b/syntax/python.nanorc
@@ -2,6 +2,7 @@
syntax "python" "\.py$"
header "^#!.*python[-0-9._]*"
+magic "Python script"
linter pyflakes
comment "#"
diff --git a/syntax/ruby.nanorc b/syntax/ruby.nanorc
@@ -2,6 +2,7 @@
syntax "ruby" "\.rb$"
header "^#!.*ruby[-0-9._]*"
+magic "Ruby script"
linter ruby -w -c
comment "#"
diff --git a/syntax/sh.nanorc b/syntax/sh.nanorc
@@ -2,7 +2,7 @@
syntax "sh" "\.sh$"
header "^#!.*((ba|da|k|pdk)?sh[-0-9_]*|openrc-run|runscript)"
-magic "(POSIX|Bourne.*) shell script text"
+magic "(POSIX|Bourne-Again) shell script.*text"
linter dash -n
comment "#"
diff --git a/syntax/tcl.nanorc b/syntax/tcl.nanorc
@@ -1,6 +1,7 @@
## Syntax highlighting for Tcl files.
syntax "tcl" "\.tcl$"
+magic "Tcl(/Tk)? script"
comment "#"
# Standard Tcl [info commands]:
diff --git a/syntax/tex.nanorc b/syntax/tex.nanorc
@@ -1,6 +1,7 @@
## Here is a short example for TeX files.
syntax "tex" "\.tex$"
+magic "(La)?TeX document"
linter chktex -v0 -q -I
comment "%"
diff --git a/syntax/texinfo.nanorc b/syntax/texinfo.nanorc
@@ -2,7 +2,7 @@
syntax "texinfo" "\.texi$"
header "^\\input texinfo"
-magic "Texinfo source text"
+magic "Texinfo source"
comment "@c "
# Command arguments, trailing and enclosed.
diff --git a/syntax/xml.nanorc b/syntax/xml.nanorc
@@ -2,7 +2,7 @@
syntax "xml" "\.([jrsx]html?|jnlp|mml|pom|rng|sgml?|svg|w[as]dl|wsdd|xjb|xml|xs(d|lt?)|xul)$"
header "<\?xml.*version=.*\?>"
-magic "(XML|SGML) (sub)?document text"
+magic "(XML|SGML) (sub)?document"
comment "<!--|-->"
# The entire content of the tag: