[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: call-interactively 'query-replace and 'isearch-forward
From: |
Thorsten Jolitz |
Subject: |
Re: call-interactively 'query-replace and 'isearch-forward |
Date: |
Mon, 11 Mar 2013 18:10:34 +0100 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.2 (gnu/linux) |
"Drew Adams" <drew.adams@oracle.com> writes:
>> ,------------------------------------------
>> | 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.
Thats what I noticed as a quick window blink. I'm not so much interested
in the deep root cause of the problem, but rather in a working solution.
> But here is something that works for `foo':
>
> (defun foo ()
> (interactive)
> (isearch-mode t nil nil t nil)
> (call-interactively #'query-replace))
And this is a working solution - thanks a lot.
--
cheers,
Thorsten