How can I automatically move selected to the other window? Trying to streamline my split-window workflow.
Here's what I have so far. Doesn't work yet.
(defun move-region-to-other-window (start end)
"Move selected text to other window"
(interactive "r")
(if (use-region-p)
(let ((count (count-words-region start end)))
(save-excursion
(kill-region start end)
(other-window)
(yank)
(newline))
(other-window)
(message "Moved %s words" count))
(message "No region selected")))
Attribution: Code above is based on danielsz's excellent package Palimpsest Mode.