# HG changeset patch # User Juri Linkov # Date 1121697150 0 # Node ID 8c591f014cf5e7554c9ae282436433efecc51465 # Parent 756d49c05efa4aa1cc235e0761c0c9bb43692799 (isearch-mode-map): Remove key bindings for regexp chars * ? } |. (isearch-fallback): Don't call `isearch-process-search-char'. (isearch-*-char, isearch-}-char, isearch-|-char): Remove functions. (isearch-process-search-char): Call `isearch-fallback' for regexp chars * ? } |. (isearch-return-char): Make obsolete with `make-obsolete' instead of simply documenting it as obsolete in the docstring. (isearch-fallback): Refill docstring. diff -r 756d49c05efa -r 8c591f014cf5 lisp/isearch.el --- a/lisp/isearch.el Mon Jul 18 13:30:00 2005 +0000 +++ b/lisp/isearch.el Mon Jul 18 14:32:30 2005 +0000 @@ -361,13 +361,6 @@ (define-key map "\M-\C-y" 'isearch-yank-char) (define-key map "\C-y" 'isearch-yank-line) - ;; Define keys for regexp chars * ? } |. - ;; Nothing special for + because it matches at least once. - (define-key map "*" 'isearch-*-char) - (define-key map "?" 'isearch-*-char) - (define-key map "}" 'isearch-}-char) - (define-key map "|" 'isearch-|-char) - ;; Turned off because I find I expect to get the global definition--rms. ;; ;; Instead bind C-h to special help command for isearch-mode. ;; (define-key map "\C-h" 'isearch-mode-help) @@ -1416,14 +1409,14 @@ Respects \\[isearch-repeat-forward] and \\[isearch-repeat-backward] by stopping at `isearch-barrier' as needed. -Do nothing if a backslash is escaping the liberalizing character. If -WANT-BACKSLASH is non-nil, invert this behavior (for \\} and \\|). +Do nothing if a backslash is escaping the liberalizing character. +If WANT-BACKSLASH is non-nil, invert this behavior (for \\} and \\|). -Do nothing if regexp has recently been invalid unless optional ALLOW-INVALID -non-nil. +Do nothing if regexp has recently been invalid unless optional +ALLOW-INVALID non-nil. -If optional TO-BARRIER non-nil, ignore previous matches and go exactly to the -barrier." +If optional TO-BARRIER non-nil, ignore previous matches and go exactly +to the barrier." ;; (eq (not a) (not b)) makes all non-nil values equivalent (when (and isearch-regexp (eq (not (isearch-backslash isearch-string)) (not want-backslash)) @@ -1469,26 +1462,7 @@ (goto-char (if isearch-forward (max last-other-end isearch-barrier) (min last-other-end isearch-barrier))) - (setq isearch-adjusted t)))))) - (isearch-process-search-char last-command-char)) - -;; * and ? are special when not preceded by \. -(defun isearch-*-char () - "Maybe back up to handle * and ? specially in regexps." - (interactive) - (isearch-fallback nil)) - -;; } is special when it is preceded by \. -(defun isearch-}-char () - "Handle \\} specially in regexps." - (interactive) - (isearch-fallback t t)) - -;; | is special when it is preceded by \. -(defun isearch-|-char () - "If in regexp search, jump to the barrier unless in a group." - (interactive) - (isearch-fallback t nil t)) + (setq isearch-adjusted t))))))) (defun isearch-unread-key-sequence (keylist) "Unread the given key-sequence KEYLIST. @@ -1786,10 +1760,10 @@ (isearch-process-search-char char)))) (defun isearch-return-char () - "Convert return into newline for incremental search. -Obsolete." + "Convert return into newline for incremental search." (interactive) (isearch-process-search-char ?\n)) +(make-obsolete 'isearch-return-char 'isearch-printing-char) (defun isearch-printing-char () "Add this ordinary printing character to the search string and search." @@ -1808,6 +1782,14 @@ (isearch-process-search-char char))))) (defun isearch-process-search-char (char) + ;; * and ? are special in regexps when not preceded by \. + ;; } and | are special in regexps when preceded by \. + ;; Nothing special for + because it matches at least once. + (cond + ((memq char '(?* ??)) (isearch-fallback nil)) + ((eq char ?\}) (isearch-fallback t t)) + ((eq char ?|) (isearch-fallback t nil t))) + ;; Append the char to the search string, update the message and re-search. (isearch-process-search-string (char-to-string char)