tweak: consistent order for profile init functions #8180
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Doom embeds the partials generated by functions on
doom-profile-generators
in lexicographical order by filename, but after recent refactoring all these partials generally do is define a function which Doom calls fromdoom-startup
. When Doom generatesdoom-startup
, it inserts these calls indoom-profile-generators
order.This does not affect Doom itself, since it initializes
doom-profile-generators
in a sensible order. But any additional entries pushed ontodoom-profile-generators
run first, which is surprising (and might break them if they depend on loaddefs or modules having initialized).Fix it by sorting the list. Do so up front just for simplicity: although the order in which we generate the partials is unlikely to matter, if we have to sort the list we might as well use the sorted one throughout.
Amend: b3aa41f
(I'm guessing barely anyone outside Doom uses
doom-profile-generators
, but figured I'd send this your way just in case, as I doubt this behavior was intended and it seemed easy enough to fix...)