plexus / chemacs2

Emacs version switcher, improved
777 stars 46 forks source link

Straight package integration with `straight-p` and some suggested enhancemment options. #24

Open hongyi-zhao opened 3 years ago

hongyi-zhao commented 3 years ago

I noticed the following description of the straight-p option here:

straight-p Enable the Straight functional package manager.

But I still don't know how to use this option in the configuration file, i.e., ~/.emacs-profiles.el. OTOH, I noticed the function definition corresponding to the configuration option of straight-p. I suggest change this function into the following for adding the use-package integration:

(defun chemacs-load-straight ()
  (defvar bootstrap-version)
  (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
        (bootstrap-version 5))
    (unless (file-exists-p bootstrap-file)
      (with-current-buffer
          (url-retrieve-synchronously
           "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
           'silent 'inhibit-cookies)
        (goto-char (point-max))
        (eval-print-last-sexp)))
    (load bootstrap-file nil 'nomessage))
   (straight-use-package 'use-package)
(setq straight-use-package-by-default t))

Regards, HY

koddo commented 3 years ago

As far as I understand, it's just a regular way to initialize the straight package manager, it can be found in its documentation. You can either use the straight-p option to cut this part from your own .emacs.d, or ignore this option altogether.