about summary refs log tree commit diff
path: root/users/wpcarro/emacs/.emacs.d
diff options
context:
space:
mode:
Diffstat (limited to 'users/wpcarro/emacs/.emacs.d')
-rw-r--r--users/wpcarro/emacs/.emacs.d/wpc/window-manager.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/users/wpcarro/emacs/.emacs.d/wpc/window-manager.el b/users/wpcarro/emacs/.emacs.d/wpc/window-manager.el
index 308424cc54d8..4c61138f948a 100644
--- a/users/wpcarro/emacs/.emacs.d/wpc/window-manager.el
+++ b/users/wpcarro/emacs/.emacs.d/wpc/window-manager.el
@@ -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