diff options
| author | Eli Zaretskii | 2017-07-29 11:25:29 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-07-29 11:25:29 +0300 |
| commit | d3fcb9241339357869969547924e02bed6f661cd (patch) | |
| tree | 8beb425cbe94dd5b00c9f2f599ef1808d8bddf46 | |
| parent | a00083cedec8151ec5c27e6cb41e1ec5572356f5 (diff) | |
| download | emacs-d3fcb9241339357869969547924e02bed6f661cd.tar.gz emacs-d3fcb9241339357869969547924e02bed6f661cd.zip | |
Improve documentation of 'occur'
* doc/emacs/search.texi (Other Repeating Search):
* lisp/replace.el (occur): Make the documentation of 'occur' be
more accurate when matches overlap. (Bug#27818)
| -rw-r--r-- | doc/emacs/search.texi | 4 | ||||
| -rw-r--r-- | lisp/replace.el | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index c9e83da173f..9f7e9a12cd7 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -1747,6 +1747,10 @@ at the first match after such line. | |||
| 1747 | You can also run @kbd{M-s o} when an incremental search is active; | 1747 | You can also run @kbd{M-s o} when an incremental search is active; |
| 1748 | this uses the current search string. | 1748 | this uses the current search string. |
| 1749 | 1749 | ||
| 1750 | Note that matches for the regexp you type are extended to include | ||
| 1751 | complete lines, and a match that starts before the previous match ends | ||
| 1752 | is not considered a match. | ||
| 1753 | |||
| 1750 | @kindex RET @r{(Occur mode)} | 1754 | @kindex RET @r{(Occur mode)} |
| 1751 | @kindex o @r{(Occur mode)} | 1755 | @kindex o @r{(Occur mode)} |
| 1752 | @kindex C-o @r{(Occur mode)} | 1756 | @kindex C-o @r{(Occur mode)} |
diff --git a/lisp/replace.el b/lisp/replace.el index 64dfe7da22d..a5024943e64 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -1395,6 +1395,11 @@ invoke `occur'." | |||
| 1395 | "Show all lines in the current buffer containing a match for REGEXP. | 1395 | "Show all lines in the current buffer containing a match for REGEXP. |
| 1396 | If a match spreads across multiple lines, all those lines are shown. | 1396 | If a match spreads across multiple lines, all those lines are shown. |
| 1397 | 1397 | ||
| 1398 | Each match is extended to include complete lines. Only non-overlapping | ||
| 1399 | matches are considered. (Note that extending matches to complete | ||
| 1400 | lines could cause some of the matches to overlap; if so, they will not | ||
| 1401 | be shown as separate matches.) | ||
| 1402 | |||
| 1398 | Each line is displayed with NLINES lines before and after, or -NLINES | 1403 | Each line is displayed with NLINES lines before and after, or -NLINES |
| 1399 | before if NLINES is negative. | 1404 | before if NLINES is negative. |
| 1400 | NLINES defaults to `list-matching-lines-default-context-lines'. | 1405 | NLINES defaults to `list-matching-lines-default-context-lines'. |