diff options
| author | Richard M. Stallman | 2002-07-07 23:42:46 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-07-07 23:42:46 +0000 |
| commit | ed1b7d5eda0334b9560013f313b90f483c561c39 (patch) | |
| tree | 4e47206894339ed2762cd012e29ef7c48b5d7be2 | |
| parent | 44fa0ae8d4610e8acf4a91d80b2323ac5496c32b (diff) | |
| download | emacs-ed1b7d5eda0334b9560013f313b90f483c561c39.tar.gz emacs-ed1b7d5eda0334b9560013f313b90f483c561c39.zip | |
Describe add-log-always-start-new-record.
Substantial rewrite of etags regexp option text.
| -rw-r--r-- | man/maintaining.texi | 148 |
1 files changed, 54 insertions, 94 deletions
diff --git a/man/maintaining.texi b/man/maintaining.texi index a9d126816e3..16d63a463d2 100644 --- a/man/maintaining.texi +++ b/man/maintaining.texi | |||
| @@ -103,6 +103,11 @@ change log entry. It finds the version number by searching the first | |||
| 103 | ten percent of the file, using regular expressions from the variable | 103 | ten percent of the file, using regular expressions from the variable |
| 104 | @code{change-log-version-number-regexp-list}. | 104 | @code{change-log-version-number-regexp-list}. |
| 105 | 105 | ||
| 106 | @vindex add-log-always-start-new-record | ||
| 107 | If @code{add-log-always-start-new-record} is non-@code{nil}, | ||
| 108 | @kbd{C-x 4 a} always makes a new entry, even if the last entry | ||
| 109 | was made by you and on the same date. | ||
| 110 | |||
| 106 | @cindex Change Log mode | 111 | @cindex Change Log mode |
| 107 | @findex change-log-mode | 112 | @findex change-log-mode |
| 108 | The change log file is visited in Change Log mode. In this major | 113 | The change log file is visited in Change Log mode. In this major |
| @@ -474,95 +479,51 @@ explanation. | |||
| 474 | 479 | ||
| 475 | The @samp{--regex} option provides a general way of recognizing tags | 480 | The @samp{--regex} option provides a general way of recognizing tags |
| 476 | based on regexp matching. You can freely intermix it with file names. | 481 | based on regexp matching. You can freely intermix it with file names. |
| 477 | Each @samp{--regex} option adds to the preceding ones, and applies only | 482 | If you specify multiple @samp{--regex} options, all of them are used |
| 478 | to the following files. The syntax is: | 483 | in parallel, but each one applies only to the source files that follow |
| 484 | it. The syntax is: | ||
| 479 | 485 | ||
| 480 | @smallexample | 486 | @smallexample |
| 481 | --regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers} | 487 | --regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers} |
| 482 | @end smallexample | 488 | @end smallexample |
| 483 | 489 | ||
| 484 | @noindent | 490 | The essential part of the option value is @var{tagregexp}, the |
| 485 | or else: | 491 | regexp for matching tags. It is always used anchored, that is, it |
| 486 | 492 | only matches at the beginning of a line. If you want to allow | |
| 487 | @smallexample | 493 | indented tags, use a regexp that matches initial whitespace; start it |
| 488 | --regex=@@@var{regexfile} | 494 | with @samp{[ \t]*}. |
| 489 | @end smallexample | 495 | |
| 490 | 496 | In these regular expressions, @samp{\} quotes the next character, and | |
| 491 | @noindent | 497 | all the GCC character escape sequences are supported (@samp{\a} for |
| 492 | where @var{tagregexp} is a regular expression used to find the tags. | 498 | bell, @samp{\b} for back space, @samp{\d} for delete, @samp{\e} for |
| 493 | It is always | 499 | escape, @samp{\f} for formfeed, @samp{\n} for newline, @samp{\r} for |
| 494 | anchored, that is, it behaves as if preceded by @samp{^}. If you want | 500 | carriage return, @samp{\t} for tab, and @samp{\v} for vertical tab). |
| 495 | to account for indentation, just match any initial number of blanks by | 501 | |
| 496 | beginning your regular expression with @samp{[ \t]*}. In the regular | 502 | Ideally, @var{tagregexp} should not match more characters than are |
| 497 | expressions, @samp{\} quotes the next character, and all the | 503 | needed to recognize what you want to tag. If the syntax requires you |
| 498 | @code{gcc} character escape sequences are supported. Here is the list | 504 | to write @var{tagregexp} so it matches more characters beyond the tag |
| 499 | of the character escape sequences: | 505 | itself, you should add a @var{nameregexp}, to pick out just the tag. |
| 500 | 506 | This will enable Emacs to find tags more accurately and to do | |
| 501 | @table @samp | 507 | completion on tag names more reliably. You can find some examples |
| 502 | @item \a | 508 | below. |
| 503 | BEL (bell). | 509 | |
| 504 | @item \b | 510 | The @var{modifiers} are a sequence of zero or more characters that |
| 505 | BS (back space). | 511 | modify the way @code{etags} does the matching. A regexp with no |
| 506 | @item \d | 512 | modifiers is applied sequentially to each line of the input file, in a |
| 507 | DEL (delete). | 513 | case-sensitive way. The modifiers and their meanings are: |
| 508 | @item \e | ||
| 509 | ESC (delete). | ||
| 510 | @item \f | ||
| 511 | FF (form feed). | ||
| 512 | @item \n | ||
| 513 | NL (new line). | ||
| 514 | @item \r | ||
| 515 | CR (carriage return). | ||
| 516 | @item \t | ||
| 517 | TAB (horizontal tab). | ||
| 518 | @item \v | ||
| 519 | VT (vertical tab). | ||
| 520 | @end table | ||
| 521 | |||
| 522 | @noindent | ||
| 523 | The syntax of regular expressions in @code{etags} is the same as in | ||
| 524 | Emacs. | ||
| 525 | |||
| 526 | You should not match more characters with @var{tagregexp} than that | ||
| 527 | needed to recognize what you want to tag. If the match is such that | ||
| 528 | more characters than needed are unavoidably matched by @var{tagregexp} | ||
| 529 | (as will sometimes be the case), you should add a @var{nameregexp}, to | ||
| 530 | pick out just the tag. This will enable Emacs to find tags more | ||
| 531 | accurately and to do completion on tag names more reliably. You can | ||
| 532 | find some examples below. | ||
| 533 | |||
| 534 | The suggested separator character used to delimit @var{tagregexp} | ||
| 535 | and @var{nameregex} is @samp{/}, as in the example above. However, | ||
| 536 | you can use any other character as a separator, as long as it is | ||
| 537 | different from space, tab, braces or the @samp{@@} character. If you | ||
| 538 | need to use the separator as part of the regular expression, you must | ||
| 539 | precede it by the @samp{\} character. | ||
| 540 | |||
| 541 | The @var{modifiers} are a sequence of 0 or more characters that | ||
| 542 | modify the way @code{etags} does the matching for that particular | ||
| 543 | @samp{--regex} option. Without modifiers, the regular expression | ||
| 544 | is applied sequentially to each line of the input file, in | ||
| 545 | a case-sensitive way. The modifiers and their meanings are: | ||
| 546 | 514 | ||
| 547 | @table @samp | 515 | @table @samp |
| 548 | @item i | 516 | @item i |
| 549 | ignore case when matching. | 517 | Ignore case when matching this regexp. |
| 550 | @item m | 518 | @item m |
| 551 | do not match line by line; rather, match this regular expression | 519 | Match this regular expression against the whole file, so that |
| 552 | against the whole file, so that multi-line matches are possible. | 520 | multi-line matches are possible. |
| 553 | @item s | 521 | @item s |
| 554 | implies @samp{m}, and causes dots in @var{tagregexp} to match newlines | 522 | Match this regular expression against the whole file, and allow |
| 555 | as well. | 523 | @samp{.} in @var{tagregexp} to match newlines. |
| 556 | @end table | 524 | @end table |
| 557 | 525 | ||
| 558 | A @var{regexfile} is the name of a file where you can store the | 526 | The @samp{-R} option cancels all the regexps defined by preceding |
| 559 | arguments of @samp{--regex} options, one per line. The syntax is the | ||
| 560 | same as the one used for the @samp{--regex} option, without the | ||
| 561 | initial @samp{--regex=} part. @code{etags} ignores the lines that | ||
| 562 | begin with space or tab: you can use them to include comments in the | ||
| 563 | @var{regexfile}. | ||
| 564 | |||
| 565 | The @samp{-R} option deletes all the regexps defined with | ||
| 566 | @samp{--regex} options. It applies to the file names following it, as | 527 | @samp{--regex} options. It applies to the file names following it, as |
| 567 | you can see from the following example: | 528 | you can see from the following example: |
| 568 | 529 | ||
| @@ -580,8 +541,8 @@ Here @code{etags} chooses the parsing language for @file{voo.doo} and | |||
| 580 | @file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while | 541 | @file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while |
| 581 | @var{reg2} is checked against the whole @file{bar.ber} file, | 542 | @var{reg2} is checked against the whole @file{bar.ber} file, |
| 582 | permitting multi-line matches, in a case-sensitive way. @code{etags} | 543 | permitting multi-line matches, in a case-sensitive way. @code{etags} |
| 583 | uses the Lisp tags rules, and no regexp matching, to recognize tags in | 544 | uses only the Lisp tags rules, with no user-specified regexp matching, |
| 584 | @file{los.er}. | 545 | to recognize tags in @file{los.er}. |
| 585 | 546 | ||
| 586 | You can restrict a @samp{--regex} option to match only files of a | 547 | You can restrict a @samp{--regex} option to match only files of a |
| 587 | given language by using the optional prefix @var{@{language@}}. | 548 | given language by using the optional prefix @var{@{language@}}. |
| @@ -596,26 +557,25 @@ files, for the C language only: | |||
| 596 | @end smallexample | 557 | @end smallexample |
| 597 | 558 | ||
| 598 | @noindent | 559 | @noindent |
| 599 | This feature is particularly useful when you store a list of regular | 560 | When you have complex regular expressions, you can store the list of |
| 600 | expressions in a file. The following option syntax instructs | 561 | them in a file. The following option syntax instructs @code{etags} to |
| 601 | @code{etags} to read two files of regular expressions. The regular | 562 | read two files of regular expressions. The regular expressions |
| 602 | expressions contained in the second file are matched without regard to | 563 | contained in the second file are matched without regard to case. |
| 603 | case. | ||
| 604 | 564 | ||
| 605 | @smallexample | 565 | @smallexample |
| 606 | --regex=@@first-file --ignore-case-regex=@@second-file | 566 | --regex=@@@var{case-sensitive-file} --ignore-case-regex=@@@var{ignore-case-file} |
| 607 | @end smallexample | 567 | @end smallexample |
| 608 | 568 | ||
| 609 | @noindent | 569 | @noindent |
| 610 | A regex file contains one regular expressions per line. Empty lines, | 570 | A regex file for @code{etags} contains one regular expression per |
| 611 | and lines beginning with space or tab are ignored. When the first | 571 | line. Empty lines, and lines beginning with space or tab are ignored. |
| 612 | character in a line is @samp{@@}, @code{etags} assumes that the rest | 572 | When the first character in a line is @samp{@@}, @code{etags} assumes |
| 613 | of the line is the name of a file of regular expressions; thus, one | 573 | that the rest of the line is the name of another file of regular |
| 614 | such file can include another file. All the other lines are taken to | 574 | expressions; thus, one such file can include another file. All the |
| 615 | be regular expressions. If the first non-whitespace text on the line | 575 | other lines are taken to be regular expressions. If the first |
| 616 | is @samp{--}, that line is a comment. | 576 | non-whitespace text on the line is @samp{--}, that line is a comment. |
| 617 | 577 | ||
| 618 | For example, one can create a file called @samp{emacs.tags} with the | 578 | For example, we can create a file called @samp{emacs.tags} with the |
| 619 | following contents: | 579 | following contents: |
| 620 | 580 | ||
| 621 | @smallexample | 581 | @smallexample |