abo-abo / ace-window

Quickly switch windows in Emacs
977 stars 87 forks source link

Make the cutoff when ace-selection happens configurable #109

Closed jwiegley closed 6 years ago

jwiegley commented 6 years ago
--- a/site-lisp/site-ivy/ace-window/ace-window.el
+++ b/site-lisp/site-ivy/ace-window/ace-window.el
@@ -109,6 +109,10 @@ This will make `ace-window' act different from `other-window' for
   one or two windows."
   :type 'boolean)

+(defcustom aw-dispatch-when-more-than 2
+  "If the number of windows is more than this, activate ace-window-ness."
+  :type 'integer)
+
 (defcustom aw-reverse-frame-list nil
   "When non-nil `ace-window' will order frames for selection in
 the reverse of `frame-list'"
@@ -315,7 +319,7 @@ Amend MODE-LINE to the mode line for the duration of the selection."
                    (when (eq aw-action 'exit)
                      (setq aw-action nil)))
                  (or (car wnd-list) start-window))
-                ((and (= (length wnd-list) 2)
+                ((and (<= (length wnd-list) aw-dispatch-when-more-than)
                       (not aw-dispatch-always)
                       (not aw-ignore-current))
                  (let ((wnd (next-window nil nil next-window-scope)))
jwiegley commented 6 years ago

I bind C-<return> to ace-window, so when there are only 3 windows, it's still quicker to just hit RET twice than to select a number.

abo-abo commented 6 years ago

Thanks.