diff options
| -rw-r--r-- | etc/NEWS | 19 | ||||
| -rw-r--r-- | etc/etags.1 | 15 |
2 files changed, 27 insertions, 7 deletions
| @@ -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. |
| 573 | The syntax --ignore-case-regexp=/REGEX/NAME/ is now undocumented and | 573 | The syntax --ignore-case-regexp=/regex/ is now undocumented and retained |
| 574 | retained only for backward compatibility. The new equivalent syntax is | 574 | only 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, |
| 576 | where `/NAME' is optional, as usual, and MODS is a string of 0 or more | 576 | where `/TAGNAME' is optional, as usual, and MODS is a string of 0 or |
| 577 | characters among `i' (ignore case), `m' (multi-line) and `s' | 577 | more 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 |
| 579 | expressions: `m' allows regexps to match more than one line, while `s' | 579 | expressions: `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, | |||
| 586 | respectively, stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL, | 586 | respectively, stand for the ASCII characters BEL, BS, DEL, ESC, FF, NL, |
| 587 | CR, TAB, VT, | 587 | CR, TAB, VT, |
| 588 | 588 | ||
| 589 | *** Regular expressions can be bound to a given language | ||
| 590 | The syntax --regex={LANGUAGE}REGEX means that REGEX is used to make tags | ||
| 591 | only for files of language LANGUAGE, and ignored otherwise. This is | ||
| 592 | particularly useful when storing regexps in a file. | ||
| 593 | |||
| 594 | *** Regular expressions can be read from a file | ||
| 595 | The --regex=@regexfile option means read the regexps from a file, one | ||
| 596 | per 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, | |||
| 152 | in addition to the tags made with the standard parsing based on | 152 | in addition to the tags made with the standard parsing based on |
| 153 | language. May be freely intermixed with filenames and the \fB\-R\fP | 153 | language. May be freely intermixed with filenames and the \fB\-R\fP |
| 154 | option. The regexps are cumulative, i.e. each such option will add to | 154 | option. The regexps are cumulative, i.e. each such option will add to |
| 155 | the previous ones. The regexps are of the form: | 155 | the 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 | ||
| 160 | where \fItagregexp\fP is used to match the tag. It should not match | 162 | 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 | |||
| 173 | at once, rather than line by line, and the matching sequence can match | 175 | at once, rather than line by line, and the matching sequence can match |
| 174 | multiple lines; and \fIs\fP, which implies \fIm\fP and means that the | 176 | multiple lines; and \fIs\fP, which implies \fIm\fP and means that the |
| 175 | dot character in \fItagregexp\fP matches the newline char as well. | 177 | dot character in \fItagregexp\fP matches the newline char as well. |
| 178 | .br | ||
| 179 | cthe optional \fB{\fP\fIlanguage\fP\fB}\fP means that the tag should be | ||
| 180 | created only for files of language \fIlanguage\fP, and ignored | ||
| 181 | otherwise. This is particularly useful when storing many predefined | ||
| 182 | regexps in a file. | ||
| 183 | .br | ||
| 184 | In its second form, \fIregexfile\fP is the name of a file containing | ||
| 185 | regexps, one per line. Lines beginning with a space or tab are assumed | ||
| 186 | to be comments, and ignored. | ||
| 176 | 187 | ||
| 177 | .br | 188 | .br |
| 178 | Here are some examples. All the regexps are quoted to protect them | 189 | Here are some examples. All the regexps are quoted to protect them |