Mercurial > emacs
changeset 13799:49b7cd70c43c
(isearch-done): Use executing-kbd-macro.
(isearch-just-started): New variable.
(isearch-mode): Set it.
(isearch-search): Clear it.
(isearch-repeat): If isearch-just-started, don't test for empty match.
(isearch-unread): Use store-kbd-macro-event.
(isearch-search-and-update): Use isearch-case-fold-search
around the looking-at call.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 21 Dec 1995 17:49:54 +0000 |
parents | 4eac65d000d3 |
children | f32b410ed6ec |
files | lisp/isearch.el |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/isearch.el Thu Dec 21 17:47:08 1995 +0000 +++ b/lisp/isearch.el Thu Dec 21 17:49:54 1995 +0000 @@ -298,6 +298,7 @@ (defvar isearch-other-end nil) ; Start (end) of match if forward (backward). (defvar isearch-wrapped nil) ; Searching restarted from the top (bottom). (defvar isearch-barrier 0) +(defvar isearch-just-started nil) ; case-fold-search while searching. ; either nil, t, or 'yes. 'yes means the same as t except that mixed @@ -463,10 +464,12 @@ (* 4 search-slow-window-lines))) isearch-other-end nil isearch-small-window nil + isearch-just-started t isearch-opoint (point) search-ring-yank-pointer nil regexp-search-ring-yank-pointer nil) + (looking-at "") (setq isearch-window-configuration (if isearch-slow-terminal-mode (current-window-configuration) nil)) @@ -817,7 +820,8 @@ (if (equal isearch-string "") (setq isearch-success t) - (if (and isearch-success (equal (match-end 0) (match-beginning 0))) + (if (and isearch-success (equal (match-end 0) (match-beginning 0)) + (not isearch-just-started)) ;; If repeating a search that found ;; an empty string, ensure we advance. (if (if isearch-forward (eobp) (bobp)) @@ -938,8 +942,9 @@ ;; long as the match does not extend past search origin. (if (and (not isearch-forward) (not isearch-adjusted) (condition-case () - (looking-at (if isearch-regexp isearch-string - (regexp-quote isearch-string))) + (let ((case-fold-search isearch-case-fold-search)) + (looking-at (if isearch-regexp isearch-string + (regexp-quote isearch-string)))) (error nil)) (or isearch-yank-flag (<= (match-end 0) @@ -1361,6 +1366,7 @@ (t (if isearch-forward 'search-forward 'search-backward))) isearch-string nil t)) + (setq isearch-just-started nil) (if isearch-success (setq isearch-other-end (if isearch-forward (match-beginning 0) (match-end 0))))) @@ -1438,7 +1444,9 @@ (isearch-char-to-string c))) ;; General function to unread characters or events. +;; Also insert them in a keyboard macro being defined. (defun isearch-unread (&rest char-or-events) + (mapcar 'store-kbd-macro-event char-or-events) (setq unread-command-events (append char-or-events unread-command-events)))