summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS19
-rw-r--r--etc/etags.115
2 files changed, 27 insertions, 7 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 7d993150cd6..5736b243aff 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -570,11 +570,11 @@ comparison.
** Etags changes.
*** New syntax for regular expressions, multi-line regular expressions.
-The syntax --ignore-case-regexp=/REGEX/NAME/ is now undocumented and
-retained only for backward compatibility. The new equivalent syntax is
---regex=/REGEX/NAME/i. More generally, it is --regex=/REGEX/NAME/MODS,
-where `/NAME' is optional, as usual, and MODS is a string of 0 or more
-characters among `i' (ignore case), `m' (multi-line) and `s'
+The syntax --ignore-case-regexp=/regex/ is now undocumented and retained
+only for backward compatibility. The new equivalent syntax is
+--regex=/regex/i. More generally, it is --regex=/TAGREGEX/TAGNAME/MODS,
+where `/TAGNAME' is optional, as usual, and MODS is a string of 0 or
+more characters among `i' (ignore case), `m' (multi-line) and `s'
(single-line). The `m' and `s' modifiers behave as in Perl regular
expressions: `m' allows regexps to match more than one line, while `s'
(which implies `m') means that `.' matches newlines. The ability to
@@ -586,6 +586,15 @@ The escaped character sequence \a, \b, \d, \e, \f, \n, \r, \t, \v,
respectively, stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL,
CR, TAB, VT,
+*** Regular expressions can be bound to a given language
+The syntax --regex={LANGUAGE}REGEX means that REGEX is used to make tags
+only for files of language LANGUAGE, and ignored otherwise. This is
+particularly useful when storing regexps in a file.
+
+*** Regular expressions can be read from a file
+The --regex=@regexfile option means read the regexps from a file, one
+per line. Lines beginning with space or tab are ignored.
+
*** In Prolog, etags creates tags for rules in addition to predicates.
*** In Perl, packages are tags.
diff --git a/etc/etags.1 b/etc/etags.1
index 75af1ef437a..e1846a09e17 100644
--- a/etc/etags.1
+++ b/etc/etags.1
@@ -152,9 +152,11 @@ Make tags based on regexp matching for the files following this option,
in addition to the tags made with the standard parsing based on
language. May be freely intermixed with filenames and the \fB\-R\fP
option. The regexps are cumulative, i.e. each such option will add to
-the previous ones. The regexps are of the form:
+the previous ones. The regexps are of one of the forms:
.br
- \fB/\fP\fItagregexp/\fP[\fInameregexp\fP\fB/\fP]\fImodifiers\fP
+ [\fB{\fP\fIlanguage\fP\fB}\fP]\fB/\fP\fItagregexp/\fP[\fInameregexp\fP\fB/\fP]\fImodifiers\fP
+.br
+ \fB@\fP\fIregexfile\fP
.br
where \fItagregexp\fP is used to match the tag. It should not match
@@ -173,6 +175,15 @@ that the \fItagregexp\fP will be matched against the whole file contents
at once, rather than line by line, and the matching sequence can match
multiple lines; and \fIs\fP, which implies \fIm\fP and means that the
dot character in \fItagregexp\fP matches the newline char as well.
+.br
+cthe optional \fB{\fP\fIlanguage\fP\fB}\fP means that the tag should be
+created only for files of language \fIlanguage\fP, and ignored
+otherwise. This is particularly useful when storing many predefined
+regexps in a file.
+.br
+In its second form, \fIregexfile\fP is the name of a file containing
+regexps, one per line. Lines beginning with a space or tab are assumed
+to be comments, and ignored.
.br
Here are some examples. All the regexps are quoted to protect them