feat(wpcarro/emacs): Define window-manager-move-window

Move the current window to a new named EXWM workspace and focus that workspace.

Change-Id: Ibb3d3b3df09c6853d2eaf02882714a5c62623d2b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5293
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
This commit is contained in:
William Carroll 2022-02-15 11:46:28 -08:00 committed by clbot
parent 36f6322d16
commit 7e65edcb16

View file

@ -209,5 +209,20 @@ predicate."
t)
window-manager-named-workspaces)))
(defun window-manager-move-window ()
"Prompt the user to move the current window to another workspace."
(interactive)
(let ((window (get-buffer-window))
(dest (completing-read "Move current window to: "
(->> window-manager-named-workspaces
(-map #'window-manager-named-workspace-label))
nil
t)))
(exwm-workspace-move-window
(exwm-workspace--workspace-from-frame-or-index
(window-manager--label->index dest window-manager-named-workspaces))
(exwm--buffer->id window))
(window-manager--switch dest)))
(provide 'window-manager)
;;; window-manager.el ends here