2021-11-02 00:27:14 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-11-10 22:24:55 +00:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# INITIALIZE the HAMACS SYSTEM
|
|
|
|
# ----------------------------------------------------------------------
|
2021-11-02 00:27:14 +00:00
|
|
|
|
|
|
|
HAMACS_DIR=$(cd "$(dirname "$0")"; pwd)
|
|
|
|
HAMACS_DEST=$HOME/.emacs.hamacs # A symlink to ~/.emacs.d
|
|
|
|
|
|
|
|
mkdir -p $HAMACS_DEST
|
2021-11-10 22:24:55 +00:00
|
|
|
|
|
|
|
for LINK in snippets templates elisp
|
|
|
|
do
|
|
|
|
rm -rf $HAMACS_DEST/$LINK
|
|
|
|
ln -s --force $HAMACS_DIR/$LINK $HAMACS_DEST
|
|
|
|
done
|
2021-11-02 00:27:14 +00:00
|
|
|
|
|
|
|
cat > $HAMACS_DEST/init.el <<EOF
|
|
|
|
;;; init.el --- Hamacs Init -*- lexical-binding: t; -*-
|
|
|
|
;;
|
|
|
|
;;; Commentary:
|
|
|
|
;;
|
|
|
|
;; This is my Emacs Bootloader. Simply put, I initialize the package management
|
|
|
|
;; system, and then tangle my literate files. This simple idea came from
|
|
|
|
;; https://github.com/susamn/dotfiles
|
|
|
|
;;
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
;; We'll be using straight. So, we don't want duplicated package loading:
|
|
|
|
(setq package-enable-at-startup nil)
|
|
|
|
|
2021-11-09 16:21:08 +00:00
|
|
|
;; While I would rather program my configurations, sometimes the Emacs
|
|
|
|
;; menu system is “good enough”, but I want it in its own file:
|
|
|
|
|
|
|
|
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
|
|
|
|
(when (file-exists-p custom-file)
|
|
|
|
(load custom-file))
|
|
|
|
|
|
|
|
;; While this path should come from the shell, there seems to be a
|
|
|
|
;; condition where I need to set this so that Emacs can pull our my
|
|
|
|
;; compiled files.
|
|
|
|
|
2021-11-10 01:18:52 +00:00
|
|
|
(add-to-list 'exec-path "/usr/local/bin")
|
2021-11-09 16:21:08 +00:00
|
|
|
|
2021-11-10 01:18:52 +00:00
|
|
|
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
|
2021-11-02 00:27:14 +00:00
|
|
|
(defvar hamacs-source-dir "$HAMACS_DIR" "Where we be.")
|
|
|
|
|
|
|
|
;; Let's rock:
|
|
|
|
(org-babel-load-file "$HAMACS_DIR/bootstrap.org")
|
|
|
|
|
|
|
|
(provide 'init.el)
|
|
|
|
;;; init ends here
|
|
|
|
EOF
|
|
|
|
|
|
|
|
echo Created $HAMACS_DEST/init.el
|