Giter Site home page Giter Site logo

Comments (7)

jeffbowman avatar jeffbowman commented on August 20, 2024 1

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.

jeffbowman avatar jeffbowman commented on August 20, 2024

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.

monora avatar monora commented on August 20, 2024

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.

monora avatar monora commented on August 20, 2024

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.

jeffbowman avatar jeffbowman commented on August 20, 2024

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.

monora avatar monora commented on August 20, 2024

we no longer need the crafted-config-path and other derived path variables (ala the etc and var 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.

jeffbowman avatar jeffbowman commented on August 20, 2024

Thanks for pointing it out, I had not noticed. Answered there.

from crafted-emacs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.