rougier / nano-emacs

GNU Emacs / N Λ N O - Emacs made simple
GNU General Public License v3.0
2.52k stars 195 forks source link

[Question] Moving minibuffer to the top? #25

Open BooAA opened 3 years ago

BooAA commented 3 years ago

Hi, thanks for this awesome package, it's really pleasing to use.

After reading "On the design of Text Editors", I'm thinking about a better place to put minibuffer (or command palette in general). In Emacs, many people use helm, ivy or other completion framework, which either enlarge minibuffer or create another buffer to display completion list. This may be distracting sometimes (feels like something gigantic popup to you, especially on ultra wide 34 inches screen). Do you think it's a good idea to move minibuffer to the top just like where other editor put their command palette? This way, it's more like a drop down menu and more intuitive to use IMHO.

Or are there any alternative UI for displaying list of candidates? I'm searching for different idea, what do you think?

rougier commented 3 years ago

I can imagine having the command prompt at the top but I don't know how to do that (or even if it possible). As for the giant popup, I agree that it is distracting sometime. I think there are some options to limit the size but I don't think we can limit it globally.

BooAA commented 3 years ago

I don't know how to do that (or even if it possible).

It's not possible to directly move minibuffer to other places AFAIK. Some method can mimic the behavior, the common way (and maybe the only way) I know is to create another minibuffer-only frame, assign it as the minibuffer of current one. Some related resources I can find:

  1. How to display the content of minibuffer in the middle of the emacs frame?

  2. Drew Adam's 1 on 1 Emacs has similar idea.

  3. Someone ask this in Emacs-devel many years ago

All of the above solution use another frame for getting minibuffer input.

An alternative to this is to popup a child frame when read-from-minibuffer is called. (Instead of having a dedicated one displayed on top all the time, a child frame containing minibuffer only is popup on demand. I'm not a fan of this to be honest.)

  1. mini-frame

  2. maple-minibuffer

  3. ivy-posframe

  4. In helm, set helm-display-frame to helm-display-buffer-in-own-frame

Hope above information helps if nano-emacs is going to tweak minibuffer/command prompt in the future. I wish we can have cleaner and less disturbing layout when doing minibuffer completion in Emacs.

rougier commented 3 years ago

Just pushed an experimental command line in the header line.

rougier commented 3 years ago

I've also tried mini-frame and it is really nice. I'm using with the new nano-compact.el layout I pushed.

BooAA commented 3 years ago

I'm currently using embark with embark-collect-live-initial-delay set to 1.0. This way, the completion will popup after 1 second of idle. This seems to be an alternative to make completion less obtrusive and still to be useful sometimes (note you don't have to use embark in order to have this kind of behavior since it's relatively easy to setup a timer in minibuffer-setup-hook, but embark has some other nice feature so I decided to give it a try)

rougier commented 3 years ago

Would you have some screenshots of embark. I read the README but it is not totally clear how it works and looks.

BooAA commented 3 years ago

There are 2 videos on youtube that demo embark and related packages very well. Here's the link Emacs: completion framework (Embark,Consult,Orderless,etc.) and Emacs: Embark and my extras, hope this help.

rougier commented 3 years ago

Thanks. In the end it is quite orthogonal to the place of the minibuffer. On this topic, I experimented a bit with a regular minibuffer but with different color:

Screenshot 2021-01-20 at 09 12 30