aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Potortì2002-06-13 12:10:39 +0000
committerFrancesco Potortì2002-06-13 12:10:39 +0000
commitdf3eebcbcffcf9fd3d96796856e6272cb2bdc01f (patch)
treefe31b841bd1db2930394011e797d4e581bed2bce
parentcc76b31124d08a3aa6de24a0dfd73398ecb10a19 (diff)
downloademacs-df3eebcbcffcf9fd3d96796856e6272cb2bdc01f.tar.gz
emacs-df3eebcbcffcf9fd3d96796856e6272cb2bdc01f.zip
New {language} and @regexp features.
-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.
570** Etags changes. 570** Etags changes.
571 571
572*** New syntax for regular expressions, multi-line regular expressions. 572*** New syntax for regular expressions, multi-line regular expressions.
573The syntax --ignore-case-regexp=/REGEX/NAME/ is now undocumented and 573The syntax --ignore-case-regexp=/regex/ is now undocumented and retained
574retained only for backward compatibility. The new equivalent syntax is 574only for backward compatibility. The new equivalent syntax is
575--regex=/REGEX/NAME/i. More generally, it is --regex=/REGEX/NAME/MODS, 575--regex=/regex/i. More generally, it is --regex=/TAGREGEX/TAGNAME/MODS,
576where `/NAME' is optional, as usual, and MODS is a string of 0 or more 576where `/TAGNAME' is optional, as usual, and MODS is a string of 0 or
577characters among `i' (ignore case), `m' (multi-line) and `s' 577more characters among `i' (ignore case), `m' (multi-line) and `s'
578(single-line). The `m' and `s' modifiers behave as in Perl regular 578(single-line). The `m' and `s' modifiers behave as in Perl regular
579expressions: `m' allows regexps to match more than one line, while `s' 579expressions: `m' allows regexps to match more than one line, while `s'
580(which implies `m') means that `.' matches newlines. The ability to 580(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,
586respectively, stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL, 586respectively, stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL,
587CR, TAB, VT, 587CR, TAB, VT,
588 588
589*** Regular expressions can be bound to a given language
590The syntax --regex={LANGUAGE}REGEX means that REGEX is used to make tags
591only for files of language LANGUAGE, and ignored otherwise. This is
592particularly useful when storing regexps in a file.
593
594*** Regular expressions can be read from a file
595The --regex=@regexfile option means read the regexps from a file, one
596per line. Lines beginning with space or tab are ignored.
597
589*** In Prolog, etags creates tags for rules in addition to predicates. 598*** In Prolog, etags creates tags for rules in addition to predicates.
590 599
591*** In Perl, packages are tags. 600*** 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,
152in addition to the tags made with the standard parsing based on 152in addition to the tags made with the standard parsing based on
153language. May be freely intermixed with filenames and the \fB\-R\fP 153language. May be freely intermixed with filenames and the \fB\-R\fP
154option. The regexps are cumulative, i.e. each such option will add to 154option. The regexps are cumulative, i.e. each such option will add to
155the previous ones. The regexps are of the form: 155the previous ones. The regexps are of one of the forms:
156.br 156.br
157 \fB/\fP\fItagregexp/\fP[\fInameregexp\fP\fB/\fP]\fImodifiers\fP 157 [\fB{\fP\fIlanguage\fP\fB}\fP]\fB/\fP\fItagregexp/\fP[\fInameregexp\fP\fB/\fP]\fImodifiers\fP
158.br
159 \fB@\fP\fIregexfile\fP
158.br 160.br
159 161
160where \fItagregexp\fP is used to match the tag. It should not match 162where \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
173at once, rather than line by line, and the matching sequence can match 175at once, rather than line by line, and the matching sequence can match
174multiple lines; and \fIs\fP, which implies \fIm\fP and means that the 176multiple lines; and \fIs\fP, which implies \fIm\fP and means that the
175dot character in \fItagregexp\fP matches the newline char as well. 177dot character in \fItagregexp\fP matches the newline char as well.
178.br
179cthe optional \fB{\fP\fIlanguage\fP\fB}\fP means that the tag should be
180created only for files of language \fIlanguage\fP, and ignored
181otherwise. This is particularly useful when storing many predefined
182regexps in a file.
183.br
184In its second form, \fIregexfile\fP is the name of a file containing
185regexps, one per line. Lines beginning with a space or tab are assumed
186to be comments, and ignored.
176 187
177.br 188.br
178Here are some examples. All the regexps are quoted to protect them 189Here are some examples. All the regexps are quoted to protect them