summaryrefslogtreecommitdiff
path: root/lisp/isearch.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2008-07-30 16:40:48 +0000
committerJuri Linkov <juri@jurta.org>2008-07-30 16:40:48 +0000
commit70bc5268872ef36ae6df7f87c9f457707cfc52b6 (patch)
tree176ed8b2c8966938971900d2a36415e89cfcbb07 /lisp/isearch.el
parent0e3269e58aeaaf7e72403144226ed5dfc094c865 (diff)
downloademacs-70bc5268872ef36ae6df7f87c9f457707cfc52b6.tar.gz
(isearch-mode-map): Bind `M-s r' to `isearch-toggle-regexp'
and `M-s w' to `isearch-toggle-word'. (search-map): Bind `M-s w' to `isearch-forward-word' globally in the global map `search-map'. (isearch-forward): Doc fix. (isearch-forward-word, isearch-toggle-case-fold): New commands.
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r--lisp/isearch.el36
1 files changed, 31 insertions, 5 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 13f0e1ba1d1..a8020c17acd 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -491,6 +491,9 @@ This is like `describe-bindings', but displays only isearch keys."
(define-key map "\M-r" 'isearch-toggle-regexp)
(define-key map "\M-e" 'isearch-edit-string)
+ (define-key map "\M-sr" 'isearch-toggle-regexp)
+ (define-key map "\M-sw" 'isearch-toggle-word)
+
(define-key map [?\M-%] 'isearch-query-replace)
(define-key map [?\C-\M-%] 'isearch-query-replace-regexp)
(define-key map "\M-so" 'isearch-occur)
@@ -596,6 +599,7 @@ Each set is a vector of the form:
(define-key esc-map "\C-s" 'isearch-forward-regexp)
(define-key global-map "\C-r" 'isearch-backward)
(define-key esc-map "\C-r" 'isearch-backward-regexp)
+(define-key search-map "w" 'isearch-forward-word)
;; Entry points to isearch-mode.
@@ -630,13 +634,9 @@ Type \\[isearch-quote-char] to quote control character to search for it.
If you try to exit with the search string still empty, it invokes
nonincremental search.
-Type \\[isearch-query-replace] to start `query-replace' with string to\
- replace from last search string.
-Type \\[isearch-query-replace-regexp] to start `query-replace-regexp'\
- with string to replace from last search string.
-
Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity.
Type \\[isearch-toggle-regexp] to toggle regular-expression mode.
+Type \\[isearch-toggle-word] to toggle word mode.
Type \\[isearch-edit-string] to edit the search string in the minibuffer.
Also supported is a search ring of the previous 16 search strings.
@@ -645,6 +645,15 @@ Type \\[isearch-ring-retreat] to search for the previous item in the search\
ring.
Type \\[isearch-complete] to complete the search string using the search ring.
+Type \\[isearch-query-replace] to run `query-replace' with string to\
+ replace from last search string.
+Type \\[isearch-query-replace-regexp] to run `query-replace-regexp'\
+ with the last search string.
+Type \\[isearch-occur] to run `occur' that shows\
+ the last search string.
+Type \\[isearch-highlight-regexp] to run `highlight-regexp'\
+ that highlights the last search string.
+
Type \\[isearch-describe-bindings] to display all isearch key bindings.
Type \\[isearch-describe-key] to display documentation of isearch key.
Type \\[isearch-describe-mode] to display documentation of isearch mode.
@@ -684,6 +693,16 @@ and nothing else, enter C-q SPC."
(interactive "P\np")
(isearch-mode t (null not-regexp) nil (not no-recursive-edit)))
+(defun isearch-forward-word (&optional not-word no-recursive-edit)
+ "\
+Do incremental search forward for a sequence of words.
+With a prefix argument, do a regular string search instead.
+Like ordinary incremental search except that your input
+is treated as a sequence of words without regard to how the
+words are separated. See \\[isearch-forward] for more info."
+ (interactive "P\np")
+ (isearch-mode t nil nil (not no-recursive-edit) (null not-word)))
+
(defun isearch-backward (&optional regexp-p no-recursive-edit)
"\
Do incremental search backward.
@@ -1303,6 +1322,13 @@ Use `isearch-exit' to quit without signaling."
(setq isearch-success t isearch-adjusted t)
(isearch-update))
+(defun isearch-toggle-word ()
+ "Toggle word searching on or off."
+ (interactive)
+ (setq isearch-word (not isearch-word))
+ (setq isearch-success t isearch-adjusted t)
+ (isearch-update))
+
(defun isearch-toggle-case-fold ()
"Toggle case folding in searching on or off."
(interactive)