summaryrefslogtreecommitdiff
path: root/lisp/isearch.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2004-12-23 16:43:51 +0000
committerKaroly Lorentey <lorentey@elte.hu>2004-12-23 16:43:51 +0000
commit17d51b68fb4e7da4f18eff72c589b7ffc4f9c22c (patch)
treef490c1ccdbd43077ea77f953bc59ca94c2fe810c /lisp/isearch.el
parent4b89585ee70a1f64543a5851f07cf7e2d89c5c62 (diff)
parent55f4edbcd246d8ea1715687a7aeeb3afe35c0345 (diff)
downloademacs-17d51b68fb4e7da4f18eff72c589b7ffc4f9c22c.tar.gz
emacs-17d51b68fb4e7da4f18eff72c589b7ffc4f9c22c.tar.bz2
emacs-17d51b68fb4e7da4f18eff72c589b7ffc4f9c22c.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-726 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-727 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-728 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-729 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-730 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-731 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-732 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-733 Update from CVS: man/calc.texi: Fix some TeX definitions. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-735 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-736 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-737 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-738 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-739 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-740 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-741 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-742 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-743 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-744 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-745 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-746 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-75 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-76 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-77 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-277
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r--lisp/isearch.el117
1 files changed, 60 insertions, 57 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 77139988bb1..f94590ded2d 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -229,7 +229,6 @@ Default value, nil, means edit the string instead."
(while (< i 256)
(define-key map (vector i) 'isearch-printing-char)
(setq i (1+ i)))
- (define-key map (vector i) 'isearch-printing-char)
;; To handle local bindings with meta char prefix keys, define
;; another full keymap. This must be done for any other prefix
@@ -654,7 +653,7 @@ is treated as a regexp. See \\[isearch-forward] for more info."
(setq ;; quit-flag nil not for isearch-mode
isearch-adjusted nil
isearch-yank-flag nil)
- (isearch-lazy-highlight-new-loop)
+ (if isearch-lazy-highlight (isearch-lazy-highlight-new-loop))
;; We must prevent the point moving to the end of composition when a
;; part of the composition has just been searched.
(setq disable-point-adjustment t))
@@ -944,7 +943,7 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst
(isearch-message-prefix nil nil isearch-nonincremental)
isearch-string
minibuffer-local-isearch-map nil
- 'junk-ring))
+ 'junk-ring nil t))
isearch-new-message
(mapconcat 'isearch-text-char-description
isearch-new-string "")))
@@ -2334,8 +2333,7 @@ is nil. This function is called when exiting an incremental search if
"Cleanup any previous `isearch-lazy-highlight' loop and begin a new one.
This happens when `isearch-update' is invoked (which can cause the
search string to change or the window to scroll)."
- (when (and isearch-lazy-highlight
- (null executing-kbd-macro)
+ (when (and (null executing-kbd-macro)
(sit-for 0) ;make sure (window-start) is credible
(or (not (equal isearch-string
isearch-lazy-highlight-last-string))
@@ -2387,59 +2385,64 @@ Attempt to do the search exactly the way the pending isearch would."
(let ((max isearch-lazy-highlight-max-at-a-time)
(looping t)
nomore)
- (save-excursion
- (save-match-data
- (goto-char (if isearch-forward
- isearch-lazy-highlight-end
- isearch-lazy-highlight-start))
- (while looping
- (let ((found (isearch-lazy-highlight-search)))
- (when max
- (setq max (1- max))
- (if (<= max 0)
- (setq looping nil)))
- (if found
- (let ((mb (match-beginning 0))
- (me (match-end 0)))
- (if (= mb me) ;zero-length match
+ (with-local-quit
+ (save-selected-window
+ (if (and (window-live-p isearch-lazy-highlight-window)
+ (not (eq (selected-window) isearch-lazy-highlight-window)))
+ (select-window isearch-lazy-highlight-window))
+ (save-excursion
+ (save-match-data
+ (goto-char (if isearch-forward
+ isearch-lazy-highlight-end
+ isearch-lazy-highlight-start))
+ (while looping
+ (let ((found (isearch-lazy-highlight-search)))
+ (when max
+ (setq max (1- max))
+ (if (<= max 0)
+ (setq looping nil)))
+ (if found
+ (let ((mb (match-beginning 0))
+ (me (match-end 0)))
+ (if (= mb me) ;zero-length match
+ (if isearch-forward
+ (if (= mb (if isearch-lazy-highlight-wrapped
+ isearch-lazy-highlight-start
+ (window-end)))
+ (setq found nil)
+ (forward-char 1))
+ (if (= mb (if isearch-lazy-highlight-wrapped
+ isearch-lazy-highlight-end
+ (window-start)))
+ (setq found nil)
+ (forward-char -1)))
+
+ ;; non-zero-length match
+ (let ((ov (make-overlay mb me)))
+ (push ov isearch-lazy-highlight-overlays)
+ (overlay-put ov 'face isearch-lazy-highlight-face)
+ (overlay-put ov 'priority 0) ;lower than main overlay
+ (overlay-put ov 'window (selected-window))))
+ (if isearch-forward
+ (setq isearch-lazy-highlight-end (point))
+ (setq isearch-lazy-highlight-start (point)))))
+
+ ;; not found or zero-length match at the search bound
+ (if (not found)
+ (if isearch-lazy-highlight-wrapped
+ (setq looping nil
+ nomore t)
+ (setq isearch-lazy-highlight-wrapped t)
(if isearch-forward
- (if (= mb (if isearch-lazy-highlight-wrapped
- isearch-lazy-highlight-start
- (window-end)))
- (setq found nil)
- (forward-char 1))
- (if (= mb (if isearch-lazy-highlight-wrapped
- isearch-lazy-highlight-end
- (window-start)))
- (setq found nil)
- (forward-char -1)))
-
- ;; non-zero-length match
- (let ((ov (make-overlay mb me)))
- (overlay-put ov 'face isearch-lazy-highlight-face)
- (overlay-put ov 'priority 0) ;lower than main overlay
- (overlay-put ov 'window (selected-window))
- (push ov isearch-lazy-highlight-overlays)))
- (if isearch-forward
- (setq isearch-lazy-highlight-end (point))
- (setq isearch-lazy-highlight-start (point)))))
-
- ;; not found or zero-length match at the search bound
- (if (not found)
- (if isearch-lazy-highlight-wrapped
- (setq looping nil
- nomore t)
- (setq isearch-lazy-highlight-wrapped t)
- (if isearch-forward
- (progn
- (setq isearch-lazy-highlight-end (window-start))
- (goto-char (window-start)))
- (setq isearch-lazy-highlight-start (window-end))
- (goto-char (window-end)))))))
- (unless nomore
- (setq isearch-lazy-highlight-timer
- (run-at-time isearch-lazy-highlight-interval nil
- 'isearch-lazy-highlight-update)))))))
+ (progn
+ (setq isearch-lazy-highlight-end (window-start))
+ (goto-char (window-start)))
+ (setq isearch-lazy-highlight-start (window-end))
+ (goto-char (window-end)))))))
+ (unless nomore
+ (setq isearch-lazy-highlight-timer
+ (run-at-time isearch-lazy-highlight-interval nil
+ 'isearch-lazy-highlight-update)))))))))
(defun isearch-resume (search regexp word forward message case-fold)
"Resume an incremental search.