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

4.8 KiB

My Emacs Bootstrap

A literate programming file for bootstraping my Emacs Configuration.

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 straight.el for package installation and management. Here is the initialization/installation for it:

(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))

Let's get the Straight project working with use-package:

(straight-use-package 'use-package)

While that enables the :straight t extension to use-package, let's just have that be the default:

(use-package straight
  :custom (straight-use-package-by-default t))

See the details in this essay.

Basic Libraries

The following packages come with Emacs, but seems like they still need loading:

(require 'subr-x)

While most libraries will take care of their dependencies, I want to install my dependent libraries. Especially, Magnar Sveen's Clojure-inspired dash.el project:

(use-package dash)

The s.el project is a simpler string manipulation library that I (and other projects) use:

(use-package s)

Manipulate file paths with the f.el project:

(use-package f)

My Code Location

Much of my more complicated code comes from my website essays and other projects. The destination, however, shows up here:

(add-to-list 'load-path (f-expand "~/.emacs.d/elisp"))

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.

(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)))

We can test/debug any individual file, via:

  (org-babel-load-file (f-join hamacs-source-dir "ha-config.org"))