From 2ee9b53b53eb1bd86f55f3bbe207cf27659c86c4 Mon Sep 17 00:00:00 2001 From: Jason Dufair Date: Fri, 1 Mar 2019 08:55:20 -0500 Subject: [PATCH] Indicate when a section has no items --- dashboard-widgets.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 5e116806..235f07a2 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -273,12 +273,14 @@ ACTION is theaction taken when the user activates the widget button. WIDGET-PARAMS are passed to the \"widget-create\" function." `(progn (dashboard-insert-heading ,section-name) - (when (dashboard-insert-section-list - ,section-name - (dashboard-subseq ,list 0 list-size) - ,action - ,@widget-params) - (dashboard-insert-shortcut ,shortcut ,section-name)))) + (if ,list + (when (dashboard-insert-section-list + ,section-name + (dashboard-subseq ,list 0 list-size) + ,action + ,@widget-params) + (dashboard-insert-shortcut ,shortcut ,section-name)) + (insert "\n --- No items ---")))) ;; ;; Recentf @@ -398,7 +400,7 @@ date part is considered." (dashboard-insert-section (or (and (boundp 'show-week-agenda-p) show-week-agenda-p "Agenda for the coming week:") "Agenda for today:") - (or agenda '()) + agenda list-size "a" `(lambda (&rest ignore) @@ -406,9 +408,7 @@ date part is considered." (with-current-buffer buffer (goto-char (nth 3 ',el))) (switch-to-buffer buffer))) - (format "%s" (nth 0 el))) - (and (not agenda) - (insert "\n --- No items ---")))) + (format "%s" (nth 0 el))))) ;; ;; Registers