Based on @jagrg answer, I managed to come up with this
(defclass tohiko/helm-source-file-buffers (helm-source-buffers)
((candidate-transformer :initform (lambda (buffers)
(cl-loop for buf in buffers
when (with-current-buffer
buf buffer-file-name)
collect buf))))
)
(defclass tohiko/helm-source-nonfile-buffers (helm-source-buffers)
((candidate-transformer :initform (lambda (buffers)
(cl-loop for buf in buffers
unless (with-current-buffer
buf buffer-file-name)
collect buf))))
)
(setq tohiko/helm-source-file-buffers-list
(helm-make-source "File Buffers" 'tohiko/helm-source-file-buffers))
(setq tohiko/helm-source-nonfile-buffers-list
(helm-make-source "Non-file Buffers" 'tohiko/helm-source-nonfile-buffers))
(setq helm-mini-default-sources '(tohiko/helm-source-file-buffers-list
tohiko/helm-source-nonfile-buffers-list
helm-source-recentf
helm-source-buffer-not-found))
Although I am a beginner, so I am not sure if I am defining the class correctly. Also, I am using helm-make-source
rather than helm-build-in-buffer-source
, as @jagrg suggested, I am not sure what the difference is.
Finally, while this view does show new buffers that are not saved, I haven't figured out how to separate them into their own list.