Comments (7)
I will try by providing an modules/crafted-early-init-straight-config.el which contains the straight bootstrap and an updated info node refering to it.
Would prefer this be an example rather than a module as we officially only support package.el
, and adding this as a module would imply we officially support straight.el
as well. We'll take a look at the info documentation on using different package managers in this context and see what can be updated so it is more clear how to approach using other package managers than package.el
.
from crafted-emacs.
Thanks for examples!
This is close. The bootstrap
folder is deprecated and should not be used with Crafted Emacs V2. Instead you should use the modules/crafted-package-config.el
module which has similar properties.
Thus:
(load (expand-file-name "modules/crafted-package-config" crafted-emacs-home))
The rest looks good to me. with some caveats, which are mentioned below.
Regarding the documentation, would you be willing to submit a PR to update the documentation? (cc: @jvdydev )
Just as a positional statement on package managers, we only "officially" support package.el
, but we recognize other package managers exist and users may prefer them over package.el
. So we prefer to enable the user to provide their own configuration for handling packages. The reason for the separation between the *-packages
and *-config
modules is to facilitate this kind of configuration. Your example is sufficient as far as I can tell, however, it does appear to be missing the straight.el bootstrapping/installation code. Assuming that is provided somewhere near the top of your early-init.el
file, I think this should work out of the box. Other package managers (borg, leaf, quelpa, etc) might need to have different configurations but, conceptually at least, those would be the "same" as straight.el.
Hope this helps answer your question(s), and I appreciate you raising the issue!
(Yes, the prior version of Crafted Emacs provided the appropriate code to initialize/setup/install straight.el, however as that code will be removed "soon" and as it makes several assumptions we no longer follow, that code will need to be provided explicitly by the user. The way your example is written would be sufficient if we intended to keep that code moving forward.)
from crafted-emacs.
Instead you should use the
modules/crafted-package-config.el
module which has similar properties.
OK. It worked without the bootstrap dependend code. I only had to put the straight bootstrapping in early-init.
Regarding the documentation, would you be willing to submit a PR to update the documentation? (cc: @jvdydev )
I will try by providing an modules/crafted-early-init-straight-config.el
which contains the straight bootstrap and an updated info node refering to it.
from crafted-emacs.
Here is my current version located in the modules directory:
;;; Commentary:
;; Code to bootstrap straight package manager
;;
;; Should be loaded in early-init like this:
;; (setq crafted-emacs-home "~/crafted-emacs")
;; (load (expand-file-name "modules/crafted-early-init-straight-config" crafted-emacs-home))
;;; Code:
(load (expand-file-name "modules/crafted-package-config" crafted-emacs-home))
;; See https://github.com/radian-software/straight.el#getting-started
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;; Configure crafted-emacs to use straight as package manager.
;; See `(info "(crafted-emacs)Using alternate package managers")'
(setq crafted-package-system 'straight)
(setq crafted-package-installer #'straight-use-package)
(setq crafted-package-installed-predicate #'straight--installed-p)
(provide 'crafted-early-init-straight-config)
;;; crafted-early-init-straight-config.el ends here
Shall I move it to the examples
folder and refer to it in the docs? My personal use would be to put it in my custom-modules
folder.
By the way: The v1 version did use crafted-config-path
instead of user-emacs-directory
and configured straight-base-dir
to point to it. I guess crafted-config-path
is no longer needed in v2, so I omited it to be closer to the straight defaults. Am I right?
from crafted-emacs.
Shall I move it to the examples folder and refer to it in the docs?
Yes, please.
My personal use would be to put it in my custom-modules folder.
This would be a good approach. Keeping in mind, your configuration is yours wholly, you could just use this directly as your own version of the early-init.el
file without actually needing to load it from your own custom-modules
folder. Completely up to you though.
By the way: The v1 version did use crafted-config-path instead of user-emacs-directory and configured straight-base-dir to point to it. I guess crafted-config-path is no longer needed in v2, so I omited it to be closer to the straight defaults. Am I right?
Yes, that is correct. For v1, we kept those separate to avoid conflicts when Crafted Emacs was updated compared to when your updated your own personal configuration. With v2, we are assuming the user-emacs-directory
is where you want to do all of your configuration, it simplifies how Crafted Emacs works, and then we just need to add the modules
to the load-path
in Emacs (which we do from the crafted-init-config.el
file). The early-init.el
file we leave to the user to configure to give the most flexibility for configuring package managers and UI elements (and anything else that can take advantage of being loaded or configured early in the Emacs startup process). Since we are no longer redirecting where the user configuration lives, we no longer need the crafted-config-path
and other derived path variables (ala the etc
and var
versions of that path).
from crafted-emacs.
we no longer need the
crafted-config-path
and other derived path variables (ala theetc
andvar
versions of that path).
Did you notice my question #316 asking whether crafted-defaults--sensible-path
was used to define etc
and var
directories. Do you plan something similar again in v2? Perhaps you could comment on this in #316.
from crafted-emacs.
Thanks for pointing it out, I had not noticed. Answered there.
from crafted-emacs.
Related Issues (20)
- [craftedv2beta] Broken configuration guards (Tracking Issue) HOT 4
- Provide option for easier module loading. HOT 7
- [craftedv2beta] Use `customize-save-variable` vs. `customize-set-variable`? HOT 11
- [craftedv2beta] Question regarding the skeleton for new modules HOT 5
- Discussion: When do our own `defcustom` variables make sense? When are they best avoided? HOT 6
- [craftedv2beta] Evil bindings in crafted-speedbar are duplicate and inconsistent with evil-collection HOT 3
- [craftedv2beta] Standardized way for naming functions HOT 5
- [craftedv2beta] Unused function `crafted-completion/minibuffer-backward-kill` HOT 2
- texinfo tags in doc headings don't seem to be needed HOT 3
- [v2] Emacs 29+ check for executable prevents Treesitter setup HOT 12
- [v2] No easy way to opt out of tree sitter parsers HOT 5
- [v2] Corfu + Eglot have unsuitable performance for medium/large projects HOT 4
- [v2] defgroup crafted-startup not functioning properly
- [v2]package-selected-packages "Combobulate" problem. HOT 3
- Automating regeneration of Info file HOT 13
- Suggestion: Make examples loadable HOT 3
- Symbol's function definition is void: treesit-auto-add-to-auto-mode-alist HOT 3
- `crafted-init-config` automatically finding directory possibly confounded by submodule use HOT 9
- Eglot doesn't automatically load when a relevant mode is visited until explicitly required HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crafted-emacs.