A Daily Journal in Org Mode

writing code emacs

John Jacobsen
Monday, September 2, 2019

Home Other Posts

Earlier post Show at Northwestern University Prosthetics-Orthotics Center art

Later post Implementing Scheme in Python code python lisp

In a comment on yesterday’s a Hacker News thread about journaling, I sketched out my daily journaling practice of late. This post contains the full details on this procedure for those who are interested in using Org Mode for daily journaling.

The Basics

Every day gets its own Org Mode file. What goes in is not specified, but things I’ve included so far include:

  • To do lists
  • Things I probably won’t do but would like to
  • Previous night’s dreams
  • Free-form journaling
  • Notes on projects in progress
  • Small snippets of beautiful code I’ve written or seen that day
  • Summary of the day’s events
  • Quotes or poems

The main thing is to write something every day and keep some kind of record about what’s happening in my life.

So far I’ve kept each day to a single page. At the end of the day, this page gets exported as a two-column PDF (via Org’s LaTeX export), printed out and kept in a binder on my desk. I review the binder occasionally to get a feel for how the days have been going.

If I continue on this path for a few more months, I’ll have a hundred or so entries; after a year, of course, hundreds. At that point I’ll probably concatentate the PDFs into a single PDF and turn it into a bound book, perhaps via Lulu.

Explanation

Org Mode

For programming and writing, I use a 40+ year old text editor called Emacs, which is matchless in its programmability. If you’re a programmer (or want to be one) and you want complete control over your editing experience, Emacs might be for you. Org Mode is a set of functionality that has been added to Emacs which allows for easy outlining, table creation and editing, export into a variety of formats (e.g. HTML and PDF), and a variety of other features for making pretty documents that are also readable as plain text. If you’re familiar with the Markdown text format, Org Mode is like Markdown, but on steroids. (Every post on this site is generated from an Org Mode file.)

Org Mode files can have header information at the top of the file to define how the file looks when it’s exported. Since I’m picky about how the printout looks, I’ve tweaked this to my liking as follows:

#+TITLE: [...today's date...]
#+OPTIONS: toc:nil num:nil author:nil date:nil
#+STARTUP: align
#+HTML_HEAD: <link rel="stylesheet" type="text/css href="styles.css" />
#+LaTeX_CLASS: article
#+LaTeX_CLASS_OPTIONS: [9pt,twocolumn,portrait]
#+LATEX_HEADER: \usepackage[margin=0.5in]{geometry}
#+LATEX_HEADER: \usepackage{enumitem}

styles.css is a style sheet I have which overrides the default styles for Org Mode-generated HTML, in case I want to view the file in a Web browser, which runs faster than the LaTeX/PDF export. The LaTeX-related items specify the multi-column layout, along with smaller text and narrower margins than the default.

Automating It

At first, I created and edited the files manually, copying and pasting the above snippet into a new file each morning, and setting the title in the header using org-time-stamp-inactive (C-c !). Eventually I automated all that using the following Emacs Lisp (added to $HOME/.emacs.d/init.el):

(defun open-journal-file ()
  (let* ((today (format-time-string "%Y-%m-%d"))
         (path (concat (getenv "HOME") "/path/to/my/journal/" today ".org"))
         (hdr-list (list (concat "#+TITLE: [" today "]")
                         "#+OPTIONS: toc:nil num:nil author:nil date:nil"
                         "#+STARTUP: align"
                         "#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\" />"
                         "#+LaTeX_CLASS: article"
                         "#+LaTeX_CLASS_OPTIONS: [9pt,twocolumn,portrait]"
                         "#+LATEX_HEADER: \\usepackage[margin=0.5in]{geometry}"
                         "#+LATEX_HEADER: \\usepackage{enumitem}"))
         (hdr (apply 'concat
                     (mapcar (lambda (s) (concat s "\n"))
                             hdr-list)))
         (has-hdr (lambda ()
                    (save-excursion
                      (goto-char (point-min))
                      (search-forward "#+TITLE" nil t)))))
    (message (concat "opening " path " ..."))
    (find-file path)
    (unless (funcall has-hdr)
      (save-excursion
        (goto-char (point-min))
        (insert hdr)))
    (message "Enjoy your journaling!")))

Then, to bind it to the key combination Control-o 1:

(global-set-key "\C-o1"
                (lambda ()
                  (interactive)
                  (open-journal-file)))

Now that this is set up, with just a keystroke or two I have the day’s journal entry formatted exactly the way I want (because of the HTML_HEAD and LATEX_* options). If the file was already created, the shortcut puts me back in the file to make updates.

To Do Lists

The way I organize my tasks for the day (“organize” is too heavyweight a word - it’s a very light touch) goes something like this:

| pt exercises          |
| coffee                |
| work on =smallscheme= |
| breakfast             | <-- stuff I did
|                       |
| train to work         | <-- stuff I'm doing now
| work on blog post     |
|                       |
| demo prep             | <-- stuff I think I'll do
| pairing               |
| meeting about xyz     |
| demo/standup/retro    |
| bike home             |
| dinner                |
| dishes                |
| meditate              |
| bed                   |

The Org Mode table editing shortcuts let me reorder, add or eliminate items quickly. Anything I don’t get to by the end of the day either gets a strikethrough so I can remember that I didn’t get to it, or just removed. The point of the todo table is not simply to make sure I do certain things, but to record the trajectory of the day.

Why This Approach?

For many years I’ve been keeping to-do lists and writing journals using various strategies, including:

  • the Things app on laptop and phone;
  • a single, massive Org Mode file; and
  • a pen and a bound paper journal.

I love the physicality of a paper journal, but I find handwritten journals harder to read than a typed manuscript. (The handwritten journals also have a way of turning into sketchbooks.) The printed journal gives me a bit more physicality and much better readability.

I like many things about Org Mode, but find the TODO states too ugly and heavyweight for a day’s tasks. Generally, if I can’t finish something in a single day, I don’t want to be pestered about it (and I know what I care about longer-term). I really do need to be reminded of it I’ll set a reminder in my calendar or my phone. (Most of the things I have to worry about at my day job are in our JIRA ticketing system or explicitly on my calendar.) Finally, something about the single, massive Org file gets to be a little oppressive. A separate file for every day has a certain cleanness to it.

I’ve enjoyed going back and rereading the entries. Whereas meditation builds awareness of the present moment, journaling and reading the journals gives a sense of the wider arc of time, inviting contemplation about how I’m spending my days, and shedding light on themes and feelings that persist over time.

The other comments in the Hacker News thread are worth a read if you’re into this sort of thing.

Earlier post Show at Northwestern University Prosthetics-Orthotics Center art

Later post Implementing Scheme in Python code python lisp

Blog Posts (170)

Select from below, view all posts, or choose only posts for:art clojure code emacs lisp misc orgmode physics python ruby sketchup southpole writing


Home


From Elegance to Speed code lisp clojure physics

Common Lisp How-Tos code lisp

Implementing Scheme in Python code python lisp

Show at Northwestern University Prosthetics-Orthotics Center art

Color Notations art

Painting and Time art

Learning Muscular Anatomy code clojure art emacs orgmode

Reflections on a Year of Daily Memory Drawings art

Repainting art

Daily Memory Drawings art

Questions to Ask art

Macro-writing Macros code clojure

Time Limits art

Lazy Physics code clojure physics

Fun with Instaparse code clojure

Nucleotide Repetition Lengths code clojure

Updating the Genome Decoder code clojure

Getting Our Hands Dirty (with the Human Genome) code clojure

Validating the Genome Decoder code clojure

A Two Bit Decoder code clojure

Exploratory Genomics with Clojure code clojure

Rosalind Problems in Clojure code clojure

Introduction to Context Managers in Python code python

Processes vs. Threads for Integration Testing code python

Resources for Learning Clojure code clojure

Continuous Testing in Python, Clojure and Blub code clojure python

Programming Languages code clojure python

Milvans and Container Malls southpole

Oxygen southpole

Ghost southpole

Turkey, Stuffing, Eclipse southpole

Wind Storm and Moon Dust southpole

Shower Instructions southpole

Fresh Air and Bananas southpole

Traveller and the Human Chain southpole

Reveille southpole

Drifts southpole

Bon Voyage southpole

A Nicer Guy? southpole

The Quiet Earth southpole

Ten southpole

The Wheel art

Plein Air art

ISO50 southpole art

SketchUp and MakeHuman sketchup art

In Defense of Hobbies misc code art

Closure southpole

Takeoff southpole

Mummification southpole

Eleventh Hour southpole

Diamond southpole

Baby, It's Cold Outside southpole

Fruition southpole

Friendly Radiation southpole

A Place That Wants You Dead southpole

Marathon southpole

Deep Fried Macaroni and Cheese Balls southpole

Retrograde southpole

Three southpole

Transitions southpole

The Future southpole

Sunday southpole

Radio Waves southpole

Settling In southpole

Revolution Number Nine southpole

Red Eye to McMurdo southpole

That's the Way southpole

Faults in Ice and Rock southpole

Bardo southpole

Chasing the Sun southpole

Downhole southpole

Coming Out of Hibernation southpole

Managing the Most Remote Data Center in the World code southpole

Ruby Plugins for Sketchup art sketchup ruby code

The Cruel Stranger misc

Photoshop on a Dime art

Man on Wire misc

Videos southpole

Posing Rigs art

Metric art

Cuba southpole

Wickets southpole

Safe southpole

Broken Glasses southpole

End of the Second Act southpole

Pigs and Fish southpole

Last Arrivals southpole

Lily White southpole

In a Dry and Waterless Place southpole

Immortality southpole

Routine southpole

Tourists southpole

Passing Notes southpole

Translation southpole

RNZAF southpole

The Usual Delays southpole

CHC southpole

Wyeth on Another Planet art

Detox southpole

Packing southpole

Nails southpole

Gearing Up southpole

Gouache, and a new system for conquering the world art

Fall 2008 HPAC Studies art

YABP (Yet Another Blog Platform) southpole

A Bath southpole

Green Marathon southpole

Sprung southpole

Outta Here southpole

Lame Duck DAQer southpole

Eclipse Town southpole

One More Week southpole

IceCube Laboratory Video Tour; Midrats Finale southpole

SPIFF, Party, Shift Change southpole

Good things come in threes, or 18s southpole

Sleepless in the Station southpole

Post Deploy southpole

IceCube and The Beatles southpole

Midrats southpole

Video: Flight to South Pole southpole

Almost There southpole

The Pure Land southpole

There are no mice in the Hotel California Bunkroom southpole

Short Timer southpole

Sleepy in MacTown southpole

Sir Ed southpole

Pynchon, Redux southpole

Superposition of Luggage States southpole

Shortcut to Toast southpole

Flights: Round 1 southpole

Packing for the Pole southpole

Goals for Trip southpole

Balaklavas southpole

Tree and Man (Test Post) southpole

Schedule southpole

How to mail stuff to John at the South Pole southpole

Summer and Winter southpole

Homeward Bound southpole

Redeployment southpole

Short-timer southpole

The Cleanest Air in the World southpole

One more day (?) southpole

One more week (?) southpole

Closing Softly southpole

More Photos southpole

Super Bowl Wednesday southpole

Night Owls southpole

First Week southpole

More Ice Pix southpole

Settling In southpole

NPX southpole

Pole Bound southpole

Bad Dirt southpole

The Last Laugh southpole

First Delay southpole

Nope southpole

Batteries and Sheep southpole

All for McNaught southpole

t=0 southpole

The Big (Really really big...) Picture southpole

Giacometti southpole

Descent southpole

Video Tour southpole

How to subscribe to blog updates southpole

What The Blog is For southpole

Auckland southpole

Halfway Around the World; Dragging the Soul Behind southpole

Launched southpole

Getting Ready (t minus 2 days) southpole

Home

Subscribe: RSS feed ... all topics ... or Clojure only / Lisp only