Mercurial > emacs
comparison lisp/isearch.el @ 89971:cce1c0ee76ee
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36
Merge from emacs--cvs-trunk--0, emacs--gnus--5.10, gnus--rel--5.10
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Merge from emacs--gnus--5.10, gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-524
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-534
Update from CVS
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0
tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1
Import from CVS branch gnus-5_10-branch
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2
Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19
Remove autoconf-generated files from archive
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 09 Sep 2004 09:36:36 +0000 |
parents | 3219f94257bc 862d0c555534 |
children | 566253900690 |
comparison
equal
deleted
inserted
replaced
89970:a849e5779b8c | 89971:cce1c0ee76ee |
---|---|
2356 isearch-lazy-highlight-end (point) | 2356 isearch-lazy-highlight-end (point) |
2357 isearch-lazy-highlight-last-string isearch-string | 2357 isearch-lazy-highlight-last-string isearch-string |
2358 isearch-lazy-highlight-case-fold-search isearch-case-fold-search | 2358 isearch-lazy-highlight-case-fold-search isearch-case-fold-search |
2359 isearch-lazy-highlight-regexp isearch-regexp | 2359 isearch-lazy-highlight-regexp isearch-regexp |
2360 isearch-lazy-highlight-wrapped nil) | 2360 isearch-lazy-highlight-wrapped nil) |
2361 (setq isearch-lazy-highlight-timer | 2361 (unless (equal isearch-string "") |
2362 (run-with-idle-timer isearch-lazy-highlight-initial-delay nil | 2362 (setq isearch-lazy-highlight-timer |
2363 'isearch-lazy-highlight-update))))) | 2363 (run-with-idle-timer isearch-lazy-highlight-initial-delay nil |
2364 'isearch-lazy-highlight-update)))))) | |
2364 | 2365 |
2365 (defun isearch-lazy-highlight-search () | 2366 (defun isearch-lazy-highlight-search () |
2366 "Search ahead for the next or previous match, for lazy highlighting. | 2367 "Search ahead for the next or previous match, for lazy highlighting. |
2367 Attempt to do the search exactly the way the pending isearch would." | 2368 Attempt to do the search exactly the way the pending isearch would." |
2368 (let ((case-fold-search isearch-case-fold-search)) | 2369 (let ((case-fold-search isearch-case-fold-search)) |
2395 (setq looping nil))) | 2396 (setq looping nil))) |
2396 (if found | 2397 (if found |
2397 (let ((mb (match-beginning 0)) | 2398 (let ((mb (match-beginning 0)) |
2398 (me (match-end 0))) | 2399 (me (match-end 0))) |
2399 (if (= mb me) ;zero-length match | 2400 (if (= mb me) ;zero-length match |
2400 (forward-char 1) | 2401 (if isearch-forward |
2402 (if (= mb (if isearch-lazy-highlight-wrapped | |
2403 isearch-lazy-highlight-start | |
2404 (window-end))) | |
2405 (setq found nil) | |
2406 (forward-char 1)) | |
2407 (if (= mb (if isearch-lazy-highlight-wrapped | |
2408 isearch-lazy-highlight-end | |
2409 (window-start))) | |
2410 (setq found nil) | |
2411 (forward-char -1))) | |
2401 | 2412 |
2402 ;; non-zero-length match | 2413 ;; non-zero-length match |
2403 (let ((ov (make-overlay mb me))) | 2414 (let ((ov (make-overlay mb me))) |
2404 (overlay-put ov 'face isearch-lazy-highlight-face) | 2415 (overlay-put ov 'face isearch-lazy-highlight-face) |
2405 (overlay-put ov 'priority 0) ;lower than main overlay | 2416 (overlay-put ov 'priority 0) ;lower than main overlay |
2406 (overlay-put ov 'window (selected-window)) | 2417 (overlay-put ov 'window (selected-window)) |
2407 (push ov isearch-lazy-highlight-overlays))) | 2418 (push ov isearch-lazy-highlight-overlays))) |
2408 (if isearch-forward | 2419 (if isearch-forward |
2409 (setq isearch-lazy-highlight-end (point)) | 2420 (setq isearch-lazy-highlight-end (point)) |
2410 (setq isearch-lazy-highlight-start (point)))) | 2421 (setq isearch-lazy-highlight-start (point))))) |
2411 | 2422 |
2412 ;; not found | 2423 ;; not found or zero-length match at the search bound |
2413 (if isearch-lazy-highlight-wrapped | 2424 (if (not found) |
2414 (setq looping nil | 2425 (if isearch-lazy-highlight-wrapped |
2415 nomore t) | 2426 (setq looping nil |
2416 (setq isearch-lazy-highlight-wrapped t) | 2427 nomore t) |
2417 (if isearch-forward | 2428 (setq isearch-lazy-highlight-wrapped t) |
2418 (progn | 2429 (if isearch-forward |
2419 (setq isearch-lazy-highlight-end (window-start)) | 2430 (progn |
2420 (goto-char (window-start))) | 2431 (setq isearch-lazy-highlight-end (window-start)) |
2421 (setq isearch-lazy-highlight-start (window-end)) | 2432 (goto-char (window-start))) |
2422 (goto-char (window-end))))))) | 2433 (setq isearch-lazy-highlight-start (window-end)) |
2434 (goto-char (window-end))))))) | |
2423 (unless nomore | 2435 (unless nomore |
2424 (setq isearch-lazy-highlight-timer | 2436 (setq isearch-lazy-highlight-timer |
2425 (run-at-time isearch-lazy-highlight-interval nil | 2437 (run-at-time isearch-lazy-highlight-interval nil |
2426 'isearch-lazy-highlight-update))))))) | 2438 'isearch-lazy-highlight-update))))))) |
2427 | 2439 |