mirror of
https://github.com/SqrtMinusOne/perspective-exwm.el.git
synced 2025-12-10 20:53:03 +03:00
fix: stabilize copying and moving perspectives
This commit is contained in:
parent
6d3caf4cd0
commit
5b13dc7ecf
1 changed files with 9 additions and 11 deletions
|
|
@ -211,24 +211,22 @@ If MOVE is t, move the perspective instead."
|
||||||
(when (and move (= 1 (hash-table-count (perspectives-hash))))
|
(when (and move (= 1 (hash-table-count (perspectives-hash))))
|
||||||
(error "Can't move the only workspace"))
|
(error "Can't move the only workspace"))
|
||||||
(let* ((target-workspace (exwm-workspace--prompt-for-workspace))
|
(let* ((target-workspace (exwm-workspace--prompt-for-workspace))
|
||||||
(persp (persp-curr))
|
|
||||||
(persp-name (persp-current-name))
|
(persp-name (persp-current-name))
|
||||||
(url (burly-windows-url)))
|
(url (burly-windows-url))
|
||||||
|
(buffers (persp-current-buffers)))
|
||||||
(unless (= (cl-position target-workspace exwm-workspace--list)
|
(unless (= (cl-position target-workspace exwm-workspace--list)
|
||||||
exwm-workspace-current-index)
|
exwm-workspace-current-index)
|
||||||
|
(when (gethash persp-name (perspectives-hash target-workspace))
|
||||||
|
(error "Perspective with name \"%s\" already exists on the target workspace" persp-name))
|
||||||
(with-selected-frame target-workspace
|
(with-selected-frame target-workspace
|
||||||
(when (gethash persp-name (perspectives-hash))
|
|
||||||
(error "Perspective with name \"%s\" already exists on the target workspace" persp-name))
|
|
||||||
(puthash persp-name (copy-tree (copy-perspective persp)) (perspectives-hash))
|
|
||||||
(with-perspective persp-name
|
(with-perspective persp-name
|
||||||
;; (run-hooks 'persp-created-hook)
|
(mapcar #'persp-add-buffer buffers)
|
||||||
(persp-update-modestring)))
|
(burly-open-url url))
|
||||||
|
(persp-switch persp-name)
|
||||||
|
(persp-update-modestring))
|
||||||
(when move
|
(when move
|
||||||
(persp-kill persp-name))
|
(persp-kill persp-name))
|
||||||
(exwm-workspace-switch target-workspace)
|
(exwm-workspace-switch target-workspace))))
|
||||||
(persp-switch persp-name)
|
|
||||||
(burly-open-url url)
|
|
||||||
(persp-update-modestring))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun perspective-exwm-move-to-workspace ()
|
(defun perspective-exwm-move-to-workspace ()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue