diff options
author | Juri Linkov <juri@jurta.org> | 2010-03-30 19:03:08 +0300 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2010-03-30 19:03:08 +0300 |
commit | dc2d2590b24f7e4ee648b5d073ba744fbda7a4d8 (patch) | |
tree | 8d15261ebed74c762df72b14eb4023534c784520 /doc | |
parent | 47c88c067f98772d5b505d7b6ad3d0909da5f68a (diff) | |
download | emacs-dc2d2590b24f7e4ee648b5d073ba744fbda7a4d8.tar.gz |
Make occur handle multi-line matches cleanly with context.
http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01280.html
* replace.el (occur-accumulate-lines): Add optional arg `pt'.
(occur-engine): Add local variables `ret', `prev-after-lines',
`prev-lines'. Use more arguments for `occur-context-lines'.
Set first elem of its returned list to `data', and the second elem
to `prev-after-lines'. Don't print the separator line.
In the end, print remaining context after-lines.
(occur-context-lines): Add new arguments `begpt', `endpt',
`lines', `prev-lines', `prev-after-lines'. Rewrite to combine
after-lines of the previous match with before-lines of the
current match and not overlap them. Return a list with two
values: the output line and the list of context after-lines.
* search.texi (Other Repeating Search): Remove line that `occur'
can not handle multiline matches.
* occur-testsuite.el (occur-tests): Add tests for context lines.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/emacs/ChangeLog | 5 | ||||
-rw-r--r-- | doc/emacs/search.texi | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index e23f129a168..b13b3ac1eec 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2010-03-30 Juri Linkov <juri@jurta.org> + + * search.texi (Other Repeating Search): Remove line that `occur' + can not handle multiline matches. + 2010-03-30 Eli Zaretskii <eliz@gnu.org> * mule.texi (International): Mention support of bidirectional editing. diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 8c49a3fa699..890dd48df9f 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1311,8 +1311,7 @@ Prompt for a regexp, and display a list showing each line in the buffer that contains a match for it. To limit the search to part of the buffer, narrow to that part (@pxref{Narrowing}). A numeric argument @var{n} specifies that @var{n} lines of context are to be -displayed before and after each matching line. Currently, -@code{occur} can not correctly handle multiline matches. +displayed before and after each matching line. @kindex RET @r{(Occur mode)} @kindex o @r{(Occur mode)} |