Skip to content
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
merged 24 commits into from
Apr 23, 2021

Conversation

tarsius
Copy link
Contributor

@tarsius tarsius commented Apr 15, 2021

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.

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.
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.

None yet

2 participants