-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add crux-transpose-windows for swapping the buffers between two windows #21
Conversation
Looks good, just squash the two commits together. Adding a brief description of the difference with |
e81cd26
to
cc20d3d
Compare
Squashed the commits together. In terms of the difference between transpose and swap, swap only works for 2 open windows (and only for two, it errors out if there are more). To be honest, I'm not sure I can think of any case where swap-windows would be preferable to transpose. As far as I know, transpose is a superset of the functionality of swap-windows. |
1384522
to
c24c94d
Compare
(set-window-buffer (selected-window) next-win) | ||
(set-window-buffer (funcall selector) this-win) | ||
(select-window (funcall selector))) | ||
(setq arg (if (plusp arg) (1- arg) (1+ arg)))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, this should be cl-plusp
. (or just (< 0 arg)
)
c24c94d
to
2485e60
Compare
Probably we can mark the other function as obsolete and remove it down the road then. |
2485e60
to
bc9efbd
Compare
Fixed the cl-plusp issue, and documented the behavior on prefix arguments like 2 or -2. The only part about swap-windows that I don't follow is why it calls |
Good idea. Alias it and remove it from the readme. |
Should that also be squashed in, a second commit or a different PR? |
Second commit, same PR. |
This is copied directly from https://www.emacswiki.org/emacs/TransposeWindows, and renamed to crux-tranpose-windows. The wiki page mentions the original author as Thomas Bellman. It does not appear to be published in any existing package that I could find. Amend documentation string to appease checkdoc Added documentation explaining ARG count > 1 or < -1 Use cl-plusp over plusp
a6f1711
to
36dd3d4
Compare
36dd3d4
to
e6c7421
Compare
Add crux-transpose-windows for swapping the buffers between two windows
👍 |
This is copied directly from
https://www.emacswiki.org/emacs/TransposeWindows, and renamed to
crux-tranpose-windows. The wiki page mentions the original author as
Thomas Bellman. It does not appear to be published in any existing
package that I could find.