abo-abo / ace-window

Quickly switch windows in Emacs
970 stars 86 forks source link

Add execute-command-other-window #160

Closed nickdrozd closed 5 years ago

abo-abo commented 5 years ago

What's the use-case for this?

nickdrozd commented 5 years ago

Say I have four windows, I'm currently in window a, I have a compilation buffer in window d, and I want to recompile. Currently this will require two window switch operations (I use C-o for AW dispatch): C-o d g C-o a. With this function, I only need one: C-o e d g.

This accepts arbitrary key sequences, like opening a Projectile shell buffer: C-o e f C-c p x s. That will open the shell buffer in window f and then switch back.

I don't know if this is the best way to read key sequences, but I've been using the command for a while and it seems to work fine.

abo-abo commented 5 years ago

Thanks.

duianto commented 5 years ago

The aw-dispatch-alist name: Execute Command Other Window sounds like it might ask for a command name.

Since the prompt says: Enter key sequence: maybe a more descriptive name would be: Key Sequence Other Window

Even if it isn't renamed, the two action lists in the readme https://github.com/abo-abo/ace-window#change-the-action-midway https://github.com/abo-abo/ace-window#aw-dispatch-alist is missing an entry for this command.

nickdrozd commented 5 years ago

That's a good point. I don't have strong opinions either way.

duianto commented 5 years ago

If either one or two additional actions were added that opens the M-x or/and Eval: prompts in the other window.

Then at least one of them could be called Execute Command Other Window.