diff options
| author | Eli Zaretskii | 2020-05-03 16:53:53 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-05-03 16:53:53 +0300 |
| commit | cb1e73d1bc964f61626955e950e660602f2014f5 (patch) | |
| tree | 0c2f6be31ee2d17754c996c9973d529d22ff1297 /src | |
| parent | 63268253d21c57d991cba3f3b083d74f154a26fe (diff) | |
| download | emacs-cb1e73d1bc964f61626955e950e660602f2014f5.tar.gz emacs-cb1e73d1bc964f61626955e950e660602f2014f5.zip | |
Improve accuracy of apropos commands that search doc strings
It is conceptually wrong for apropos commands that search doc
strings to look for matches of several words only on the same
line, because division of doc strings between lines is
ephemeral.
* lisp/apropos.el (apropos-parse-pattern): Accept an optional
argument MULTILINE-P, and if that is non-nil, produce regexps that
match words in the list even if they are separated by line
boundaries.
(apropos-value, apropos-local-value, apropos-documentation): Use
the new optional argument in apropos commands that search
multiline text, such as doc strings.
* src/search.c (Fposix_looking_at, Fposix_string_match)
(Fposix_search_backward, Fposix_search_forward): Make sure Posix
appears in the doc strings near REGEXP, for better matches.
Diffstat (limited to 'src')
| -rw-r--r-- | src/search.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/search.c b/src/search.c index 567270a84cb..ec076c18035 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -353,8 +353,8 @@ data if you want to preserve them. */) | |||
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | DEFUN ("posix-looking-at", Fposix_looking_at, Sposix_looking_at, 1, 1, 0, | 355 | DEFUN ("posix-looking-at", Fposix_looking_at, Sposix_looking_at, 1, 1, 0, |
| 356 | doc: /* Return t if text after point matches regular expression REGEXP. | 356 | doc: /* Return t if text after point matches REGEXP according to Posix rules. |
| 357 | Find the longest match, in accord with Posix regular expression rules. | 357 | Find the longest match, in accordance with Posix regular expression rules. |
| 358 | This function modifies the match data that `match-beginning', | 358 | This function modifies the match data that `match-beginning', |
| 359 | `match-end' and `match-data' access; save and restore the match | 359 | `match-end' and `match-data' access; save and restore the match |
| 360 | data if you want to preserve them. */) | 360 | data if you want to preserve them. */) |
| @@ -449,7 +449,7 @@ matched by the parenthesis constructions in REGEXP. */) | |||
| 449 | } | 449 | } |
| 450 | 450 | ||
| 451 | DEFUN ("posix-string-match", Fposix_string_match, Sposix_string_match, 2, 3, 0, | 451 | DEFUN ("posix-string-match", Fposix_string_match, Sposix_string_match, 2, 3, 0, |
| 452 | doc: /* Return index of start of first match for REGEXP in STRING, or nil. | 452 | doc: /* Return index of start of first match for Posix REGEXP in STRING, or nil. |
| 453 | Find the longest match, in accord with Posix regular expression rules. | 453 | Find the longest match, in accord with Posix regular expression rules. |
| 454 | Case is ignored if `case-fold-search' is non-nil in the current buffer. | 454 | Case is ignored if `case-fold-search' is non-nil in the current buffer. |
| 455 | If third arg START is non-nil, start search at that index in STRING. | 455 | If third arg START is non-nil, start search at that index in STRING. |
| @@ -2276,7 +2276,7 @@ and `replace-match'. */) | |||
| 2276 | 2276 | ||
| 2277 | DEFUN ("posix-search-backward", Fposix_search_backward, Sposix_search_backward, 1, 4, | 2277 | DEFUN ("posix-search-backward", Fposix_search_backward, Sposix_search_backward, 1, 4, |
| 2278 | "sPosix search backward: ", | 2278 | "sPosix search backward: ", |
| 2279 | doc: /* Search backward from point for match for regular expression REGEXP. | 2279 | doc: /* Search backward from point for match for REGEXP according to Posix rules. |
| 2280 | Find the longest match in accord with Posix regular expression rules. | 2280 | Find the longest match in accord with Posix regular expression rules. |
| 2281 | Set point to the beginning of the occurrence found, and return point. | 2281 | Set point to the beginning of the occurrence found, and return point. |
| 2282 | An optional second argument bounds the search; it is a buffer position. | 2282 | An optional second argument bounds the search; it is a buffer position. |
| @@ -2304,7 +2304,7 @@ and `replace-match'. */) | |||
| 2304 | 2304 | ||
| 2305 | DEFUN ("posix-search-forward", Fposix_search_forward, Sposix_search_forward, 1, 4, | 2305 | DEFUN ("posix-search-forward", Fposix_search_forward, Sposix_search_forward, 1, 4, |
| 2306 | "sPosix search: ", | 2306 | "sPosix search: ", |
| 2307 | doc: /* Search forward from point for regular expression REGEXP. | 2307 | doc: /* Search forward from point for REGEXP according to Posix rules. |
| 2308 | Find the longest match in accord with Posix regular expression rules. | 2308 | Find the longest match in accord with Posix regular expression rules. |
| 2309 | Set point to the end of the occurrence found, and return point. | 2309 | Set point to the end of the occurrence found, and return point. |
| 2310 | An optional second argument bounds the search; it is a buffer position. | 2310 | An optional second argument bounds the search; it is a buffer position. |