spacemacs-layout: simplify spacemacs/helm-perspectives

Also reindent some sexps.
This commit is contained in:
syl20bnr 2015-12-09 00:48:58 -05:00
parent 7b931a9f5b
commit eb7ca651fe

View file

@ -51,17 +51,17 @@ perspectives does."
(interactive) (interactive)
(helm (helm
:buffer "*Helm Perspectives*" :buffer "*Helm Perspectives*"
:sources `(,(spacemacs//helm-perspectives-source) :sources
,(helm-build-dummy-source "Create new perspective" `(,(spacemacs//helm-perspectives-source)
:requires-pattern t ,(helm-build-dummy-source "Create new perspective"
:action :requires-pattern t
'(("Create new perspective" . :action
(lambda (name) '(("Create new perspective" .
(let ((persp-reset-windows-on-nil-window-conf t)) (lambda (name)
(if (member name (persp-names-current-frame-fast-ordered)) (let ((persp-reset-windows-on-nil-window-conf t))
(persp-switch name) (persp-switch name)
(persp-switch name) (unless (member name (persp-names-current-frame-fast-ordered))
(spacemacs/home)))))))))) (spacemacs/home))))))))))
;; ability to use helm find files but also adds to current perspective ;; ability to use helm find files but also adds to current perspective
(defun spacemacs/helm-persp-close () (defun spacemacs/helm-persp-close ()
@ -69,15 +69,16 @@ perspectives does."
(interactive) (interactive)
(helm (helm
:buffer "*Helm Kill Perspectives (without killing buffers)*" :buffer "*Helm Kill Perspectives (without killing buffers)*"
:sources (helm-build-in-buffer-source :sources
(concat "Current Perspective: " (spacemacs//current-layout-name)) (helm-build-in-buffer-source
:data (persp-names) (concat "Current Perspective: " (spacemacs//current-layout-name))
:fuzzy-match t :data (persp-names)
:action :fuzzy-match t
'(("Close perspective(s)" . (lambda (candidate) :action
(mapcar '(("Close perspective(s)" . (lambda (candidate)
'persp-kill-without-buffers (mapcar
(helm-marked-candidates)))))))) 'persp-kill-without-buffers
(helm-marked-candidates))))))))
(defun spacemacs/helm-persp-kill () (defun spacemacs/helm-persp-kill ()
"Kills perspectives with all their buffers" "Kills perspectives with all their buffers"