-
Notifications
You must be signed in to change notification settings - Fork 117
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
Consider making Crafted's modules directory fully independent of init.el and early-init.el #251
Comments
This was one thing I hoped to do eventually when I started this project. I'd love to see it happen! |
Awesome! If what I described is an acceptable implementation of this feature, I’d happily work on a PR. I’m gonna need a little advice on how to deal with factoring things out of early-init though. It has some things in it I would have expected to just be in init, so I’m not sure how to proceed there. Does early-init need its own module too? Any suggestions on that part? |
I look forward to seeing your PR! To answer your question, no, The The variable for loading the Path variables, There is currently a way to achieve the goals of this issue without any changes though: a user could have their own configuration in
Then the goal of being able to use the modules independently of Crafted Emacs can be realized. Hope you find that useful! |
Looks like something that could go into the documentation, in a section of
it's own.
Den tors 1 dec. 2022 kl 18:57 skrev Jeff Bowman ***@***.***>:
… I look forward to seeing your PR!
To answer your question, no, early-init.el does not need it's own module
as well. As I'm sure you know, early-init.el is run early in the Emacs
startup process, before things like a full load-path, package system, or
window system are initialized. Settings within early-init.el are there to
allow configuration before init.el, config.el, packages, window system,
etc are realized. The users early-config.el file is the intended location
to override settings in the early-init.el file. Similarly, the users
config.el file is the intended location to override settings in the
init.el file.
The guix related code you refer to is probably there to allow for users
who use that system to have guix provide the packages desired rather than
pulling them from a package repository (GNU Elpa et. al) or from version
control (when using straight.el).
The variable for loading the custom.el file is there to allow it to be
overridden before the init.el (and the users config.el) are loaded.
Path variables, crafted-config-path, crafted-config-var-directory, and
crafted-config-etc-directory are intended to create a structure for users
to put files in their own config, managed by their own version control, but
which provide a *Crafted Emacs* opinionated view, thus configuration
within the modules/ folder depend on these being set to move things out
of the user-emacs-directory as an attempt to avoid littering there, and
to keep things "in one place" for the user to find more easily. The
crafted-config-path has to be set in the early-init.el file because it
has to be able to find and load the users early-config.el file.
Eventually, the config.el file and custom.el file are loaded from this
path also.
There is currently a way to achieve the goals of this issue without any
changes though: a user could have their own configuration in .emacs.d or
.config/emacs with their own early-init.el and init.el and have *Crafted
Emacs* checked out on the side somewhere. To use the modules from *Crafted
Emacs* independently, the following things need to be done (I would
suggest this is probably best handled in the users early-init.el file,
but could be in the users init.el file or whatever custom file they
choose as long as it is loaded before any crafted-* modules):
1. Set the crafted-config-path appropriately, possibly with (setq
crafted-config-path 'user-emacs-directory), and then set the
crafted-config-var-directory and crafted-config-etc-directory from
that or override as seems appropriate.
2. Override the macros crafted-package-install-package and
crafted-package-installed-p (examples in the bootstrap/ folder).
3. Add the path/to/crafted-emacs/modules to the load-path
Then the goal of being able to use the modules independently of *Crafted
Emacs* can be realized.
Hope you find that useful!
—
Reply to this email directly, view it on GitHub
<#251 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABUBJAHFZKF4FHQOSOWV2DWLDRHHANCNFSM6AAAAAASP7MWEA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
There are definitely places where crafted-emacs assumes it's in
It's also unfortunate that |
Yes, of course, if you look at the code, we assume the user followed the read me, cloned the repo and is running Emacs with the cloned code in the A new variable
Thank you for voicing your opinion. My opinion is the choice of name is appropriate for the intended use. I do make an effort to please as many as possible with the updates and changes and initial decisions on this project, however, it's impossible to please everyone. |
I meant no offense - perhaps I wasn't clear. I was actually looking for your input on what your preference was for an environment variable name for this new |
None taken. :-)
If your intention is to be able to use the modules independently of Crafted Emacs, perhaps a Assume this snippet in Then in Then in appropriate modules (for example the
Does this help? |
So if I understand this correctly, if one want to use Crafted-emacs modules, they can as easy be placed in Emacs load path. Except for But are crafted-compile that useful outside of Crafted-emacs? |
Pretty much. There are a couple of variables that need to be set and a couple of macro definitions, but basically that's the idea.
That one specifically may not be as useful outside of Crafted Emacs, at least not in it's current form. With Emacs 29 possibly bringing native compilation as the default, that module may have less of a future than when it was originally written. |
Teeing off @jeffbowman's comment earlier, using a Crafted module from my own
The reason was much as expressed above. I had a pretty involved |
This will close when I release the next version of crafted-emacs. See my blog for what is happening: |
Closing in anticipation of Crafted Emacs v2, which (should) resolve this issue. |
Crafted Emacs assumes that you'll use it as your primary emacs.d, but as a user grows in their Emacs acumen it would be really beneficial for them to be able to use crafted-emacs modules independently, rather than the whole project. That would mean users could have control of their own emacs.d, and have crafted-emacs located somewhere else (submodule, subdirectory, etc).
In order to do this, anything in the modules directory shouldn't assume that Crafted's init.el is run. Things like
defvar
anddefconst
statements in Crafted's init.el could be separated out into tomodules/crafted-init.el
, and then the user could have their own init.el and early-init.el. Of course, then they would need to add a statement like this to their owninit.el
:In order for this to not be a breaking change, Crafted's init.el would
(require crafted-init)
. Things like gc settings would remain in Crafted's init.el, as well as anything that else that isn't a pre-req for a module to work. A user could then truly customize their own Emacs experience and this would allow Crafted to continue to grow with a user as they get more experience with Emacs, which seems well aligned with this project's stated goals.The text was updated successfully, but these errors were encountered: