Question

I'm probably going down the wrong path here, so let me know if I am. I'm trying to build a similar user interface to that which Vim's ctrlp and other plugins use, whereby the user is given a prompt, and as they type, results are shown above the minibuffer prompt line.

I've gotten the minibuffer command handling part working fine with minibuffer-with-setup-hook and a local post-command-hook (easy) and can get the results I want to display (verified by just (message)ing them for now).

If I want to show, say, 10 lines of results above that minibuffer prompt line, should I be somehow prepending text to the minibuffer, or using a separate buffer that I'll close once the command finishes? Any pointers to parts of the manual I should be reading to be on the right track with this?

Was it helpful?

Solution

The "minibuffer" is a normal buffer, so you can modify it by inserting/deleting text into it in the normal way. This said, adding text "before" means basically modifying the prompt which might lead to problems down the line. You'll probably be much better off doing something like

(let ((ol (make-overlay (point-min) (point-min))))
  (overlay-put ol 'before-string (format "%s\n" myresults)))

OTHER TIPS

I started to write this as a comment, but it got a bit too long ...

TBH, I feel there is room for a lighter weight version of helm. But the reality is helm is good enough, and someone else has already written it.

Neither I nor anyone else (so far) is motivated enough to rewrite it. What you describe as "God" aspect of it is indeed unappealing. But it is possible to load it (huge as it is, with modern computers, it really isn't an issue), and change settings so it is minimalistic.

ido is a simpler alternative, but the style of UI is not exactly how you described.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top