diff options
author | Juri Linkov <juri@jurta.org> | 2013-02-21 19:45:12 +0200 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2013-02-21 19:45:12 +0200 |
commit | 54d9de11684938dfc813a00af46c02e0e7b83f15 (patch) | |
tree | b47f6a1f1083302e2a556eec82adb12295a8fe10 /lisp/isearch.el | |
parent | 62cfd799f17a31188b3cdb9ffbe1421b4e6cba5d (diff) | |
download | emacs-54d9de11684938dfc813a00af46c02e0e7b83f15.tar.gz |
* lisp/isearch.el (isearch-lazy-highlight-new-loop):
Set `isearch-lazy-highlight-start' and `isearch-lazy-highlight-end'
to `isearch-other-end' if it is not nil.
* lisp/replace.el (replace-highlight): Let-bind `isearch-other-end'
to `match-beg'.
* lisp/textmodes/ispell.el (ispell-highlight-spelling-error-overlay):
Let-bind `isearch-other-end' to `start', `isearch-forward' to t
and `isearch-error' to nil.
Fixes: debbugs:13402
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r-- | lisp/isearch.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 972fb0058d3..ad5331f5bf2 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2936,8 +2936,15 @@ by other Emacs features." (setq isearch-lazy-highlight-window (selected-window) isearch-lazy-highlight-window-start (window-start) isearch-lazy-highlight-window-end (window-end) - isearch-lazy-highlight-start (point) - isearch-lazy-highlight-end (point) + ;; Start lazy-highlighting at the beginning of the found + ;; match (`isearch-other-end'). If no match, use point. + ;; One of the next two variables (depending on search direction) + ;; is used to define the starting position of lazy-highlighting + ;; and also to remember the current position of point between + ;; calls of `isearch-lazy-highlight-update', and another variable + ;; is used to define where the wrapped search must stop. + isearch-lazy-highlight-start (or isearch-other-end (point)) + isearch-lazy-highlight-end (or isearch-other-end (point)) isearch-lazy-highlight-wrapped nil isearch-lazy-highlight-last-string isearch-string isearch-lazy-highlight-case-fold-search isearch-case-fold-search @@ -3035,6 +3042,9 @@ Attempt to do the search exactly the way the pending Isearch would." (overlay-put ov 'priority 1000) (overlay-put ov 'face lazy-highlight-face) (overlay-put ov 'window (selected-window)))) + ;; Remember the current position of point for + ;; the next call of `isearch-lazy-highlight-update' + ;; when `lazy-highlight-max-at-a-time' is too small. (if isearch-lazy-highlight-forward (setq isearch-lazy-highlight-end (point)) (setq isearch-lazy-highlight-start (point))))) |