From 3c4ea48b63bae50ee22045dd72f1df37cdf9211a Mon Sep 17 00:00:00 2001 From: jenchieh Date: Fri, 28 Jun 2019 22:20:55 +0800 Subject: [PATCH] Try fixing issue 164. --- dashboard.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dashboard.el b/dashboard.el index ecac01d4..044b61ce 100644 --- a/dashboard.el +++ b/dashboard.el @@ -20,7 +20,6 @@ ;;; Code: -(require 'seq) (require 'page-break-lines) (require 'recentf) @@ -145,7 +144,8 @@ Optional prefix ARG says how many lines to move; default is one line." (recentf-is-on (recentf-enabled-p)) (origial-recentf-list recentf-list) (dashboard-num-recents (or (cdr (assoc 'recents dashboard-items)) 0)) - (max-line-length 0)) + (max-line-length 0) + (recentf-items '())) ;; disable recentf mode, ;; so we don't flood the recent files list with org mode files ;; do this by making a copy of the part of the list we'll use @@ -153,8 +153,12 @@ Optional prefix ARG says how many lines to move; default is one line." ;; then restore the orginal list afterwards ;; (this avoids many saves/loads that would result from ;; disabling/enabling recentf-mode) - (if recentf-is-on - (setq recentf-list (seq-take recentf-list dashboard-num-recents))) + (when recentf-is-on + (let ((item-count 0)) + (while (< item-count dashboard-num-recents) + (push (nth item-count recentf-list) recentf-items) + (setq item-count (1+ item-count)))) + (setq recentf-list (reverse recentf-items))) (when (or (not (eq dashboard-buffer-last-width (window-width))) (not buffer-exists)) (setq dashboard-banner-length (window-width)