comparison lisp/isearch.el @ 21070:f88e08d192a8

(isearch-*-char): Do nothing special if quoted with \.
author Richard M. Stallman <rms@gnu.org>
date Thu, 05 Mar 1998 02:28:44 +0000
parents d21a1c41800f
children c988549f43cd
comparison
equal deleted inserted replaced
21069:e99cb5736904 21070:f88e08d192a8
1006 (condition-case () 1006 (condition-case ()
1007 (let ((case-fold-search isearch-case-fold-search)) 1007 (let ((case-fold-search isearch-case-fold-search))
1008 (looking-at (if isearch-regexp isearch-string 1008 (looking-at (if isearch-regexp isearch-string
1009 (regexp-quote isearch-string)))) 1009 (regexp-quote isearch-string))))
1010 (error nil)) 1010 (error nil))
1011 (or isearch-yank-flag 1011 (or isearch-yank-flag
1012 (<= (match-end 0) 1012 (<= (match-end 0)
1013 (min isearch-opoint isearch-barrier)))) 1013 (min isearch-opoint isearch-barrier))))
1014 (progn 1014 (progn
1015 (setq isearch-success t 1015 (setq isearch-success t
1016 isearch-invalid-regexp nil 1016 isearch-invalid-regexp nil
1017 isearch-within-brackets nil 1017 isearch-within-brackets nil
1018 isearch-other-end (match-end 0)) 1018 isearch-other-end (match-end 0))
1040 1040
1041 (defun isearch-*-char () 1041 (defun isearch-*-char ()
1042 "Handle * and ? specially in regexps." 1042 "Handle * and ? specially in regexps."
1043 (interactive) 1043 (interactive)
1044 (if isearch-regexp 1044 (if isearch-regexp
1045 1045 (let ((idx (length isearch-string)))
1046 (progn 1046 (while (and (> idx 0)
1047 (setq isearch-adjusted t) 1047 (eq (aref isearch-string (1- idx)) ?\\))
1048 ;; Get the isearch-other-end from before the last search. 1048 (setq idx (1- idx)))
1049 ;; We want to start from there, 1049 (when (= (mod (- (length isearch-string) idx) 2) 0)
1050 ;; so that we don't retreat farther than that. 1050 (setq isearch-adjusted t)
1051 ;; (car isearch-cmds) is after last search; 1051 ;; Get the isearch-other-end from before the last search.
1052 ;; (car (cdr isearch-cmds)) is from before it. 1052 ;; We want to start from there,
1053 (let ((cs (nth 5 (car (cdr isearch-cmds))))) 1053 ;; so that we don't retreat farther than that.
1054 (setq cs (or cs isearch-barrier)) 1054 ;; (car isearch-cmds) is after last search;
1055 (goto-char 1055 ;; (car (cdr isearch-cmds)) is from before it.
1056 (if isearch-forward 1056 (let ((cs (nth 5 (car (cdr isearch-cmds)))))
1057 (max cs isearch-barrier) 1057 (setq cs (or cs isearch-barrier))
1058 (min cs isearch-barrier)))))) 1058 (goto-char
1059 (if isearch-forward
1060 (max cs isearch-barrier)
1061 (min cs isearch-barrier)))))))
1059 (isearch-process-search-char (isearch-last-command-char))) 1062 (isearch-process-search-char (isearch-last-command-char)))
1060 1063
1061 1064
1062 (defun isearch-|-char () 1065 (defun isearch-|-char ()
1063 "If in regexp search, jump to the barrier." 1066 "If in regexp search, jump to the barrier."