aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2005-07-18 14:32:30 +0000
committerJuri Linkov2005-07-18 14:32:30 +0000
commit6f2df0f488f491290859df6c74dc3a87c6e33daa (patch)
treeea2e532bc56f92ea15f2221edb9981972b29b3b8
parentd34f013624edf2fc08c7d74b475b884f1a960832 (diff)
downloademacs-6f2df0f488f491290859df6c74dc3a87c6e33daa.tar.gz
emacs-6f2df0f488f491290859df6c74dc3a87c6e33daa.zip
(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.
-rw-r--r--lisp/isearch.el52
1 files changed, 17 insertions, 35 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 44d7bccb8e6..9cb03645aeb 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -361,13 +361,6 @@ A value of nil means highlight all matches."
361 (define-key map "\M-\C-y" 'isearch-yank-char) 361 (define-key map "\M-\C-y" 'isearch-yank-char)
362 (define-key map "\C-y" 'isearch-yank-line) 362 (define-key map "\C-y" 'isearch-yank-line)
363 363
364 ;; Define keys for regexp chars * ? } |.
365 ;; Nothing special for + because it matches at least once.
366 (define-key map "*" 'isearch-*-char)
367 (define-key map "?" 'isearch-*-char)
368 (define-key map "}" 'isearch-}-char)
369 (define-key map "|" 'isearch-|-char)
370
371 ;; Turned off because I find I expect to get the global definition--rms. 364 ;; Turned off because I find I expect to get the global definition--rms.
372 ;; ;; Instead bind C-h to special help command for isearch-mode. 365 ;; ;; Instead bind C-h to special help command for isearch-mode.
373 ;; (define-key map "\C-h" 'isearch-mode-help) 366 ;; (define-key map "\C-h" 'isearch-mode-help)
@@ -1416,14 +1409,14 @@ might return the position of the end of the line."
1416Respects \\[isearch-repeat-forward] and \\[isearch-repeat-backward] by 1409Respects \\[isearch-repeat-forward] and \\[isearch-repeat-backward] by
1417stopping at `isearch-barrier' as needed. 1410stopping at `isearch-barrier' as needed.
1418 1411
1419Do nothing if a backslash is escaping the liberalizing character. If 1412Do nothing if a backslash is escaping the liberalizing character.
1420WANT-BACKSLASH is non-nil, invert this behavior (for \\} and \\|). 1413If WANT-BACKSLASH is non-nil, invert this behavior (for \\} and \\|).
1421 1414
1422Do nothing if regexp has recently been invalid unless optional ALLOW-INVALID 1415Do nothing if regexp has recently been invalid unless optional
1423non-nil. 1416ALLOW-INVALID non-nil.
1424 1417
1425If optional TO-BARRIER non-nil, ignore previous matches and go exactly to the 1418If optional TO-BARRIER non-nil, ignore previous matches and go exactly
1426barrier." 1419to the barrier."
1427 ;; (eq (not a) (not b)) makes all non-nil values equivalent 1420 ;; (eq (not a) (not b)) makes all non-nil values equivalent
1428 (when (and isearch-regexp (eq (not (isearch-backslash isearch-string)) 1421 (when (and isearch-regexp (eq (not (isearch-backslash isearch-string))
1429 (not want-backslash)) 1422 (not want-backslash))
@@ -1469,26 +1462,7 @@ barrier."
1469 (goto-char (if isearch-forward 1462 (goto-char (if isearch-forward
1470 (max last-other-end isearch-barrier) 1463 (max last-other-end isearch-barrier)
1471 (min last-other-end isearch-barrier))) 1464 (min last-other-end isearch-barrier)))
1472 (setq isearch-adjusted t)))))) 1465 (setq isearch-adjusted t)))))))
1473 (isearch-process-search-char last-command-char))
1474
1475;; * and ? are special when not preceded by \.
1476(defun isearch-*-char ()
1477 "Maybe back up to handle * and ? specially in regexps."
1478 (interactive)
1479 (isearch-fallback nil))
1480
1481;; } is special when it is preceded by \.
1482(defun isearch-}-char ()
1483 "Handle \\} specially in regexps."
1484 (interactive)
1485 (isearch-fallback t t))
1486
1487;; | is special when it is preceded by \.
1488(defun isearch-|-char ()
1489 "If in regexp search, jump to the barrier unless in a group."
1490 (interactive)
1491 (isearch-fallback t nil t))
1492 1466
1493(defun isearch-unread-key-sequence (keylist) 1467(defun isearch-unread-key-sequence (keylist)
1494 "Unread the given key-sequence KEYLIST. 1468 "Unread the given key-sequence KEYLIST.
@@ -1786,10 +1760,10 @@ Isearch mode."
1786 (isearch-process-search-char char)))) 1760 (isearch-process-search-char char))))
1787 1761
1788(defun isearch-return-char () 1762(defun isearch-return-char ()
1789 "Convert return into newline for incremental search. 1763 "Convert return into newline for incremental search."
1790Obsolete."
1791 (interactive) 1764 (interactive)
1792 (isearch-process-search-char ?\n)) 1765 (isearch-process-search-char ?\n))
1766(make-obsolete 'isearch-return-char 'isearch-printing-char)
1793 1767
1794(defun isearch-printing-char () 1768(defun isearch-printing-char ()
1795 "Add this ordinary printing character to the search string and search." 1769 "Add this ordinary printing character to the search string and search."
@@ -1808,6 +1782,14 @@ Obsolete."
1808 (isearch-process-search-char char))))) 1782 (isearch-process-search-char char)))))
1809 1783
1810(defun isearch-process-search-char (char) 1784(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
1811 ;; Append the char to the search string, update the message and re-search. 1793 ;; Append the char to the search string, update the message and re-search.
1812 (isearch-process-search-string 1794 (isearch-process-search-string
1813 (char-to-string char) 1795 (char-to-string char)