diff options
| author | Tino Calancha | 2017-02-02 19:13:05 +0900 |
|---|---|---|
| committer | Tino Calancha | 2017-02-02 19:13:05 +0900 |
| commit | 8e871aef10455eefc34790a9ec011c6fec5e93fe (patch) | |
| tree | 37af01d0672a78348691b9de7560d516c725826a /doc | |
| parent | 141b085674e2945cc0c42bbe35548c368d1b023e (diff) | |
| download | emacs-8e871aef10455eefc34790a9ec011c6fec5e93fe.tar.gz emacs-8e871aef10455eefc34790a9ec011c6fec5e93fe.zip | |
Allow occur command to operate on the region
See discussion in:
https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01084.html
* lisp/replace.el (occur--region-start, occur--region-end)
(occur--matches-threshold): New variables.
(occur-engine): Use them.
(occur): Idem.
Add optional arg REGION; if non-nil occur applies in that region.
* doc/lispintro/emacs-lisp-intro.texi (Keybindings): Update manual
* doc/emacs/search.texi (Other Repeating Search): Idem.
; etc/NEWS: Add entry for the new feature.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/search.texi | 14 | ||||
| -rw-r--r-- | doc/lispintro/emacs-lisp-intro.texi | 8 |
2 files changed, 12 insertions, 10 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index b7282589735..2a67619678b 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -1670,8 +1670,9 @@ replacing regexp matches in file names. | |||
| 1670 | Here are some other commands that find matches for a regular | 1670 | Here are some other commands that find matches for a regular |
| 1671 | expression. They all ignore case in matching, if the pattern contains | 1671 | expression. They all ignore case in matching, if the pattern contains |
| 1672 | no upper-case letters and @code{case-fold-search} is non-@code{nil}. | 1672 | no upper-case letters and @code{case-fold-search} is non-@code{nil}. |
| 1673 | Aside from @code{occur} and its variants, all operate on the text from | 1673 | Aside from @code{multi-occur} and @code{multi-occur-in-matching-buffers}, |
| 1674 | point to the end of the buffer, or on the region if it is active. | 1674 | which always search the whole buffer, all operate on the text from point |
| 1675 | to the end of the buffer, or on the region if it is active. | ||
| 1675 | 1676 | ||
| 1676 | @findex list-matching-lines | 1677 | @findex list-matching-lines |
| 1677 | @findex occur | 1678 | @findex occur |
| @@ -1721,11 +1722,10 @@ Prompt for a regexp, and display a list showing each line in the | |||
| 1721 | buffer that contains a match for it. If you type @kbd{M-n} at the | 1722 | buffer that contains a match for it. If you type @kbd{M-n} at the |
| 1722 | prompt, you can reuse search strings from previous incremental | 1723 | prompt, you can reuse search strings from previous incremental |
| 1723 | searches. The text that matched is highlighted using the @code{match} | 1724 | searches. The text that matched is highlighted using the @code{match} |
| 1724 | face. To limit the search to part of the buffer, narrow to that part | 1725 | face. A numeric argument @var{n} specifies that @var{n} lines of |
| 1725 | (@pxref{Narrowing}). A numeric argument @var{n} specifies that | 1726 | context are to be displayed before and after each matching line. |
| 1726 | @var{n} lines of context are to be displayed before and after each | 1727 | The default number of context lines is specified by the variable |
| 1727 | matching line. The default number of context lines is specified by | 1728 | @code{list-matching-lines-default-context-lines}. |
| 1728 | the variable @code{list-matching-lines-default-context-lines}. | ||
| 1729 | 1729 | ||
| 1730 | You can also run @kbd{M-s o} when an incremental search is active; | 1730 | You can also run @kbd{M-s o} when an incremental search is active; |
| 1731 | this uses the current search string. | 1731 | this uses the current search string. |
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 830c072cf5e..36d767737df 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi | |||
| @@ -17151,9 +17151,11 @@ Here is another keybinding, with a comment: | |||
| 17151 | 17151 | ||
| 17152 | @findex occur | 17152 | @findex occur |
| 17153 | The @code{occur} command shows all the lines in the current buffer | 17153 | The @code{occur} command shows all the lines in the current buffer |
| 17154 | that contain a match for a regular expression. Matching lines are | 17154 | that contain a match for a regular expression. When the region is |
| 17155 | shown in a buffer called @file{*Occur*}. That buffer serves as a menu | 17155 | active, @code{occur} restricts matches to such region. Otherwise it |
| 17156 | to jump to occurrences. | 17156 | uses the entire buffer. |
| 17157 | Matching lines are shown in a buffer called @file{*Occur*}. | ||
| 17158 | That buffer serves as a menu to jump to occurrences. | ||
| 17157 | 17159 | ||
| 17158 | @findex global-unset-key | 17160 | @findex global-unset-key |
| 17159 | @cindex Unbinding key | 17161 | @cindex Unbinding key |