move layouts: minor refactor
This commit is contained in:
parent
cb8b577fe1
commit
cc1970ce44
|
@ -189,7 +189,7 @@ ask the user if a new layout should be created."
|
||||||
(spacemacs/layouts-transient-state/body))
|
(spacemacs/layouts-transient-state/body))
|
||||||
|
|
||||||
(defun spacemacs/move-element-left (element list)
|
(defun spacemacs/move-element-left (element list)
|
||||||
"Moves the ELEMENT one step to the left in LIST"
|
"Move ELEMENT one step to the left in LIST."
|
||||||
(let (value)
|
(let (value)
|
||||||
(dolist (name list value)
|
(dolist (name list value)
|
||||||
(if (and (equal name element) (car value))
|
(if (and (equal name element) (car value))
|
||||||
|
@ -197,13 +197,16 @@ ask the user if a new layout should be created."
|
||||||
(setq value (cons name value))))
|
(setq value (cons name value))))
|
||||||
(nreverse value)))
|
(nreverse value)))
|
||||||
|
|
||||||
|
(defun spacemacs/move-element-right (element list)
|
||||||
|
"Move ELEMENT one step to the right in LIST."
|
||||||
|
(nreverse (spacemacs/move-element-left element (reverse list))))
|
||||||
|
|
||||||
(defun spacemacs/move-current-persp-right ()
|
(defun spacemacs/move-current-persp-right ()
|
||||||
"Moves the current perspective one step to the right"
|
"Moves the current perspective one step to the right"
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq persp-names-cache
|
(setq persp-names-cache (spacemacs/move-element-right
|
||||||
(reverse (spacemacs/move-element-left
|
(spacemacs//current-layout-name)
|
||||||
(spacemacs//current-layout-name)
|
persp-names-cache)))
|
||||||
(reverse persp-names-cache)))))
|
|
||||||
|
|
||||||
(defun spacemacs/move-current-persp-left ()
|
(defun spacemacs/move-current-persp-left ()
|
||||||
"Moves the current perspective one step to the left"
|
"Moves the current perspective one step to the left"
|
||||||
|
|
Loading…
Reference in a new issue