diff options
| author | Eli Zaretskii | 2008-10-21 14:01:33 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-10-21 14:01:33 +0000 |
| commit | 3645358ade97894b3e355fdd37f3c9e73d5d62bb (patch) | |
| tree | e66cd3c974e46ad1f6236aece11c4fa55bcb56ce | |
| parent | bf190568e0cda0fa76d274fc4a74bb1d768a20e5 (diff) | |
| download | emacs-3645358ade97894b3e355fdd37f3c9e73d5d62bb.tar.gz emacs-3645358ade97894b3e355fdd37f3c9e73d5d62bb.zip | |
(Regexp Search): Document `string-match-p' and `looking-at-p'.
(POSIX Regexps): Add an xref for "non-greedy".
(Regexp Special): Add @cindex entry for "non-greedy".
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 19 | ||||
| -rw-r--r-- | etc/NEWS | 1 |
3 files changed, 22 insertions, 3 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 3308aa57db0..d3db94bc5fa 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2008-10-21 Eli Zaretskii <eliz@gnu.org> | 1 | 2008-10-21 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * searching.texi (Regexp Search): Document `string-match-p' and | ||
| 4 | `looking-at-p'. | ||
| 5 | (POSIX Regexps): Add an xref for "non-greedy". | ||
| 6 | (Regexp Special): Add @cindex entry for "non-greedy". | ||
| 7 | |||
| 3 | * display.texi (Attribute Functions): Document `face-all-attributes'. | 8 | * display.texi (Attribute Functions): Document `face-all-attributes'. |
| 4 | (Image Cache) <image-refresh>: Minor wording fixes. | 9 | (Image Cache) <image-refresh>: Minor wording fixes. |
| 5 | 10 | ||
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 36c3638b094..e5846028cfd 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -334,6 +334,7 @@ preceding expression either once or not at all. For example, | |||
| 334 | @samp{ca?r} matches @samp{car} or @samp{cr}; nothing else. | 334 | @samp{ca?r} matches @samp{car} or @samp{cr}; nothing else. |
| 335 | 335 | ||
| 336 | @item @samp{*?}, @samp{+?}, @samp{??} | 336 | @item @samp{*?}, @samp{+?}, @samp{??} |
| 337 | @cindex non-greedy repetition characters in regexp | ||
| 337 | These are ``non-greedy'' variants of the operators @samp{*}, @samp{+} | 338 | These are ``non-greedy'' variants of the operators @samp{*}, @samp{+} |
| 338 | and @samp{?}. Where those operators match the largest possible | 339 | and @samp{?}. Where those operators match the largest possible |
| 339 | substring (consistent with matching the entire containing expression), | 340 | substring (consistent with matching the entire containing expression), |
| @@ -1060,6 +1061,11 @@ the match is available as @code{(match-end 0)}. @xref{Match Data}. | |||
| 1060 | @end example | 1061 | @end example |
| 1061 | @end defun | 1062 | @end defun |
| 1062 | 1063 | ||
| 1064 | @defun string-match-p regexp string &optional start | ||
| 1065 | This predicate function does what @code{string-match} does, but it has | ||
| 1066 | no side effect of modifying the match data. | ||
| 1067 | @end defun | ||
| 1068 | |||
| 1063 | @defun looking-at regexp | 1069 | @defun looking-at regexp |
| 1064 | This function determines whether the text in the current buffer directly | 1070 | This function determines whether the text in the current buffer directly |
| 1065 | following point matches the regular expression @var{regexp}. ``Directly | 1071 | following point matches the regular expression @var{regexp}. ``Directly |
| @@ -1069,7 +1075,8 @@ result is @code{t} if so, @code{nil} otherwise. | |||
| 1069 | 1075 | ||
| 1070 | This function does not move point, but it updates the match data, which | 1076 | This function does not move point, but it updates the match data, which |
| 1071 | you can access using @code{match-beginning} and @code{match-end}. | 1077 | you can access using @code{match-beginning} and @code{match-end}. |
| 1072 | @xref{Match Data}. | 1078 | @xref{Match Data}. If you need to test for a match without modifying |
| 1079 | the match data, use @code{looking-at-p}, described below. | ||
| 1073 | 1080 | ||
| 1074 | In this example, point is located directly before the @samp{T}. If it | 1081 | In this example, point is located directly before the @samp{T}. If it |
| 1075 | were anywhere else, the result would be @code{nil}. | 1082 | were anywhere else, the result would be @code{nil}. |
| @@ -1113,6 +1120,11 @@ comes back" twice. | |||
| 1113 | @end example | 1120 | @end example |
| 1114 | @end defun | 1121 | @end defun |
| 1115 | 1122 | ||
| 1123 | @defun looking-at-p regexp | ||
| 1124 | This predicate function works like @code{looking-at}, but without | ||
| 1125 | updating the match data. | ||
| 1126 | @end defun | ||
| 1127 | |||
| 1116 | @defvar search-spaces-regexp | 1128 | @defvar search-spaces-regexp |
| 1117 | If this variable is non-@code{nil}, it should be a regular expression | 1129 | If this variable is non-@code{nil}, it should be a regular expression |
| 1118 | that says how to search for whitespace. In that case, any group of | 1130 | that says how to search for whitespace. In that case, any group of |
| @@ -1142,8 +1154,9 @@ match, as required by POSIX. This is much slower, so use these | |||
| 1142 | functions only when you really need the longest match. | 1154 | functions only when you really need the longest match. |
| 1143 | 1155 | ||
| 1144 | The POSIX search and match functions do not properly support the | 1156 | The POSIX search and match functions do not properly support the |
| 1145 | non-greedy repetition operators. This is because POSIX backtracking | 1157 | non-greedy repetition operators (@pxref{Regexp Special, non-greedy}). |
| 1146 | conflicts with the semantics of non-greedy repetition. | 1158 | This is because POSIX backtracking conflicts with the semantics of |
| 1159 | non-greedy repetition. | ||
| 1147 | 1160 | ||
| 1148 | @defun posix-search-forward regexp &optional limit noerror repeat | 1161 | @defun posix-search-forward regexp &optional limit noerror repeat |
| 1149 | This is like @code{re-search-forward} except that it performs the full | 1162 | This is like @code{re-search-forward} except that it performs the full |
| @@ -1618,6 +1618,7 @@ consing shell command lines from the individual arguments. | |||
| 1618 | *** `image-refresh' refreshes all images associated with a given image | 1618 | *** `image-refresh' refreshes all images associated with a given image |
| 1619 | specification. | 1619 | specification. |
| 1620 | 1620 | ||
| 1621 | +++ | ||
| 1621 | *** The two new functions `looking-at-p' and `string-match-p' can do | 1622 | *** The two new functions `looking-at-p' and `string-match-p' can do |
| 1622 | the same matching as `looking-at' and `string-match' without changing | 1623 | the same matching as `looking-at' and `string-match' without changing |
| 1623 | the match data. | 1624 | the match data. |