Mercurial > emacs
changeset 56352:f0e5e08dd63e
(isearch-query-replace): Pass the regexp-ness and delimited-ness of
the search to query-replace.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 05 Jul 2004 23:28:42 +0000 |
parents | d073da76f0a5 |
children | 1468ded18da0 |
files | lisp/isearch.el |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/isearch.el Mon Jul 05 23:12:28 2004 +0000 +++ b/lisp/isearch.el Mon Jul 05 23:28:42 2004 +0000 @@ -1,7 +1,7 @@ ;;; isearch.el --- incremental search minor mode -;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1999, 2000, 01, 2003, 2004 -;; Free Software Foundation, Inc. +;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999, +;; 2000, 2001, 2003, 2004 Free Software Foundation, Inc. ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> ;; Maintainer: FSF @@ -59,7 +59,6 @@ ;; TODO ;; - Integrate the emacs 19 generalized command history. -;; - Think about incorporating query-replace. ;; - Hooks and options for failed search. ;;; Change Log: @@ -338,8 +337,8 @@ (define-key map "\M-r" 'isearch-toggle-regexp) (define-key map "\M-e" 'isearch-edit-string) - (define-key map (kbd "M-%") 'isearch-query-replace) - (define-key map (kbd "C-M-%") 'isearch-query-replace-regexp) + (define-key map [?\M-%] 'isearch-query-replace) + (define-key map [?\C-\M-%] 'isearch-query-replace-regexp) map) "Keymap for `isearch-mode'.") @@ -1062,14 +1061,15 @@ (defun isearch-query-replace () "Start query-replace with string to replace from last search string." (interactive) - (let ((query-replace-interactive t) - (case-fold-search isearch-case-fold-search)) - ;; Put search string into the right ring - (setq isearch-regexp nil) + (barf-if-buffer-read-only) + (let ((case-fold-search isearch-case-fold-search)) (isearch-done) (isearch-clean-overlays) (and isearch-forward isearch-other-end (goto-char isearch-other-end)) - (call-interactively 'query-replace))) + (perform-replace + isearch-string + (query-replace-read-to isearch-string "Query replace" isearch-regexp) + t isearch-regexp isearch-word))) (defun isearch-query-replace-regexp () "Start query-replace-regexp with string to replace from last search string." @@ -2380,5 +2380,5 @@ isearch-case-fold-search case-fold) (isearch-search)) -;;; arch-tag: 74850515-f7d8-43a6-8a2c-ca90a4c1e675 +;; arch-tag: 74850515-f7d8-43a6-8a2c-ca90a4c1e675 ;;; isearch.el ends here