Closed scarab5q closed 5 years ago
Thanks, I've added a new arg to aw-delete-window
, see the commit message for an example.
Regarding aw-kill-buffer
, I don't think it's that useful, since you don't really know which other buffer will take its place.
I have been looking how to kill buffers in ace-window for a while. I've looked about and couldn't find anything. Just before I was about to post this I just decided to write them myself. They are really simple and haven't been rigorously tested but:
(defun aw-kill-buffer (window) (kill-buffer '(window-buffer window)))
I do like this functionality (the buffer that takes place is often the one that was there right before). Thanks for the code! I think, though, there is a typo and the function should be
(defun aw-kill-buffer (window)
(kill-buffer (window-buffer window)))
Here is an advice that I came up to kill the buffer of the selected window:
(advice-add #'ace-window :around
(lambda (oldfun &rest arg)
"Prefixed with three C-u's, kill the buffer of that window."
(if (/= 64 (car arg))
(apply oldfun arg)
(save-window-excursion
(apply oldfun arg)
(kill-buffer))))
'((name . kill-buffer)))
Regarding
aw-kill-buffer
, I don't think it's that useful, since you don't really know which other buffer will take its place.
As an example, I sometimes get the "*Warning*" buffer replacing the buffer in window 2 while I'm currently working on the buffer in window 1, so it would be more efficient if I could kill that buffer from where I am instead of having to switch to that window to kill it and then go back.
So instead of M-o 2 C-x k RET M-o 1
we use M-o k 2
(Assuming we have 3 windows visibles).
That being said, I'm not sure if this feature aligns with the purpose of this package since it would be interfering with buffers rather that windows, but that would definitely help avoiding switching between windows when killing a visible buffer is needed.
I have been looking how to kill buffers in ace-window for a while. I've looked about and couldn't find anything. Just before I was about to post this I just decided to write them myself. They are really simple and haven't been rigorously tested but:
I'm still getting to grips with e-lisp and so the first one is really simple and the second one basically just copied your code for delete window but just added and extra variable. I was just wondering what you thought. If there is something else that does this then I am all ears :)