-
Notifications
You must be signed in to change notification settings - Fork 101
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
Separate the major-mode parts from the additional functionality #246
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These variables are or ought to be defined in other libraries that depend on this library. To avoid warnings about these functions not being defined we must wrap them with `bound-and-true-p'. This will also help once we start making it optional to load those other libraries.
A few essential libraries, which provide language features that we (and many others) heavily rely on are not part of Emacs' official "prelude" (in the Rust sense). Instead of trying to explicitly requiring these libraries in each and every of our libraries that used them (and failing to do so), we load them explicitly just once, in "rustic-common", which directly or indirectly is required by all of our other libraries. We extend the prelude with the built-in `cl-lib', `pcase', `seq' and `subr-x', and the third-party `dash'. We are not doing the same for the third-party `s' and `f', which IMO it would be better to not use those at all, so I would rather contain their use to the libraries that unfortunately already use them.
Previously we did it the other way around, which was wrong. To see that what we do now is correct, comment out all the `require' forms at the end of "rustic.el", and observe that no new warnings show up. Then go back one commit, comment the forms, and observe how things blow up.
Split into two groups "language features" and "problem domain" libraries and sort each group alphabetically.
"rustic-common.el" defines an assorted set of things that have to be defined early on. We could merge this library back into "rustic.el" but do not do so to make it easier to compare that with "rust-mode.el". `rustic' requires `rustic-common' and all other libraries depend on the former, whether explicitly or indirectly. Since the existence of `rustic-common' is a bit of an implementation detail, we stop depending on that in all libraries, except in `rustic' itself.
This was referenced Apr 15, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The goal is to eventually remove the forked major-mode and to rely on the external
rust-mode.el
. Some of these commits just make it simpler to compare the two Rust major-mode implementations.See rust-lang/rust-mode#405 for more information and the sibling pull-request rust-lang/rust-mode#406.