aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/isearch.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index bbcc08bf00b..3beec1835aa 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -298,6 +298,7 @@ Default value, nil, means edit the string instead.")
298(defvar isearch-other-end nil) ; Start (end) of match if forward (backward). 298(defvar isearch-other-end nil) ; Start (end) of match if forward (backward).
299(defvar isearch-wrapped nil) ; Searching restarted from the top (bottom). 299(defvar isearch-wrapped nil) ; Searching restarted from the top (bottom).
300(defvar isearch-barrier 0) 300(defvar isearch-barrier 0)
301(defvar isearch-just-started nil)
301 302
302; case-fold-search while searching. 303; case-fold-search while searching.
303; either nil, t, or 'yes. 'yes means the same as t except that mixed 304; either nil, t, or 'yes. 'yes means the same as t except that mixed
@@ -463,10 +464,12 @@ is treated as a regexp. See \\[isearch-forward] for more info."
463 (* 4 search-slow-window-lines))) 464 (* 4 search-slow-window-lines)))
464 isearch-other-end nil 465 isearch-other-end nil
465 isearch-small-window nil 466 isearch-small-window nil
467 isearch-just-started t
466 468
467 isearch-opoint (point) 469 isearch-opoint (point)
468 search-ring-yank-pointer nil 470 search-ring-yank-pointer nil
469 regexp-search-ring-yank-pointer nil) 471 regexp-search-ring-yank-pointer nil)
472 (looking-at "")
470 (setq isearch-window-configuration 473 (setq isearch-window-configuration
471 (if isearch-slow-terminal-mode (current-window-configuration) nil)) 474 (if isearch-slow-terminal-mode (current-window-configuration) nil))
472 475
@@ -817,7 +820,8 @@ Use `isearch-exit' to quit without signalling."
817 820
818 (if (equal isearch-string "") 821 (if (equal isearch-string "")
819 (setq isearch-success t) 822 (setq isearch-success t)
820 (if (and isearch-success (equal (match-end 0) (match-beginning 0))) 823 (if (and isearch-success (equal (match-end 0) (match-beginning 0))
824 (not isearch-just-started))
821 ;; If repeating a search that found 825 ;; If repeating a search that found
822 ;; an empty string, ensure we advance. 826 ;; an empty string, ensure we advance.
823 (if (if isearch-forward (eobp) (bobp)) 827 (if (if isearch-forward (eobp) (bobp))
@@ -938,8 +942,9 @@ If no previous match was done, just beep."
938 ;; long as the match does not extend past search origin. 942 ;; long as the match does not extend past search origin.
939 (if (and (not isearch-forward) (not isearch-adjusted) 943 (if (and (not isearch-forward) (not isearch-adjusted)
940 (condition-case () 944 (condition-case ()
941 (looking-at (if isearch-regexp isearch-string 945 (let ((case-fold-search isearch-case-fold-search))
942 (regexp-quote isearch-string))) 946 (looking-at (if isearch-regexp isearch-string
947 (regexp-quote isearch-string))))
943 (error nil)) 948 (error nil))
944 (or isearch-yank-flag 949 (or isearch-yank-flag
945 (<= (match-end 0) 950 (<= (match-end 0)
@@ -1361,6 +1366,7 @@ If there is no completion possible, say so and continue searching."
1361 (t 1366 (t
1362 (if isearch-forward 'search-forward 'search-backward))) 1367 (if isearch-forward 'search-forward 'search-backward)))
1363 isearch-string nil t)) 1368 isearch-string nil t))
1369 (setq isearch-just-started nil)
1364 (if isearch-success 1370 (if isearch-success
1365 (setq isearch-other-end 1371 (setq isearch-other-end
1366 (if isearch-forward (match-beginning 0) (match-end 0))))) 1372 (if isearch-forward (match-beginning 0) (match-end 0)))))
@@ -1438,7 +1444,9 @@ since they have special meaning in a regexp."
1438 (isearch-char-to-string c))) 1444 (isearch-char-to-string c)))
1439 1445
1440;; General function to unread characters or events. 1446;; General function to unread characters or events.
1447;; Also insert them in a keyboard macro being defined.
1441(defun isearch-unread (&rest char-or-events) 1448(defun isearch-unread (&rest char-or-events)
1449 (mapcar 'store-kbd-macro-event char-or-events)
1442 (setq unread-command-events 1450 (setq unread-command-events
1443 (append char-or-events unread-command-events))) 1451 (append char-or-events unread-command-events)))
1444 1452