aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-07-05 23:28:42 +0000
committerStefan Monnier2004-07-05 23:28:42 +0000
commit81e898ea68215faaebc0a4d82ae8e30057cf7f7b (patch)
tree78895f03f546c7acd2bbf079fb5a9bce12695963
parent1606466a39bbfe949ead462074686a3c893d0bca (diff)
downloademacs-81e898ea68215faaebc0a4d82ae8e30057cf7f7b.tar.gz
emacs-81e898ea68215faaebc0a4d82ae8e30057cf7f7b.zip
(isearch-query-replace): Pass the regexp-ness and delimited-ness of
the search to query-replace.
-rw-r--r--lisp/isearch.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 6a787f9cc6a..a5261d2530c 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1,7 +1,7 @@
1;;; isearch.el --- incremental search minor mode 1;;; isearch.el --- incremental search minor mode
2 2
3;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1999, 2000, 01, 2003, 2004 3;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999,
4;; Free Software Foundation, Inc. 4;; 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
5 5
6;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> 6;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
7;; Maintainer: FSF 7;; Maintainer: FSF
@@ -59,7 +59,6 @@
59 59
60;; TODO 60;; TODO
61;; - Integrate the emacs 19 generalized command history. 61;; - Integrate the emacs 19 generalized command history.
62;; - Think about incorporating query-replace.
63;; - Hooks and options for failed search. 62;; - Hooks and options for failed search.
64 63
65;;; Change Log: 64;;; Change Log:
@@ -338,8 +337,8 @@ Default value, nil, means edit the string instead."
338 (define-key map "\M-r" 'isearch-toggle-regexp) 337 (define-key map "\M-r" 'isearch-toggle-regexp)
339 (define-key map "\M-e" 'isearch-edit-string) 338 (define-key map "\M-e" 'isearch-edit-string)
340 339
341 (define-key map (kbd "M-%") 'isearch-query-replace) 340 (define-key map [?\M-%] 'isearch-query-replace)
342 (define-key map (kbd "C-M-%") 'isearch-query-replace-regexp) 341 (define-key map [?\C-\M-%] 'isearch-query-replace-regexp)
343 342
344 map) 343 map)
345 "Keymap for `isearch-mode'.") 344 "Keymap for `isearch-mode'.")
@@ -1062,14 +1061,15 @@ Use `isearch-exit' to quit without signaling."
1062(defun isearch-query-replace () 1061(defun isearch-query-replace ()
1063 "Start query-replace with string to replace from last search string." 1062 "Start query-replace with string to replace from last search string."
1064 (interactive) 1063 (interactive)
1065 (let ((query-replace-interactive t) 1064 (barf-if-buffer-read-only)
1066 (case-fold-search isearch-case-fold-search)) 1065 (let ((case-fold-search isearch-case-fold-search))
1067 ;; Put search string into the right ring
1068 (setq isearch-regexp nil)
1069 (isearch-done) 1066 (isearch-done)
1070 (isearch-clean-overlays) 1067 (isearch-clean-overlays)
1071 (and isearch-forward isearch-other-end (goto-char isearch-other-end)) 1068 (and isearch-forward isearch-other-end (goto-char isearch-other-end))
1072 (call-interactively 'query-replace))) 1069 (perform-replace
1070 isearch-string
1071 (query-replace-read-to isearch-string "Query replace" isearch-regexp)
1072 t isearch-regexp isearch-word)))
1073 1073
1074(defun isearch-query-replace-regexp () 1074(defun isearch-query-replace-regexp ()
1075 "Start query-replace-regexp with string to replace from last search string." 1075 "Start query-replace-regexp with string to replace from last search string."
@@ -2380,5 +2380,5 @@ CASE-FOLD non-nil means the search was case-insensitive."
2380 isearch-case-fold-search case-fold) 2380 isearch-case-fold-search case-fold)
2381 (isearch-search)) 2381 (isearch-search))
2382 2382
2383;;; arch-tag: 74850515-f7d8-43a6-8a2c-ca90a4c1e675 2383;; arch-tag: 74850515-f7d8-43a6-8a2c-ca90a4c1e675
2384;;; isearch.el ends here 2384;;; isearch.el ends here