From 607e5c8b9b192d12601e1f19d1c882b95ffbe373 Mon Sep 17 00:00:00 2001 From: Rudi Schlatte Date: Thu, 3 Dec 2020 10:17:28 +0100 Subject: [PATCH 1/2] Clarify docstring of `dashboard-projects-backend` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The project package built into Emacs 27 is too old; refer to Gnu Elpa’s version instead. --- dashboard-widgets.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 0adef402..ae79d444 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -232,13 +232,13 @@ Possible values for list-type are: `recents', `bookmarks', `projects', (defcustom dashboard-projects-backend 'projectile "The package that supplies the list of recent projects. -With the value `projectile', the projects widget uses -projectile (available from MELPA), with `project-el' the widget -uses project.el (built-in since Emacs 27.1). +With the value `projectile', the projects widget uses the package +projectile (available in MELPA). With the value `project-el', +the widget uses the package project (available in GNU ELPA). To activate the projects widget, add e.g. `(projects . 10)' to -`dashboard-items' after making sure either of the above packages -is installed." +`dashboard-items' after making sure the necessary package is +installed." :type '(choice (const :tag "Use projectile" projectile) (const :tag "Use project.el" project-el)) :group 'dashboard) From bcb64b372da990698fe8596ccd252c41b8564c35 Mon Sep 17 00:00:00 2001 From: Rudi Schlatte Date: Thu, 3 Dec 2020 10:18:56 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Present=20project.el=E2=80=99s=20list=20of?= =?UTF-8?q?=20actions=20when=20switching=20to=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Instead of always prompting which file to load, let the user choose from the list of actions that `project-switch-project` uses. --- dashboard-widgets.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index ae79d444..b6d48ead 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -689,8 +689,12 @@ WIDGET-PARAMS are passed to the \"widget-create\" function." (dashboard-get-shortcut 'projects) `(lambda (&rest ignore) (let ((default-directory ,el) - (project-current-inhibit-prompt t)) - (call-interactively 'project-find-file))) + (project-current-inhibit-prompt t) + (choice nil)) + (while (not choice) + (setq choice (assq (read-event (project--keymap-prompt)) + project-switch-commands))) + (call-interactively (nth 2 choice)))) (abbreviate-file-name el))) (t (display-warning '(dashboard)