THE BASICS OF THE STRAIGHT PACKAGE MANAGER

[2022-12-27 Tue]

Watch the Video Here

Official Page

Why Straight?

With Straight one can:

M-x Straight-use-package

https://github.com/raxod502/straight.el#version-control-operations

Note:
-—

(defvar bootstrap-version) ;; Straight
(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))

Set these customisations:


set straight-repository-branch "develop"

set package-enable-at-startup nil – if you run Emacs 27 or above

Make sure you remove:

How to install packages with Straight


(straight-use-package 'lorem-ipsum)

How to get Straight to work with use-package


(straight-use-package 'use-package)

NOTE: do not use :ensure t syntax (which is for package.el) but :straight t

NOTE: Specifying :straight t in use-package syntax is not necessary if you set straight-use-package-by-default to t.

(use-package org-roam
 :straight t
 :after org
 :hook
     (after-init . org-roam-mode)
 :bind (("C-h /" . org-roam-find-file)
       ([f8] . org-roam-find-file)
       ("C-c i" . 'org-roam-insert)
       ("C-c o" . 'org-roam-find-directory))
     :config
     (setq org-roam-db-update-method 'immediate)
     (setq org-roam-completion-system 'default)
     (setq org-roam-dailies-directory "~/org-roam/daily"))

You can disable use-package integration entirely by customising straight-enable-use-package-integration.

Where you packages are stored

The local repositories are kept in ~/.emacs.d/straight/repos

The built packages are kept in ~/.emacs.d/straight/build

How do I uninstall a package?

Under package.el, every package on disk gets loaded into Emacs, whether you asked for it or not. Under straight.el, only the packages you explicitly mention in your init-file get loaded into Emacs.

Return to Home