>> - when the current line after the prompt is too long the prompt >> disappears > > Yes, set visual-line-mode -1 for this. Is the only solution so far and > what I will do in the setup probably. > No, it is not the only solution, my code handles that case without using visual-line-mode. By the way, I just checked it (with your code) and apparently enabling visual-line-mode does not solve that problem. > > Did you applied the patch cleanly? > As far as I can see yes. I already tried your code twice, did you try mine? I attach the improved version which handles the minibuffer-only case. Anyway, IMO you not are using the best approach on this project, you are trying to do too many things at once. Completion mechanisms are a very complex thing, and I believe the best way is to do small incremental improvements with minimal changes, and to test them thoroughly before implementing the next improvement.