Subject: bug#22575: 25.0.50; isearch-query-replace wrong type argument

From: Juri Linkov <[email-masked]>
Date: Mon, 08 Feb 2016 02:50:28 +0200

> In *scratch*, put the point at the beginning of the buffer and
>
> M-x isearch-query-replace
>
> The minibuffer shows
>
> Wrong type argument: stringp, nil
>
> The same happens if an isearch was previously executed. (From reading
> the docstring, I don't know how isearch-query-replace is supposed to
> work.)

It's easy to fix the error of a nil ‘isearch--current-buffer’ in
‘isearch-done’ (it's also reproducible by evaling just ‘(isearch-done)’).
But then with an empty search string initially, ‘isearch-query-replace’
will start replacements of an empty string.  So outside of isearch mode
it could be useful only with the last non-empty search string.