Subject: bug#21663: 25.0.50; isearch-edit-string dont resume multi-isearch-files

From: Juri Linkov <[email-masked]>
Date: Mon, 12 Oct 2015 23:17:15 +0300

>> Start fresh session:
>> emacs -Q
>>
>> C-x C-b
>> M-x multi-isearch-buffer RET *scratch* RET *Buffer List* RET RET s
>> (Using C-s several times will search "s" on the two buffers).
>>
>> M-s e
>> (Now C-s should keep searching the same string "s" in the two buffers,
>>  but the string is searched just in the current buffer).
>
> Previous patch would not work for `multi-isearch-files'
> because it is not checking `multi-isearch-file-list', so that
> `multi-isearch-end' would be called.
>
> We may replace
> (if (and nopush edit multi-isearch-buffer-list)
> with
> (if (and nopush edit (or multi-isearch-buffer-list multi-isearch-file-list))
> but just
> (if (and nopush edit)
> wold work in any situation and its shorter.

I wonder why ‘isearch-mode-end-hook-quit’ is not initialized as
‘(and nopush edit)’ in the first place?  If it was so, then
you could just check for it in ‘multi-isearch-end’.

But please note that not finishing multi-isearch correctly has such
side effects as e.g. after ‘M-s e’ switching from the minibuffer
to another buffer and starting another ordinary search in it will still
use multi-isearch, etc.  Instead of not finishing multi-isearch,
have you tried to re-initialize multi-isearch on resuming isearch
after exiting from the minibuffer?  (This could be achieved by
remembering its state variables).