From 879222ed6a8bc8cf2ff6944f45c0d1dab57804a4 Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Sat, 6 Mar 2021 09:00:18 -0500 Subject: [PATCH] Add startup code --- bin/packages.el | 31 +++++++++++++++++++++++++++++++ bin/startup.el | 17 +++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 bin/packages.el create mode 100644 bin/startup.el diff --git a/bin/packages.el b/bin/packages.el new file mode 100644 index 0000000..fb8d587 --- /dev/null +++ b/bin/packages.el @@ -0,0 +1,31 @@ +;; Download and instll packages using https://github.com/raxod502/straight.el +;; It's a functional package manager that integrates with https://github.com/jwiegley/use-package + +;; + Use the development branch +;; + Integrate with use-package + +;; Apply the configurations prior to bootstrapping the package manager. + +(setq straight-repository-branch "develop" + straight-use-package-by-default t) + +;; Bootstrap the package manager. +;; Download, Install, or Configuring depending on the state of the configuration. +;; All packages build from source, pinned to specific git commit hashes. + +(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)) + +;; Integrate with use-package by installing it with straight. + +(straight-use-package 'use-package) diff --git a/bin/startup.el b/bin/startup.el new file mode 100644 index 0000000..0d5ee2e --- /dev/null +++ b/bin/startup.el @@ -0,0 +1,17 @@ +;; Emacs creates a lot of files relative to `user-emacs-directory'. +;; These files are not part of this immutable configuration and do not belong in the emacs directory. + +;; How can we solve this issue? + +;; Shortly after initialization, before most packages load, we change the value to `dotfiles/cache'. +;; I elaborate more on the technique in my post https://chrishayward.xyz/immutable-emacs/. + +(setq user-emacs-directory dotfiles/cache) + +;; Because this project uses version-control, we can disable more unwanted features: + +;; + Lock files +;; + Backup files + +(setq create-lockfiles nil + make-backup-files nil)