diff options
| author | Stefan Kangas | 2022-11-06 23:21:01 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2022-11-06 23:21:01 +0100 |
| commit | 61d55ce3bb4dc1f7deac552439c61bbe0909dcdb (patch) | |
| tree | e8dd99405ac50de77f19d32b395c7bad6ac61c7a | |
| parent | 8fe62b2ab571ba313587e8543006eca03ff36025 (diff) | |
| parent | 70fb03a49af07bd644e831c7d2e8d219aa910535 (diff) | |
| download | emacs-61d55ce3bb4dc1f7deac552439c61bbe0909dcdb.tar.gz emacs-61d55ce3bb4dc1f7deac552439c61bbe0909dcdb.zip | |
Merge from origin/emacs-28
70fb03a49a ; * doc/emacs/search.texi (Lax Search): Improve suggestion...
5779df0c5b ; * doc/lispref/searching.texi: Remove reference to Posix....
46929f6b73 ; Improve documentation of character classes in regexps
| -rw-r--r-- | doc/emacs/search.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 39 |
2 files changed, 25 insertions, 16 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 0090bc34005..63541d78a5a 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -1359,7 +1359,7 @@ Hence, @w{@samp{foo bar}} matches @w{@samp{foo bar}}, @w{@samp{foo@ @ | |||
| 1359 | bar}}, @w{@samp{foo@ @ @ bar}}, and so on (but not @samp{foobar}). If | 1359 | bar}}, @w{@samp{foo@ @ @ bar}}, and so on (but not @samp{foobar}). If |
| 1360 | you want to make spaces match sequences of newlines as well as spaces | 1360 | you want to make spaces match sequences of newlines as well as spaces |
| 1361 | and tabs, customize the option to make its value be the regular | 1361 | and tabs, customize the option to make its value be the regular |
| 1362 | expression @samp{[[:space:]\n]+}. (The default behavior of the | 1362 | expression @samp{[ \t\n]+}. (The default behavior of the |
| 1363 | incremental regexp search is different; see @ref{Regexp Search}.) | 1363 | incremental regexp search is different; see @ref{Regexp Search}.) |
| 1364 | 1364 | ||
| 1365 | If you want whitespace characters to match exactly, you can turn lax | 1365 | If you want whitespace characters to match exactly, you can turn lax |
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 743718b560f..ad7f2856de8 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -395,13 +395,12 @@ range should not be the starting point of another one; for example, | |||
| 395 | @samp{[a-m-z]} should be avoided. | 395 | @samp{[a-m-z]} should be avoided. |
| 396 | 396 | ||
| 397 | A character alternative can also specify named character classes | 397 | A character alternative can also specify named character classes |
| 398 | (@pxref{Char Classes}). This is a POSIX feature. For example, | 398 | (@pxref{Char Classes}). For example, @samp{[[:ascii:]]} matches any |
| 399 | @samp{[[:ascii:]]} matches any @acronym{ASCII} character. | 399 | @acronym{ASCII} character. Using a character class is equivalent to |
| 400 | Using a character class is equivalent to mentioning each of the | 400 | mentioning each of the characters in that class; but the latter is not |
| 401 | characters in that class; but the latter is not feasible in practice, | 401 | feasible in practice, since some classes include thousands of |
| 402 | since some classes include thousands of different characters. | 402 | different characters. A character class should not appear as the |
| 403 | A character class should not appear as the lower or upper bound | 403 | lower or upper bound of a range. |
| 404 | of a range. | ||
| 405 | 404 | ||
| 406 | The usual regexp special characters are not special inside a | 405 | The usual regexp special characters are not special inside a |
| 407 | character alternative. A completely different set of characters is | 406 | character alternative. A completely different set of characters is |
| @@ -617,7 +616,7 @@ This matches any character whose code is in the range 0--31. | |||
| 617 | This matches @samp{0} through @samp{9}. Thus, @samp{[-+[:digit:]]} | 616 | This matches @samp{0} through @samp{9}. Thus, @samp{[-+[:digit:]]} |
| 618 | matches any digit, as well as @samp{+} and @samp{-}. | 617 | matches any digit, as well as @samp{+} and @samp{-}. |
| 619 | @item [:graph:] | 618 | @item [:graph:] |
| 620 | This matches graphic characters---everything except whitespace, | 619 | This matches graphic characters---everything except spaces, |
| 621 | @acronym{ASCII} and non-@acronym{ASCII} control characters, | 620 | @acronym{ASCII} and non-@acronym{ASCII} control characters, |
| 622 | surrogates, and codepoints unassigned by Unicode, as indicated by the | 621 | surrogates, and codepoints unassigned by Unicode, as indicated by the |
| 623 | Unicode @samp{general-category} property (@pxref{Character | 622 | Unicode @samp{general-category} property (@pxref{Character |
| @@ -625,29 +624,39 @@ Properties}). | |||
| 625 | @item [:lower:] | 624 | @item [:lower:] |
| 626 | This matches any lower-case letter, as determined by the current case | 625 | This matches any lower-case letter, as determined by the current case |
| 627 | table (@pxref{Case Tables}). If @code{case-fold-search} is | 626 | table (@pxref{Case Tables}). If @code{case-fold-search} is |
| 628 | non-@code{nil}, this also matches any upper-case letter. | 627 | non-@code{nil}, this also matches any upper-case letter. Note that a |
| 628 | buffer can have its own local case table different from the default | ||
| 629 | one. | ||
| 629 | @item [:multibyte:] | 630 | @item [:multibyte:] |
| 630 | This matches any multibyte character (@pxref{Text Representations}). | 631 | This matches any multibyte character (@pxref{Text Representations}). |
| 631 | @item [:nonascii:] | 632 | @item [:nonascii:] |
| 632 | This matches any non-@acronym{ASCII} character. | 633 | This matches any non-@acronym{ASCII} character. |
| 633 | @item [:print:] | 634 | @item [:print:] |
| 634 | This matches any printing character---either whitespace, or a graphic | 635 | This matches any printing character---either spaces or graphic |
| 635 | character matched by @samp{[:graph:]}. | 636 | characters matched by @samp{[:graph:]}. |
| 636 | @item [:punct:] | 637 | @item [:punct:] |
| 637 | This matches any punctuation character. (At present, for multibyte | 638 | This matches any punctuation character. (At present, for multibyte |
| 638 | characters, it matches anything that has non-word syntax.) | 639 | characters, it matches anything that has non-word syntax, and thus its |
| 640 | exact definition can vary from one major mode to another, since the | ||
| 641 | syntax of a character depends on the major mode.) | ||
| 639 | @item [:space:] | 642 | @item [:space:] |
| 640 | This matches any character that has whitespace syntax | 643 | This matches any character that has whitespace syntax |
| 641 | (@pxref{Syntax Class Table}). | 644 | (@pxref{Syntax Class Table}). Note that the syntax of a character, |
| 645 | and thus which characters are considered ``whitespace'', | ||
| 646 | depends on the major mode. | ||
| 642 | @item [:unibyte:] | 647 | @item [:unibyte:] |
| 643 | This matches any unibyte character (@pxref{Text Representations}). | 648 | This matches any unibyte character (@pxref{Text Representations}). |
| 644 | @item [:upper:] | 649 | @item [:upper:] |
| 645 | This matches any upper-case letter, as determined by the current case | 650 | This matches any upper-case letter, as determined by the current case |
| 646 | table (@pxref{Case Tables}). If @code{case-fold-search} is | 651 | table (@pxref{Case Tables}). If @code{case-fold-search} is |
| 647 | non-@code{nil}, this also matches any lower-case letter. | 652 | non-@code{nil}, this also matches any lower-case letter. Note that a |
| 653 | buffer can have its own local case table different from the default | ||
| 654 | one. | ||
| 648 | @item [:word:] | 655 | @item [:word:] |
| 649 | This matches any character that has word syntax (@pxref{Syntax Class | 656 | This matches any character that has word syntax (@pxref{Syntax Class |
| 650 | Table}). | 657 | Table}). Note that the syntax of a character, and thus which |
| 658 | characters are considered ``word-constituent'', depends on the major | ||
| 659 | mode. | ||
| 651 | @item [:xdigit:] | 660 | @item [:xdigit:] |
| 652 | This matches the hexadecimal digits: @samp{0} through @samp{9}, @samp{a} | 661 | This matches the hexadecimal digits: @samp{0} through @samp{9}, @samp{a} |
| 653 | through @samp{f} and @samp{A} through @samp{F}. | 662 | through @samp{f} and @samp{A} through @samp{F}. |