aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorTino Calancha2017-02-02 19:13:05 +0900
committerTino Calancha2017-02-02 19:13:05 +0900
commit8e871aef10455eefc34790a9ec011c6fec5e93fe (patch)
tree37af01d0672a78348691b9de7560d516c725826a /doc
parent141b085674e2945cc0c42bbe35548c368d1b023e (diff)
downloademacs-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.texi14
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi8
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
1671expression. They all ignore case in matching, if the pattern contains 1671expression. They all ignore case in matching, if the pattern contains
1672no upper-case letters and @code{case-fold-search} is non-@code{nil}. 1672no upper-case letters and @code{case-fold-search} is non-@code{nil}.
1673Aside from @code{occur} and its variants, all operate on the text from 1673Aside from @code{multi-occur} and @code{multi-occur-in-matching-buffers},
1674point to the end of the buffer, or on the region if it is active. 1674which always search the whole buffer, all operate on the text from point
1675to 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
1721buffer that contains a match for it. If you type @kbd{M-n} at the 1722buffer that contains a match for it. If you type @kbd{M-n} at the
1722prompt, you can reuse search strings from previous incremental 1723prompt, you can reuse search strings from previous incremental
1723searches. The text that matched is highlighted using the @code{match} 1724searches. The text that matched is highlighted using the @code{match}
1724face. To limit the search to part of the buffer, narrow to that part 1725face. A numeric argument @var{n} specifies that @var{n} lines of
1725(@pxref{Narrowing}). A numeric argument @var{n} specifies that 1726context are to be displayed before and after each matching line.
1726@var{n} lines of context are to be displayed before and after each 1727The default number of context lines is specified by the variable
1727matching line. The default number of context lines is specified by 1728@code{list-matching-lines-default-context-lines}.
1728the variable @code{list-matching-lines-default-context-lines}.
1729 1729
1730You can also run @kbd{M-s o} when an incremental search is active; 1730You can also run @kbd{M-s o} when an incremental search is active;
1731this uses the current search string. 1731this 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
17153The @code{occur} command shows all the lines in the current buffer 17153The @code{occur} command shows all the lines in the current buffer
17154that contain a match for a regular expression. Matching lines are 17154that contain a match for a regular expression. When the region is
17155shown in a buffer called @file{*Occur*}. That buffer serves as a menu 17155active, @code{occur} restricts matches to such region. Otherwise it
17156to jump to occurrences. 17156uses the entire buffer.
17157Matching lines are shown in a buffer called @file{*Occur*}.
17158That 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