aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2008-07-30 16:40:48 +0000
committerJuri Linkov2008-07-30 16:40:48 +0000
commit70bc5268872ef36ae6df7f87c9f457707cfc52b6 (patch)
tree176ed8b2c8966938971900d2a36415e89cfcbb07
parent0e3269e58aeaaf7e72403144226ed5dfc094c865 (diff)
downloademacs-70bc5268872ef36ae6df7f87c9f457707cfc52b6.tar.gz
emacs-70bc5268872ef36ae6df7f87c9f457707cfc52b6.zip
(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.
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/isearch.el36
2 files changed, 43 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f563838407c..597f35b2c69 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12008-07-30 Juri Linkov <juri@jurta.org>
2
3 * isearch.el (isearch-mode-map): Bind `M-s r' to
4 `isearch-toggle-regexp' and `M-s w' to `isearch-toggle-word'.
5 (search-map): Bind `M-s w' to `isearch-forward-word' globally
6 in the global map `search-map'.
7 (isearch-forward): Doc fix.
8 (isearch-forward-word, isearch-toggle-case-fold): New commands.
9
10 * simple.el (quoted-insert): Comment out code that treats
11 0240-0377 specially.
12
12008-07-30 Chong Yidong <cyd@stupidchicken.com> 132008-07-30 Chong Yidong <cyd@stupidchicken.com>
2 14
3 * cus-start.el: Add customization info for 15 * cus-start.el: Add customization info for
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."
491 (define-key map "\M-r" 'isearch-toggle-regexp) 491 (define-key map "\M-r" 'isearch-toggle-regexp)
492 (define-key map "\M-e" 'isearch-edit-string) 492 (define-key map "\M-e" 'isearch-edit-string)
493 493
494 (define-key map "\M-sr" 'isearch-toggle-regexp)
495 (define-key map "\M-sw" 'isearch-toggle-word)
496
494 (define-key map [?\M-%] 'isearch-query-replace) 497 (define-key map [?\M-%] 'isearch-query-replace)
495 (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) 498 (define-key map [?\C-\M-%] 'isearch-query-replace-regexp)
496 (define-key map "\M-so" 'isearch-occur) 499 (define-key map "\M-so" 'isearch-occur)
@@ -596,6 +599,7 @@ Each set is a vector of the form:
596(define-key esc-map "\C-s" 'isearch-forward-regexp) 599(define-key esc-map "\C-s" 'isearch-forward-regexp)
597(define-key global-map "\C-r" 'isearch-backward) 600(define-key global-map "\C-r" 'isearch-backward)
598(define-key esc-map "\C-r" 'isearch-backward-regexp) 601(define-key esc-map "\C-r" 'isearch-backward-regexp)
602(define-key search-map "w" 'isearch-forward-word)
599 603
600;; Entry points to isearch-mode. 604;; Entry points to isearch-mode.
601 605
@@ -630,13 +634,9 @@ Type \\[isearch-quote-char] to quote control character to search for it.
630If you try to exit with the search string still empty, it invokes 634If you try to exit with the search string still empty, it invokes
631 nonincremental search. 635 nonincremental search.
632 636
633Type \\[isearch-query-replace] to start `query-replace' with string to\
634 replace from last search string.
635Type \\[isearch-query-replace-regexp] to start `query-replace-regexp'\
636 with string to replace from last search string.
637
638Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity. 637Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity.
639Type \\[isearch-toggle-regexp] to toggle regular-expression mode. 638Type \\[isearch-toggle-regexp] to toggle regular-expression mode.
639Type \\[isearch-toggle-word] to toggle word mode.
640Type \\[isearch-edit-string] to edit the search string in the minibuffer. 640Type \\[isearch-edit-string] to edit the search string in the minibuffer.
641 641
642Also supported is a search ring of the previous 16 search strings. 642Also 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\
645 ring. 645 ring.
646Type \\[isearch-complete] to complete the search string using the search ring. 646Type \\[isearch-complete] to complete the search string using the search ring.
647 647
648Type \\[isearch-query-replace] to run `query-replace' with string to\
649 replace from last search string.
650Type \\[isearch-query-replace-regexp] to run `query-replace-regexp'\
651 with the last search string.
652Type \\[isearch-occur] to run `occur' that shows\
653 the last search string.
654Type \\[isearch-highlight-regexp] to run `highlight-regexp'\
655 that highlights the last search string.
656
648Type \\[isearch-describe-bindings] to display all isearch key bindings. 657Type \\[isearch-describe-bindings] to display all isearch key bindings.
649Type \\[isearch-describe-key] to display documentation of isearch key. 658Type \\[isearch-describe-key] to display documentation of isearch key.
650Type \\[isearch-describe-mode] to display documentation of isearch mode. 659Type \\[isearch-describe-mode] to display documentation of isearch mode.
@@ -684,6 +693,16 @@ and nothing else, enter C-q SPC."
684 (interactive "P\np") 693 (interactive "P\np")
685 (isearch-mode t (null not-regexp) nil (not no-recursive-edit))) 694 (isearch-mode t (null not-regexp) nil (not no-recursive-edit)))
686 695
696(defun isearch-forward-word (&optional not-word no-recursive-edit)
697 "\
698Do incremental search forward for a sequence of words.
699With a prefix argument, do a regular string search instead.
700Like ordinary incremental search except that your input
701is treated as a sequence of words without regard to how the
702words are separated. See \\[isearch-forward] for more info."
703 (interactive "P\np")
704 (isearch-mode t nil nil (not no-recursive-edit) (null not-word)))
705
687(defun isearch-backward (&optional regexp-p no-recursive-edit) 706(defun isearch-backward (&optional regexp-p no-recursive-edit)
688 "\ 707 "\
689Do incremental search backward. 708Do incremental search backward.
@@ -1303,6 +1322,13 @@ Use `isearch-exit' to quit without signaling."
1303 (setq isearch-success t isearch-adjusted t) 1322 (setq isearch-success t isearch-adjusted t)
1304 (isearch-update)) 1323 (isearch-update))
1305 1324
1325(defun isearch-toggle-word ()
1326 "Toggle word searching on or off."
1327 (interactive)
1328 (setq isearch-word (not isearch-word))
1329 (setq isearch-success t isearch-adjusted t)
1330 (isearch-update))
1331
1306(defun isearch-toggle-case-fold () 1332(defun isearch-toggle-case-fold ()
1307 "Toggle case folding in searching on or off." 1333 "Toggle case folding in searching on or off."
1308 (interactive) 1334 (interactive)