refactored bootstrap.el

added comments
This commit is contained in:
a. fox 2023-08-01 17:45:05 -04:00
parent 0511aea62f
commit 7241f2b4d1
1 changed files with 15 additions and 8 deletions

View File

@ -1,9 +1,16 @@
(unless (file-exists-p (file-name-concat user-emacs-directory "init" "strapped.el"))
(make-directory (file-name-concat user-emacs-directory "init") 'make-parents)
(require 'org)
(org-babel-tangle-file (file-name-concat
(file-name-directory (file-truename "~/.emacs"))
"config.org"))
(restart-emacs))
(let ((strap-file (file-name-concat user-emacs-directory "init" "strapped.el")))
;; checks for our tangled bootstrap elisp file
;; if it doesnt exist, we create the emacs.d/init directory
;; loads org, tangles our config and finally restarts the editor
(unless (file-exists-p strap-file)
(make-directory (file-name-concat user-emacs-directory "init") 'make-parents)
(require 'org)
(org-babel-tangle-file (file-name-concat
(file-name-directory (file-truename "~/.emacs"))
"config.org"))
(restart-emacs))
(load (file-name-concat user-emacs-directory "init" "strapped.el"))
;; if the file exists, we go ahead and load it.
;; it will automatically tangle the config file
;; and recreate itself as needed
(load strap-file nil 'no-message))