Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

How can I pin a specific project to the list of recent projects?

You must be logged in to vote

Will I be able to modify this variable in my init.el?

Yes, you can. I use project.el (not projectile) so I will use this backend as the example:

project-known-project-roots (L1206) is the function that returns a list of project roots. Let's see the function's definition:

(defun project-known-project-roots ()
  "Return the list of root directories of all known projects."
  (project--ensure-read-project-list)
  (mapcar #'car project--list))  ; See `project--list`, this is the variable you want to modify!

Try to print the variable, and see what's the value:

(message "%s" project--list)  ; Returns -> (("path/to/project1") ("path/to/project2"))

Now, all you need to do is to sort this variabl…

Replies: 4 comments · 2 replies

Comment options

No, there is no such a feature. However, you can organize the project list yourself so targeted projects are always on top on the list.

Hope that helps! ;)

You must be logged in to vote
0 replies
Comment options

However, you can organize the project list yourself so targeted projects are always on top on the list.

Could you please point me to the relevant part of the documentation for that?

You must be logged in to vote
1 reply
@jcs090218
Comment options

See this part of code:

https://github.com/emacs-dashboard/emacs-dashboard/blob/34a0076f01a729b4aae16947fa0d0e130cafedfd/dashboard-widgets.el#L1195C8-L1210

There is a variable (whether you use project.el or projectile) that stores the project roots for you. All you need to do is to sort that variable in the order you want.

Comment options

There is a variable

My ELisp is rusty. Could you please point to a specific line in that function?
Will I be able to modify this variable in my init.el?

All you need to do is to sort that variable in the order you want.

Sort? Why sort? Would it be possible to add to the top (or the end) of the list of projects?

You must be logged in to vote
0 replies
Comment options

Will I be able to modify this variable in my init.el?

Yes, you can. I use project.el (not projectile) so I will use this backend as the example:

project-known-project-roots (L1206) is the function that returns a list of project roots. Let's see the function's definition:

(defun project-known-project-roots ()
  "Return the list of root directories of all known projects."
  (project--ensure-read-project-list)
  (mapcar #'car project--list))  ; See `project--list`, this is the variable you want to modify!

Try to print the variable, and see what's the value:

(message "%s" project--list)  ; Returns -> (("path/to/project1") ("path/to/project2"))

Now, all you need to do is to sort this variable in the correct order.

Sort? Why sort? Would it be possible to add to the top (or the end) of the list of projects?

You could but you might have duplicated items in the list. 🤔

Here is the documentation about the sorting functions, see https://www.gnu.org/software/emacs/manual/html_node/eintr/Sorting.html.

You must be logged in to vote
1 reply
@refaelsh
Comment options

Thank you very much. I think I understand.

Answer selected by refaelsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.