Skip to content

Commit 0e50431

Browse files
committed
More improvements
1 parent 9ddff2b commit 0e50431

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

dashboard-ls.el

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,19 @@ Use this variable when you don't have the `default-directory' up to date.")
4949
(setq dashboard-ls--record-path (or dashboard-ls-path default-directory))
5050
dashboard-ls--record-path)
5151

52+
(defun dashboard-ls--entries (path)
53+
"Return entries from PATH."
54+
(when (file-directory-p path)
55+
(directory-files path nil "^\\([^.]\\|\\.[^.]\\|\\.\\..\\)")))
56+
5257
(defun dashboard-ls--insert-dir (list-size)
5358
"Add the list of LIST-SIZE items from current directory."
5459
(dashboard-insert-section
5560
"Current Directories:"
5661
(let* ((current-dir (dashboard-ls--current-path))
57-
(dir-lst (when (file-directory-p current-dir) (directory-files current-dir nil "^\\([^.]\\|\\.[^.]\\|\\.\\..\\)")))
62+
(entries (dashboard-ls--entries current-dir))
5863
result)
59-
(dolist (dir dir-lst)
64+
(dolist (dir entries)
6065
(when (file-directory-p (expand-file-name dir current-dir))
6166
(setq dir (concat "./" dir))
6267
(push (concat dir "/") result)))
@@ -72,9 +77,9 @@ Use this variable when you don't have the `default-directory' up to date.")
7277
(dashboard-insert-section
7378
"Current Files:"
7479
(let* ((current-dir (dashboard-ls--current-path))
75-
(file-lst (when (file-directory-p current-dir) (directory-files current-dir nil "^\\([^.]\\|\\.[^.]\\|\\.\\..\\)")))
80+
(entries (dashboard-ls--entries current-dir))
7681
result)
77-
(dolist (file file-lst)
82+
(dolist (file entries)
7883
(unless (file-directory-p (expand-file-name file current-dir))
7984
(setq file (concat "./" file))
8085
(push file result)))

0 commit comments

Comments
 (0)