Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use project-switch-commands for project-el backend of dashboard widget #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions dashboard-widgets.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down