@@ 46,8 46,11 @@
(defun welcome-insert-recent-files ()
"Insert list of recently viewed files."
(insert (propertize "Recently Opened Files" 'face 'bold) "\n")
- (let ((home (getenv "HOME")))
- (dolist (file recentf-list)
+ (let ((home (getenv "HOME"))
+ (file nil))
+ (dotimes (i (min welcome-max-recent-files
+ (length recentf-list)))
+ (setq file (nth i recentf-list))
(insert-text-button
(if (string-prefix-p home file)
(concat "~" (string-remove-prefix home file))
@@ 55,7 58,14 @@
'action `(lambda (_button) (find-file ,file))
'follow-link t
'help-echo `(concat "Click to open " ,file))
- (insert "\n"))))
+ (insert "\n")))
+ (when (< welcome-max-recent-files (length recentf-list))
+ (insert-text-button
+ "See more..."
+ 'action `(lambda (_button) (recentf-open-files))
+ 'follow-link t
+ 'help-echo "Show all recently opened files")
+ (insert "\n\n")))
(defun welcome-screen ()
"Display welcome screen."