ui/workspaces: minor refactors
This commit is contained in:
parent
1ab8dac872
commit
fc511ed701
1 changed files with 4 additions and 6 deletions
|
@ -68,6 +68,8 @@ error if NAME doesn't exist."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +workspace-list ()
|
(defun +workspace-list ()
|
||||||
"Return a list of workspace structs (satisifes `+workspace-p')."
|
"Return a list of workspace structs (satisifes `+workspace-p')."
|
||||||
|
;; We don't use `hash-table-values' because it doesn't ensure order in older
|
||||||
|
;; versions of Emacs
|
||||||
(cdr (cl-loop for persp being the hash-values of *persp-hash*
|
(cdr (cl-loop for persp being the hash-values of *persp-hash*
|
||||||
collect persp)))
|
collect persp)))
|
||||||
|
|
||||||
|
@ -87,9 +89,7 @@ PERSP can be a string (name of a workspace) or a workspace (satisfies
|
||||||
(let ((persp (or persp (+workspace-current))))
|
(let ((persp (or persp (+workspace-current))))
|
||||||
(unless (+workspace-p persp)
|
(unless (+workspace-p persp)
|
||||||
(user-error "Not in a valid workspace (%s)" persp))
|
(user-error "Not in a valid workspace (%s)" persp))
|
||||||
(cl-loop for buf in (buffer-list)
|
(persp-buffers persp)))
|
||||||
if (+workspace-contains-buffer-p buf persp)
|
|
||||||
collect buf)))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +workspace-orphaned-buffer-list ()
|
(defun +workspace-orphaned-buffer-list ()
|
||||||
|
@ -380,7 +380,7 @@ the next."
|
||||||
(delete-frame)
|
(delete-frame)
|
||||||
(+workspace/delete current-persp-name))))
|
(+workspace/delete current-persp-name))))
|
||||||
|
|
||||||
(t (+workspace-error "Can't delete last workspace" t)))))))
|
((+workspace-error "Can't delete last workspace" t)))))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -500,8 +500,6 @@ This be hooked to `projectile-after-switch-project-hook'."
|
||||||
(+workspace-new project-name))))
|
(+workspace-new project-name))))
|
||||||
(new-name (persp-name persp)))
|
(new-name (persp-name persp)))
|
||||||
(+workspace-switch new-name)
|
(+workspace-switch new-name)
|
||||||
(unless persp-p
|
|
||||||
(switch-to-buffer (doom-fallback-buffer)))
|
|
||||||
(with-current-buffer (doom-fallback-buffer)
|
(with-current-buffer (doom-fallback-buffer)
|
||||||
(setq default-directory +workspaces--project-dir))
|
(setq default-directory +workspaces--project-dir))
|
||||||
(unless current-prefix-arg
|
(unless current-prefix-arg
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue