core/autoload/buffers: remove workgroups2 references in doom-buffer-list + refactor

This commit is contained in:
Henrik Lissner 2017-02-24 03:08:48 -05:00
parent 97a7194c36
commit f8a634b3f9

View file

@ -61,21 +61,15 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
If PROJECT-P is non-nil, get all buffers associated with the current project in If PROJECT-P is non-nil, get all buffers associated with the current project in
the current workspace." the current workspace."
(let* ((buffers (cond ((and (featurep 'workgroups2) workgroups-mode) (let ((buffers (if (and (featurep 'persp-mode) persp-mode)
(wg-workgroup-associated-buffers nil)) (persp-buffer-list-restricted)
((and (featurep 'persp-mode) persp-mode) (buffer-list)))
(persp-buffer-list-restricted)) (project-root (and project-p (doom-project-root t))))
(t (buffer-list)))) (if project-root
(project-root (and project-p (doom-project-root t)))
(buffer-list (if project-root
(funcall (if (eq project-p 'not) 'cl-remove-if 'cl-remove-if-not) (funcall (if (eq project-p 'not) 'cl-remove-if 'cl-remove-if-not)
(lambda (b) (projectile-project-buffer-p b project-root)) (lambda (b) (projectile-project-buffer-p b project-root))
buffers) buffers)
buffers)) buffers)))
(fallback-buffer (doom-fallback-buffer)))
(unless (memq fallback-buffer buffer-list)
(nconc buffer-list (list (doom-fallback-buffer))))
buffer-list))
;;;###autoload ;;;###autoload
(defun doom-real-buffers-list (&optional buffer-list) (defun doom-real-buffers-list (&optional buffer-list)