Setting up Emacs on MacOS

I'm still very much a Emacs newbie, so far I've found a few things that I really like, enough to make me want to keep learning, but there are definitely a bunch of things that I'm not enjoying and that I'd like to figure out how to fix.

In this ongoing series, I'll document what I learn about configuring and taming Emacs.

Config Goals

Because I'm new to Emacs, I don't know that I can actually do everything that I want, but here's my high-level wish list:

  • Look and feel. It shouldn't hurt my eyes to look at my files.
  • File browsing. I find a file tree sidebar really useful to orient myself in a project.
  • Simple. I don't want a lot of overhead to make a config change (I'm looking at you Spacemacs!)
  • Fast (enough). I'm not speed obsessed, but I don't want to wait around for emacs to boot (I'm looking at you Spacemacs!)
  • Orgmode. I love the orgmode format for writing in general, but I also want all of the bells and whistles (todos/agenda, blogging in orgmode, latex, etc.)

Basics

Installation

There's a few options, GNU Emacs which can be installed with homebrew. Then there's Emacs for Mac which I'm told has a few tweaks to improve MacOS compatibility. And then there's Aquamacs which seems to be trying to package up Emacs into a self-contained native app.

Config Setup

I think I first heard about writing your emacs config in org-mode from EmacsCast. In the example they discuss the init.el file which is loaded on first boot then it replaces itself with the 'real' config from an orgmode file.

That is very clever but for simplicity I prefer Harry R. Schwartz's approach to keep two files, configuration.org which contains the real config, and init.el which has just enough code to transpile configuration.org to elisp and load it.

Create config files

$ mkdir ~/.emacs.d/
$ touch ~/.emacs.d/{init.el,configuration.org}

init.el

;; Configure package.el to include MELPA.
(require 'package)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(package-initialize)

;; Ensure that use-package is installed.
;;
;; If use-package isn't already installed, it's extremely likely that this is a
;; fresh installation! So we'll want to update the package repository and
;; install use-package before loading the literate configuration.
(when (not (package-installed-p 'use-package))
  (package-refresh-contents)
  (package-install 'use-package))

(org-babel-load-file "~/.emacs.d/configuration.org")

configuration.org

#+TITLE: Emacs Configuration

* Credits...
* Installing
* Configuration...
** UI...
** Packages...
** Org...
* Problems...
* Todo...

Within the configuration.org file, anything that I want to be in the transpiled version I just need to wrap in a #+BEGIN_SRC emacs-lisp block:

#+BEGIN_SRC emacs-lisp
(global-visual-line-mode 1)
#+END_SRC

Next

In the next part I'll cover the baseline configuration and override some default behaviour.