It works fine, but there is a problem. When I am in i-search
mode, pressing backspace deletes the last character in the
window, not in the i-search mini-buffer.
I do not know much about elisp. The function above I just
"stole" together. What can I do?
I don't have time to look at this now - hopefully someone else will help you.
But here's one piece of info that might help a little: isearch does not use the
minibuffer (for normal searching); it uses the echo area. It reads your input
events without using the minibuffer, and it echoes your keys to the echo area in
an incremental way.