Fix narf/get-buffers in no-workgroup sessions

This commit is contained in:
Henrik Lissner 2016-04-13 23:20:42 -04:00
parent 6c429680e9
commit c64bd4a666

View file

@ -42,11 +42,13 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
If PROJECT-P is non-nil, get all buffers in current workgroup
If both are non-nil, get all project buffers across all workgroups"
(let* ((assocbuf (wg-workgroup-associated-buffers nil))
(buffers (--filter (memq it assocbuf) (buffer-list)))
(buffers (if (wg-current-workgroup t)
(--filter (memq it assocbuf) (buffer-list))
(buffer-list)))
project-root)
(if (and project-p (setq project-root (narf/project-root t)))
(aif (and project-p (narf/project-root t))
(funcall (if (eq project-p 'not) '-remove '-filter)
(lambda (b) (projectile-project-buffer-p b project-root))
(lambda (b) (projectile-project-buffer-p b it))
buffers)
buffers)))