From 56a5d88324a3d10b8ba52d673f58fc43b01b1b89 Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Wed, 14 Feb 2024 02:54:01 +0000
Subject: [PATCH] Move to straight for packages, with easy reversion to package.el

---
 init.el |   40 +++++++++++++++-------------------------
 1 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/init.el b/init.el
index f911bd8..cd71472 100644
--- a/init.el
+++ b/init.el
@@ -2,37 +2,27 @@
 (setq custom-file "~/.emacs.d/custom.el")
 (load custom-file 'noerror)
 
-;; Repos
-(require 'package)
-(setq package-archives '(("gnu"   . "https://elpa.gnu.org/packages/")
-			             ("nongnu"  . "https://elpa.nongnu.org/nongnu/")
-			             ("melpa" . "https://melpa.org/packages/")))
-(package-initialize)
-
-;; use-package
-(unless (package-installed-p 'use-package)
-  (package-refresh-contents)
-  (package-install 'use-package))
-(setq package-install-upgrade-built-in t)
-
-(eval-when-compile
-  (require 'use-package))
-(require 'use-package-ensure)
-(setq use-package-always-ensure t)
+;; Load package manager
+(setq package-manager 'straight)
+(load "~/.emacs.d/package-manager.el" `noerror)
 
 ;; auto-package-update
-(use-package auto-package-update
-  :ensure t
-  :config
-  (setq auto-package-update-delete-old-versions t)
-  (setq auto-package-update-hide-results t)
-  (setq auto-package-update-interval 7)
-  (setq auto-package-update-at-time "03:00")
-  (auto-package-update-maybe))
+(when (eq package-manager 'package)
+  (use-package auto-package-update
+    :ensure t
+    :config
+    (setq auto-package-update-delete-old-versions t)
+    (setq auto-package-update-hide-results t)
+    (setq auto-package-update-interval 7)
+    (setq auto-package-update-at-time "03:00")
+    (auto-package-update-maybe)))
 
 ;; diminish
 (use-package diminish)
 
+;; org-mode
+(use-package org)
+
 ;; redirect to org config file
 (when (file-readable-p "~/.emacs.d/config.org")
   (org-babel-load-file "~/.emacs.d/config.org"))

--
Gitblit v1.9.3