[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ace-window 9aec100 01/92: Allow to pop current buffer a
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ace-window 9aec100 01/92: Allow to pop current buffer and move it with "M" during dispatch |
Date: |
Wed, 17 Mar 2021 18:39:10 -0400 (EDT) |
branch: externals/ace-window
commit 9aec100f72237ee0be23c5b1774e323dc9d04d37
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
Allow to pop current buffer and move it with "M" during dispatch
ace-window.el (aw-move-window): New defun.
During dispatch, while in window-1, press "M" and select window-2.
The buffer currently in window-1 will move to window-2.
The most recently selected buffer will move to window-1.
Fixes #56
Use case: suppose you have many windows and you call
`describe-function'. It pops up *Help* replacing a necessary buffer.
The you can e.g. "M-p M a" to move the *Help* buffer to replace a less
necessary buffer in window "a", while restoring the necessary buffer
that *Help* previously replaced.
---
ace-window.el | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/ace-window.el b/ace-window.el
index a1c12ed..f528c4b 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -250,6 +250,7 @@ LEAF is (PT . WND)."
(defvar aw-dispatch-alist
'((?x aw-delete-window " Ace - Delete Window")
(?m aw-swap-window " Ace - Swap Window")
+ (?M aw-move-window " Ace - Move Window")
(?n aw-flip-window)
(?v aw-split-window-vert " Ace - Split Vert Window")
(?b aw-split-window-horz " Ace - Split Horz Window")
@@ -472,6 +473,14 @@ Windows are numbered top down, left to right."
(swap-windows window this-window)
(swap-windows this-window window))))))
+(defun aw-move-window (window)
+ "Move the current buffer to WINDOW.
+Switch the current window to the previous buffer."
+ (let ((buffer (current-buffer)))
+ (switch-to-buffer (other-buffer))
+ (aw-switch-to-window window)
+ (switch-to-buffer buffer)))
+
(defun aw-split-window-vert (window)
"Split WINDOW vertically."
(select-window window)
- [elpa] externals/ace-window updated (97a2f93 -> c7cb315), Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 5a38c58 02/92: ace-window.el (aw-select): Bind `avy-translate-char-function', Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 55221b0 03/92: Typo fixes, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window f786679 04/92: Allow non-printing keys like in avy, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 4a89ccc 05/92: ace-window.el (aw-switch-to-window): Push early, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window f6653fb 06/92: Fix up aw-leading-char-style 'path setting, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 92bd29c 08/92: Fix frames order, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 9aec100 01/92: Allow to pop current buffer and move it with "M" during dispatch,
Stefan Monnier <=
- [elpa] externals/ace-window f54d2bd 11/92: ace-window.el (ace-maximize-window): Rename, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window c5e31ce 16/92: ace-window.el (aw-show-dispatch-help): Add and bind to "?", Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window c6f5c03 20/92: Clarify when aw-dispatch-always should be set to t., Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window c875ffb 22/92: ace-window.el (aw-show-dispatch-help): Clean up overlays, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 6aaf1e6 13/92: Fix typo in docstring of aw-background, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 77cc05f 07/92: Add 'visible option for aw-scope, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 056abfe 14/92: ace-window.el (aw-switch-buffer-in-window): Add and bind to "j", Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 91d736e 15/92: ace-window.el (aw-dispatch-default): Clarify through destructuring, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window a488657 17/92: ace-window.el (aw-show-dispatch-help): Call ace-window, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 2701919 18/92: ace-window.el (aw-key-face): Add, Stefan Monnier, 2021/03/17