hamacs/bootstrap.org
Howard Abrams 513f2f06de Let's go ... first commit after a major refactor
Why yes, this will look like it sprung, like Athena, fully grown and
in armor from my head, but this is really just the mid-point of a new
endeavor.
2021-11-02 12:09:41 -07:00

126 lines
4.8 KiB
Org Mode

#+TITLE: My Emacs Bootstrap
#+AUTHOR: Howard X. Abrams
#+EMAIL: howard.abrams@gmail.com
#+DATE: 2021-10-08
#+FILETAGS: :emacs:
A literate programming file for bootstraping my Emacs Configuration.
#+BEGIN_SRC emacs-lisp :exports none
;;; bootstrap.el --- file for bootstraping my Emacs Configuration
;;
;; Copyright (C) 2021 Howard X. Abrams
;;
;; Author: Howard X. Abrams <http://gitlab.com/howardabrams>
;; Maintainer: Howard X. Abrams <howard.abrams@gmail.com>
;; Created: October 8, 2021
;;
;; This file is not part of GNU Emacs.
;;
;; *NB:* Do not edit this file. Instead, edit the original literate file at:
;; /Users/howard.abrams/other/hamacs/bootstrap.org
;; And tangle the file to recreate this one.
;;
;;; Code:
#+END_SRC
* Introduction
This file contains all the variable definitions and library loading for the other files in my project.
** Straight Package Installer
I'm going to be installing everything using the [[https://github.com/raxod502/straight.el#getting-started][straight.el]] for package installation and management. Here is the initialization/installation for it:
#+BEGIN_SRC emacs-lisp
(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))
#+END_SRC
Let's get the Straight project working with =use-package=:
#+BEGIN_SRC emacs-lisp
(straight-use-package 'use-package)
#+END_SRC
While that enables the =:straight t= extension to =use-package=, let's just have that be the default:
#+BEGIN_SRC emacs-lisp
(use-package straight
:custom (straight-use-package-by-default t))
#+END_SRC
See the details in [[https://dev.to/jkreeftmeijer/emacs-package-management-with-straight-el-and-use-package-3oc8][this essay]].
** Basic Libraries
The following packages come with Emacs, but seems like they still need loading:
#+BEGIN_SRC emacs-lisp
(require 'subr-x)
#+END_SRC
While most libraries will take care of their dependencies, I want to install /my dependent libraries/. Especially, [[https://github.com/magnars/.emacs.d/][Magnar Sveen]]'s Clojure-inspired [[https://github.com/magnars/dash.el][dash.el]] project:
#+BEGIN_SRC emacs-lisp
(use-package dash)
#+END_SRC
The [[https://github.com/magnars/s.el][s.el]] project is a simpler string manipulation library that I (and other projects) use:
#+BEGIN_SRC emacs-lisp
(use-package s)
#+END_SRC
Manipulate file paths with the [[https://github.com/rejeep/f.el][f.el]] project:
#+BEGIN_SRC emacs-lisp
(use-package f)
#+END_SRC
** My Code Location
Much of my more complicated code comes from my website essays and other projects. The destination, however, shows up here:
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path (f-expand "~/.emacs.d/elisp"))
#+END_SRC
Hopefully, this will tie me over while I transition.
* Load the Rest
The following loads the rest of my org-mode literate files. I add them as they are /ready/, but eventually, I'll trim this up into a nicer pattern.
#+BEGIN_SRC emacs-lisp
(dolist (file '("ha-config.org"
"ha-display.org"
"ha-org.org"
"ha-org-word-processor.org"
;; "org-clipboard.org"
;; "org-journaling.org"
;; "org-publishing.org"
;; "org-sprint.org"
;; "capturing-notes.org"
;; "general-programming.org"
;; "ha-agendas.org"
;; "ha-email.org"
;; "ha-irc.org"
;; "ha-passwords.org"
;; "ha-remoting.org"
;; "my-feeds.org"
))
(org-babel-load-file (f-join hamacs-source-dir file)))
#+END_SRC
We can test/debug any individual file, via:
#+BEGIN_SRC emacs-lisp
(org-babel-load-file (f-join hamacs-source-dir "ha-config.org"))
#+END_SRC
* Technical Artifacts :noexport:
Let's provide a name so that the file can be required:
#+BEGIN_SRC emacs-lisp :exports none
(provide 'bootstrap)
;;; bootstrap.el ends here
#+END_SRC
Before you can build this on a new system, make sure that you put the cursor over any of these properties, and hit: ~C-c C-c~
#+DESCRIPTION: A literate programming file for bootstrapping my environment.
#+PROPERTY: header-args:sh :tangle no
#+PROPERTY: header-args:emacs-lisp :tangle yes
#+PROPERTY: header-args :results none :eval no-export :comments no mkdirp yes
#+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil date:nil
#+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js