help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: call-interactively 'query-replace and 'isearch-forward


From: Drew Adams
Subject: RE: call-interactively 'query-replace and 'isearch-forward
Date: Mon, 11 Mar 2013 09:46:01 -0700

> ,------------------------------------------
> | emacs -Q
> | 
> | (defun foo ()
> |   (interactive)
> |   (call-interactively #'isearch-forward)
> |   (call-interactively #'query-replace))
> | 
> | (defun bar ()
> |   (interactive)
> |   (call-interactively #'query-replace)
> |   (call-interactively #'isearch-forward))
> | 
> | M-x foo
> | M-x bar
> `------------------------------------------
> 
> Both do the same thing: ask for input for 'query-replace'.
> 'isearch-forward' is simply skipped when calling 'foo'.

Actually, `isearch-forward' is not skipped in either case.

In the case of `bar', there is no problem: just follow through with
query-replacing (ending it when you are done), and you will see that you enter
Isearch normally. 

The problem is that in the case of `foo', Isearch is entered but more or less
immediately ends.  I did not bother to step through the debugger or study the
code to see why.  Perhaps someone will do that and reply.

But here is something that works for `foo':

(defun foo ()
  (interactive)
  (isearch-mode t nil nil t nil)
  (call-interactively #'query-replace))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]