From d888686eee635d87a45cb50bae4c115a92afd147 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sat, 3 Jun 2023 12:33:12 +0800 Subject: dashboard: bind 'c' to `dashboard-clear` * dashboard.el (dashboard-mode-map, dashboard-clear): This function runs `ibuffer` and then runs `durand-ibuffer-clear`. Its effect is to clear every buffer and then stays in the dashboard. This can be used as a final key before leaving the computer. --- dashboard.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dashboard.el b/dashboard.el index 5cd4255..b2ddede 100644 --- a/dashboard.el +++ b/dashboard.el @@ -81,7 +81,7 @@ common functionalities more conveniently.") (define-key dashboard-mode-map (vector ?o) #'durand-open-object) (define-key dashboard-mode-map (vector ?g) #'gnus) (define-key dashboard-mode-map (vector ?a) #'dashboard-org-agenda) -(define-key dashboard-mode-map (vector ?c) #'dashboard-org-capture) +(define-key dashboard-mode-map (vector ?c) #'dashboard-clear) ;; load Org if not loaded already @@ -109,6 +109,15 @@ calls `%s' otherwise." (dashboard-preload org-capture "org-conf.el") (dashboard-preload org-store-link "org-conf.el") +;; ibuffer clear + +(defun dashboard-clear () + "Run `durand-ibuffer-clear' while in the dashboard." + (interactive) + (let ((inhibit-message t)) + (ibuffer) + (durand-ibuffer-clear))) + ;;; Modify killing buffers ;;;###autoload -- cgit v1.2.3-18-g5258