From 8b19e35ef653a75e525e14e743f7070a77dfe49f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 28 Jan 2018 20:37:40 -0500 Subject: [PATCH] Consider dired-mode buffers real --- core/autoload/buffers.el | 8 +++++++- modules/ui/doom-dashboard/config.el | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/autoload/buffers.el b/core/autoload/buffers.el index c903849fd..1bbe3cff0 100644 --- a/core/autoload/buffers.el +++ b/core/autoload/buffers.el @@ -1,7 +1,8 @@ ;;; core/autoload/buffers.el -*- lexical-binding: t; -*- ;;;###autoload -(defvar doom-real-buffer-functions '() +(defvar doom-real-buffer-functions + '(doom-dired-buffer-p) "A list of predicate functions run to determine if a buffer is real, unlike `doom-unreal-buffer-functions'. They are passed one argument: the buffer to be tested. @@ -54,6 +55,11 @@ If no project is active, return all buffers." collect buf) buffers))) +;;;###autoload +(defun doom-dired-buffer-p (buf) + "Returns non-nil if BUF is a dired buffer." + (with-current-buffer buf (derived-mode-p 'dired-mode))) + ;;;###autoload (defun doom-special-buffer-p (buf) "Returns non-nil if BUF's name starts and ends with an *." diff --git a/modules/ui/doom-dashboard/config.el b/modules/ui/doom-dashboard/config.el index db2ba5756..618f522d8 100644 --- a/modules/ui/doom-dashboard/config.el +++ b/modules/ui/doom-dashboard/config.el @@ -150,8 +150,7 @@ project (which may be different across perspective)." (defun +doom-dashboard-initial-buffer () "Returns buffer to display on startup. Designed for `initial-buffer-choice'." - (if (or (doom-real-buffer-p) - (derived-mode-p 'dired-mode)) + (if (doom-real-buffer-p) (current-buffer) (doom-fallback-buffer)))