abo-abo / ace-window

Quickly switch windows in Emacs
970 stars 86 forks source link

[feature request] Act as if aw-dispatch-always is on when invoked with prefix arg #179

Open j-cr opened 5 years ago

j-cr commented 5 years ago

What the title says. The reasoning is to use ace-window for all window operations (deleting, swapping, etc) without introducing separate keybindings, while also being able to switch between windows with one keystroke when there're only two windows.

Since it is a breaking change probably a switch to turn this behavior on and off is needed.

rswgnu commented 4 years ago

I vote against any change that breaks the way the prefix arg has been used in ace-window for a long time (greater than a year).

obar commented 4 years ago

I was just going through the issue tracker to mention an unrelated topic and came across your request. Sorry that it's over a year late ;)

I do this locally with 0 arg (C-0 C-o with my bindings) instead of the usual toggling of aw-ignore-on. You can add this definition to your init:

(defun ace-window (arg)
    "Select a window.
Perform an action based on ARG described below.

By default, behaves like extended `other-window'.
See `aw-scope' which extends it to work with frames.

Prefixed with one \\[universal-argument], does a swap between the
selected window and the current window, so that the selected
buffer moves to current window (and current buffer moves to
selected window).

Prefixed with two \\[universal-argument]'s, deletes the selected
window."
    (interactive "p")
    (setq avy-current-path "")
    (cl-case arg
      (0
       (let ((aw-dispatch-always (not aw-dispatch-always)))
         (ace-select-window)))
      (4 (ace-swap-window))
      (16 (ace-delete-window))
      (t (ace-select-window))))
rswgnu commented 4 years ago

Thanks.

-- Bob

On Jul 29, 2020, at 4:06 PM, Ori notifications@github.com wrote:

 I was just going through the issue tracker to mention an unrelated topic and came across your request. Sorry that it's over a year late ;)

I do this locally with 0 arg (C-0 C-o with my bindings) instead of the usual toggling of aw-ignore-on. You can add this definition to your init:

(defun ace-window (arg) "Select a window. Perform an action based on ARG described below.

By default, behaves like extended other-window'. Seeaw-scope' which extends it to work with frames.

Prefixed with one \[universal-argument], does a swap between the selected window and the current window, so that the selected buffer moves to current window (and current buffer moves to selected window).

Prefixed with two \[universal-argument]'s, deletes the selected window." (interactive "p") (setq avy-current-path "") (cl-case arg (0 (let ((aw-dispatch-always (not aw-dispatch-always))) (ace-select-window))) (4 (ace-swap-window)) (16 (ace-delete-window)) (t (ace-select-window)))) — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.