From ff0b45299e63dcc24d51c201201faaa4821d3c8b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 18 Mar 2018 15:17:40 -0400 Subject: [PATCH] Refactor dashboard autoload functions --- modules/ui/doom-dashboard/autoload.el | 27 --------------------------- modules/ui/doom-dashboard/config.el | 12 ++++-------- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/modules/ui/doom-dashboard/autoload.el b/modules/ui/doom-dashboard/autoload.el index f9c8d3b38..9663671fc 100644 --- a/modules/ui/doom-dashboard/autoload.el +++ b/modules/ui/doom-dashboard/autoload.el @@ -7,30 +7,3 @@ (with-selected-frame frame (switch-to-buffer (doom-fallback-buffer)) (+doom-dashboard-reload))) - -;;;###autoload -(defun +doom-dashboard/next-button () - "Jump to the next button after cursor." - (interactive) - (ignore-errors (goto-char (next-button (point))))) - -;;;###autoload -(defun +doom-dashboard/previous-button () - "Jump to the previous button after cursor." - (interactive) - (ignore-errors (goto-char (previous-button (point))))) - -;;;###autoload -(defun +doom-dashboard/first-button () - "Jump to the first button on the dashboard." - (interactive) - (goto-char (point-min)) - (+doom-dashboard/next-button)) - -;;;###autoload -(defun +doom-dashboard/last-button () - "Jump to the last button on the dashboard." - (interactive) - (goto-char (point-max)) - (+doom-dashboard/previous-button) - (beginning-of-line-text)) diff --git a/modules/ui/doom-dashboard/config.el b/modules/ui/doom-dashboard/config.el index 11634f68d..f469ebc89 100644 --- a/modules/ui/doom-dashboard/config.el +++ b/modules/ui/doom-dashboard/config.el @@ -69,15 +69,11 @@ Possible values: (add-hook 'post-command-hook #'+doom-dashboard|reposition-point nil t)) (map! :map +doom-dashboard-mode-map - "n" #'+doom-dashboard/next-button - "p" #'+doom-dashboard/previous-button - "N" #'+doom-dashboard/last-button - "P" #'+doom-dashboard/first-button + "n" #'forward-button + "p" #'backward-button (:when (featurep! :feature evil) - :m "j" #'+doom-dashboard/next-button - :m "k" #'+doom-dashboard/previous-button - :m "gg" #'+doom-dashboard/first-button - :m "G" #'+doom-dashboard/last-button + :m "j" #'forward-button + :m "k" #'backward-button [remap evil-delete] #'ignore [remap evil-delete-line] #'ignore