361 |
(define-key map "\M-\C-y" 'isearch-yank-char) |
(define-key map "\M-\C-y" 'isearch-yank-char) |
362 |
(define-key map "\C-y" 'isearch-yank-line) |
(define-key map "\C-y" 'isearch-yank-line) |
363 |
|
|
|
;; 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) |
|
|
|
|
364 |
;; Turned off because I find I expect to get the global definition--rms. |
;; Turned off because I find I expect to get the global definition--rms. |
365 |
;; ;; Instead bind C-h to special help command for isearch-mode. |
;; ;; Instead bind C-h to special help command for isearch-mode. |
366 |
;; (define-key map "\C-h" 'isearch-mode-help) |
;; (define-key map "\C-h" 'isearch-mode-help) |
1409 |
Respects \\[isearch-repeat-forward] and \\[isearch-repeat-backward] by |
Respects \\[isearch-repeat-forward] and \\[isearch-repeat-backward] by |
1410 |
stopping at `isearch-barrier' as needed. |
stopping at `isearch-barrier' as needed. |
1411 |
|
|
1412 |
Do nothing if a backslash is escaping the liberalizing character. If |
Do nothing if a backslash is escaping the liberalizing character. |
1413 |
WANT-BACKSLASH is non-nil, invert this behavior (for \\} and \\|). |
If WANT-BACKSLASH is non-nil, invert this behavior (for \\} and \\|). |
1414 |
|
|
1415 |
Do nothing if regexp has recently been invalid unless optional ALLOW-INVALID |
Do nothing if regexp has recently been invalid unless optional |
1416 |
non-nil. |
ALLOW-INVALID non-nil. |
1417 |
|
|
1418 |
If optional TO-BARRIER non-nil, ignore previous matches and go exactly to the |
If optional TO-BARRIER non-nil, ignore previous matches and go exactly |
1419 |
barrier." |
to the barrier." |
1420 |
;; (eq (not a) (not b)) makes all non-nil values equivalent |
;; (eq (not a) (not b)) makes all non-nil values equivalent |
1421 |
(when (and isearch-regexp (eq (not (isearch-backslash isearch-string)) |
(when (and isearch-regexp (eq (not (isearch-backslash isearch-string)) |
1422 |
(not want-backslash)) |
(not want-backslash)) |
1462 |
(goto-char (if isearch-forward |
(goto-char (if isearch-forward |
1463 |
(max last-other-end isearch-barrier) |
(max last-other-end isearch-barrier) |
1464 |
(min last-other-end isearch-barrier))) |
(min last-other-end isearch-barrier))) |
1465 |
(setq isearch-adjusted t)))))) |
(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)) |
|
1466 |
|
|
1467 |
(defun isearch-unread-key-sequence (keylist) |
(defun isearch-unread-key-sequence (keylist) |
1468 |
"Unread the given key-sequence KEYLIST. |
"Unread the given key-sequence KEYLIST. |
1760 |
(isearch-process-search-char char)))) |
(isearch-process-search-char char)))) |
1761 |
|
|
1762 |
(defun isearch-return-char () |
(defun isearch-return-char () |
1763 |
"Convert return into newline for incremental search. |
"Convert return into newline for incremental search." |
|
Obsolete." |
|
1764 |
(interactive) |
(interactive) |
1765 |
(isearch-process-search-char ?\n)) |
(isearch-process-search-char ?\n)) |
1766 |
|
(make-obsolete 'isearch-return-char 'isearch-printing-char) |
1767 |
|
|
1768 |
(defun isearch-printing-char () |
(defun isearch-printing-char () |
1769 |
"Add this ordinary printing character to the search string and search." |
"Add this ordinary printing character to the search string and search." |
1782 |
(isearch-process-search-char char))))) |
(isearch-process-search-char char))))) |
1783 |
|
|
1784 |
(defun isearch-process-search-char (char) |
(defun isearch-process-search-char (char) |
1785 |
|
;; * and ? are special in regexps when not preceded by \. |
1786 |
|
;; } and | are special in regexps when preceded by \. |
1787 |
|
;; Nothing special for + because it matches at least once. |
1788 |
|
(cond |
1789 |
|
((memq char '(?* ??)) (isearch-fallback nil)) |
1790 |
|
((eq char ?\}) (isearch-fallback t t)) |
1791 |
|
((eq char ?|) (isearch-fallback t nil t))) |
1792 |
|
|
1793 |
;; Append the char to the search string, update the message and re-search. |
;; Append the char to the search string, update the message and re-search. |
1794 |
(isearch-process-search-string |
(isearch-process-search-string |
1795 |
(char-to-string char) |
(char-to-string char) |