summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-02-22 09:13:05 -0800
committerGlenn Morris <rgm@gnu.org>2013-02-22 09:13:05 -0800
commitbba90ab24e80476efcad6b6a770fd5fda522a621 (patch)
tree73bc6cb08174ab2e568c6cf2f642a73895634ed3 /lisp
parentd78cf5edf9b4aebfc6a5821d88ba1ee3eb00aebb (diff)
parentcee1a690ee32abe67ef2d43fb9a9ad9f792de405 (diff)
downloademacs-bba90ab24e80476efcad6b6a770fd5fda522a621.tar.gz
Merge from emacs-24; up to 2012-12-22T02:59:08Z!cyd@gnu.org
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/isearch.el14
-rw-r--r--lisp/replace.el1
-rw-r--r--lisp/textmodes/ispell.el5
4 files changed, 30 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6496fe998d3..1555dfc43b6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
+2013-02-22 Juri Linkov <juri@jurta.org>
+
+ * 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. (Bug#13402)
+
+ * replace.el (replace-highlight): Let-bind `isearch-other-end'
+ to `match-beg'.
+
+ * textmodes/ispell.el (ispell-highlight-spelling-error-overlay):
+ Let-bind `isearch-other-end' to `start', `isearch-forward' to t
+ and `isearch-error' to nil.
+
2013-02-22 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-tramp-file-p): Fix docstring.
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 31b1918429f..b36b250738a 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2961,8 +2961,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
@@ -3060,6 +3067,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)))))
diff --git a/lisp/replace.el b/lisp/replace.el
index 0b8aaa7d349..7f9ea869333 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2203,6 +2203,7 @@ make, or the user didn't cancel the call."
replace-regexp-lax-whitespace)
(isearch-case-fold-search case-fold-search)
(isearch-forward t)
+ (isearch-other-end match-beg)
(isearch-error nil))
(isearch-lazy-highlight-new-loop range-beg range-end))))
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index dbcf3910db8..50a10dba9a2 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2602,7 +2602,10 @@ The variable `ispell-highlight-face' selects the face to use for highlighting."
(regexp-quote (buffer-substring-no-properties start end))
"\\b"))
(isearch-regexp t)
- (isearch-case-fold-search nil))
+ (isearch-case-fold-search nil)
+ (isearch-forward t)
+ (isearch-other-end start)
+ (isearch-error nil))
(isearch-lazy-highlight-new-loop
(if (boundp 'reg-start) reg-start)
(if (boundp 'reg-end) reg-end)))