From: Don Armstrong Date: Sun, 5 Jan 2025 22:21:26 +0000 (-0800) Subject: Fix install packages to work with newer emacs (and use straight) X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=61329ac97ee89618e55e689f5ba6c691e3348039;p=lib.git Fix install packages to work with newer emacs (and use straight) --- diff --git a/emacs_el/configuration/Makefile b/emacs_el/configuration/Makefile index 5238ae6..2d7606f 100644 --- a/emacs_el/configuration/Makefile +++ b/emacs_el/configuration/Makefile @@ -26,7 +26,7 @@ $(ORG_ELC_FILES): %.elc: %.el install_packages $(EMACS) --batch -q --no-site-file $(LIB_PATH) $(USE_PACKAGE) --eval "(byte-compile-file \"$<\")" $(ORG_EL_FILES): %.el: %.org install_packages - $(EMACS) --batch -q --no-site-file --visit $< --funcall org-babel-tangle + $(EMACS) --batch -q --no-site-file --script install_packages.el --visit $< --funcall org-babel-tangle clean: diff --git a/emacs_el/configuration/install_packages.el b/emacs_el/configuration/install_packages.el index 795fa3f..009ba0f 100644 --- a/emacs_el/configuration/install_packages.el +++ b/emacs_el/configuration/install_packages.el @@ -12,10 +12,23 @@ (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("melpa" . "https://melpa.org/packages/") ("org" . "http://orgmode.org/elpa/") )) -(package-initialize) -(unless (package-installed-p 'use-package) - (package-refresh-contents) - (package-install 'use-package)) -(unless (package-installed-p 'org) - (package-refresh-contents) - (package-install 'org)) + +(defvar bootstrap-version) +(setq straight-base-dir '"~/var/emacs/") +(let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" straight-base-dir)) + (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)) + +(straight-use-package 'use-package) +(setq straight-use-package-by-default t) +(setq use-package-verbose (not (bound-and-true-p byte-compile-current-file))) +(use-package org + )