abo-abo / ace-window

Quickly switch windows in Emacs
984 stars 87 forks source link

Add function to call ace-window with forced aw-dispatch #216

Open bertulli opened 2 years ago

bertulli commented 2 years ago

Hi, I apologize if this was already asked. I use ace-window with aw-dispatch-always set to nil, as I really like the use of M-o as a switch windows when I have only 2 windows. However, I also find very comfortably having the dispatchable actions (like v to split a window). Without changing the value of aw-dispatch-always, I thought that something like this can be added:

(defun ace-window-manual-dispatch (arg)
  "Calls `ace-window' with ARG asking for the dispatch, even if `aw-dispatch-always' is nil.

This could be useful to use the advanced commands"
  (interactive "p")
(let ((aw-dispatch-always t))
  (ace-window arg)
  ))

I use that in my init file and it works, and I bound that to C-M-o, in order to have like a "super" ace-window call. If that is useful, I would be very happy to create a pull request for it.