1
1

docs: move the descriptions of 'header' and 'magic' next to 'syntax'

And reword them too, so that it is clearer what the mechanism is
for determining which syntax to use for a file.
Этот коммит содержится в:
Benno Schulenberg 2017-07-15 12:32:57 +02:00
родитель 8b3213cadb
Коммит e4a69f8b94
2 изменённых файлов: 27 добавлений и 26 удалений

Просмотреть файл

@ -951,6 +951,19 @@ and applies to files that don't match any syntax's @var{fileregex}.
The @code{none} syntax is reserved; specifying it on the
command line is the same as not having a syntax at all.
@item header "@var{regex}" @dots{}
If from all defined syntaxes no @var{fileregex} matched, then compare
this @var{regex} (or regexes) against the first line of the current file,
to determine whether this syntax should be used for it.
@item magic "@var{regex}" @dots{}
If no @var{fileregex} matched and no @code{header} regex matched
either, then compare this @var{regex} (or regexes) against the
result of querying the @code{magic} database about the current
file, to determine whether this syntax should be used for it.
(This functionality only works when @code{libmagic} is installed
on the system and will be silently ignored otherwise.)
@item linter @var{program} [@var{arg} @dots{}]
Use the given @var{program} to do a syntax check on the current file.
(This overrides the speller function.)
@ -960,18 +973,6 @@ Use the given @var{program} to automatically reformat text ---
useful for a programming language like Go.
(This overrides the speller and linter functions.)
@item header "@var{regex}" @dots{}
Add one or more regexes which will
be compared against the very first line of the file to be edited,
to determine whether this syntax should be used for that file.
@item magic "@var{regex}" @dots{}
Add one or more regexes which will be
compared against the result of querying the magic database about the file
to be edited, to determine whether this syntax should be used for that
file. This functionality only works when libmagic is installed on the
system and will be silently ignored otherwise.
@item comment "@var{string}"
Use the given string for commenting and uncommenting lines.
If the string contains a vertical bar or pipe character (@t{|}),

Просмотреть файл

@ -315,6 +315,19 @@ and applies to files that don't match any syntax's regexes.
The syntax "\fBnone\fP" is reserved; specifying it on the command line
is the same as not having a syntax at all.
.TP
.BR header " ""\fIregex\fR"" " ...
If from all defined syntaxes no \fIfileregex\fR matched, then compare
this \fIregex\fR (or regexes) against the first line of the current file,
to determine whether this syntax should be used for it.
.TP
.BR magic " ""\fIregex\fR"" " ...
If no \fIfileregex\fR matched and no \fBheader\fR regex matched
either, then compare this \fIregex\fR (or regexes) against the
result of querying the \fBmagic\fP database about the current
file, to determine whether this syntax should be used for it.
(This functionality only works when \fBlibmagic\fP is installed on the
system and will be silently ignored otherwise.)
.TP
.BI linter " program " \fR[ "arg " \fR...]
Use the given \fIprogram\fR to run a syntax check on the current file.
(This overrides the speller function.)
@ -324,20 +337,7 @@ Use the given \fIprogram\fR to automatically reformat text --
useful in a programming language like Go.
(This overrides the speller and linter functions.)
.TP
.BR header " \fIregex\fR " ...
Add one or more regexes which will
be compared against the very first line of the file to be edited,
to determine whether this syntax should be used for that file.
.TP
.BR magic " \fIregex\fR " ...
Add one or more regexes which
will be compared against the result of querying the \fBmagic\fP
database about the file to be edited, to determine whether this
syntax should be used for that file. This
functionality only works when \fBlibmagic\fP is installed on the
system and will be silently ignored otherwise.
.TP
.BI comment " string"
.BR comment " ""\fIstring\fR"""
Use the given string for commenting and uncommenting lines.
If the string contains a vertical bar or pipe character (\fB|\fR),
this designates bracket-style comments; for example, "\fB/*|*/\fR" for