Skip to content

Support supplying directories of files in the personal/preload directory #1432

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

levinem
Copy link
Contributor

@levinem levinem commented Mar 25, 2025

Currently the personal/preload directory accepts .el files. This PR allows you to include directories in the personal/preload directory, and all .el files recursively found in those directories will be loaded as well.


Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the user manual (if adding/changing user-visible functionality like modules, commands, configuration options, etc)

Thanks!

@levinem levinem marked this pull request as ready for review March 27, 2025 12:22
@levinem levinem changed the title DRAFT: Support supplying directories of files in the personal/preload directory Support supplying directories of files in the personal/preload directory Mar 27, 2025
@@ -102,6 +102,9 @@ by Prelude.")
(when (file-exists-p prelude-personal-preload-dir)
(message "[Prelude] Loading personal configuration files in %s..." prelude-personal-preload-dir)
(mapc 'load (directory-files prelude-personal-preload-dir 't "^[^#\.].*el$")))
(when (file-directory-p prelude-personal-preload-dir)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just modify the previous block instead of introducing a new one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just modify the previous block instead of introducing a new one?

Do you mean as an or condition with when (file-exists-p? If so, I assumed the mapc command on directory-files could fail if file-exists-p is false but file-directory-p is true. My assumption could definitely be wrong though.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's fair, but you can just use file-directory-p in the previous when, as looking at the code it assumes it's always a directory anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent idea! I updated the previous block based on your suggestion.

levinem added 3 commits March 27, 2025 08:57
Signed-off-by: Michael Levine <[email protected]>
Signed-off-by: Michael Levine <[email protected]>
Copy link

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed soon if no further activity occurs. Thank you for your contribution and understanding!

@github-actions github-actions bot added the stale label Apr 27, 2025
levinem added 3 commits April 29, 2025 08:39
Signed-off-by: Michael Levine <[email protected]>
Signed-off-by: Michael Levine <[email protected]>
Signed-off-by: Michael Levine <[email protected]>
@levinem
Copy link
Contributor Author

levinem commented Apr 29, 2025

There seem to be a lot of linter errors for the CONFIGURATION.md file related to line length unrelated to my changes.

@github-actions github-actions bot removed the stale label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants