Further adventures in org-mode

· emacs · geekery ·

Emacs is really the gift that keeps giving. It has now been about 4 months since I started using org-mode to manage all my todos, and it has been working terrifically well for me. Despite having lots of different projects to juggle at the moment, I continue to feel more or less on top of things — or at least, I know how much stuff I haven’t been able to get to yet! The best thing about Emacs and org-mode is that you can expand and develop your system as your needs change. You don’t need to set up a complex system at the start, nor do you need to make the whole system complex if only one part of it needs extra structure. It’s all very flexible. I’ve made a couple of tweaks recently, and also started adapting my system of keeping notes which I thought might be interesting for other Emacs users and the Emacs-curious.

At the start of the year, I started a new role as part of my job. It requires keeping on top of things that I need to handle and dealing with them in a timely way. It is also quite structured, in that each task allocated to me has a series of more or less identical steps that I need to move through. It’s important that I don’t forget any of these steps, so it struck me that it would reduce the amount of thinking I need to do if I pre-populated them automatically when I set each task up.

As I explained in my previous post on my setup, this role definitely merited its own file. I also added the header #+CATEGORY: work to the header of the file so that it gets included in my work tasks in the agenda. The first change I made was to set up a specific capture template to build the structure of sub-tasks automatically, and file the tasks under the right header in this file. I discovered after a searching around that you can set up more complex capture templates in separate files, which seemed useful for this case. Each of the tasks assigned to me gets a unique ID number, so when the notification email comes in, I copy this ID and the capture template fills it in automatically from the clipboard, adding it to the main headline and each sub-task. I include a properties drawer which has fields for several dates. These dates either get filled in automatically with the current date or I get prompted to enter them when I capture the task. I add to these date properties as the task moves through several stages, and this helps me keep track of how long the different phases are taking across the tasks. Eventually, I plan to create an org-mode table to summarise this information, but for now I just use column-mode to get an overview across the tasks which I can toggle on and off. Again, the incremental nature of org-mode is useful: I don’t need to build the table from the start, but just when it becomes useful or necessary.

Since you can set up different todo keywords in different files (by adding them to the top of the files with one or more #+TODO: lines), I created some specific key words for the headline for each task so that I can scan across the folded tasks headlines and see what phase each is in, like a kind of status dashboard.

I also keep a ‘Workflow’ headline at the bottom of the file, so that I have the details of each of the steps and the various rules and guidelines they entail in the same place that I am tracking the task: no more having to click around to find that file which has all the information in!

It seems simple, but these steps have really smoothed out what could be an overwhelming process for me. As I mentioned earlier, the power of org-mode is that I could tailor this structure precisely to my needs and also that I only have this level of detail for this part of my work: other kinds of tasks are handled in a much simpler way.

I mentioned that the other change I have made has been to update the way I take notes on ideas, papers I read and so on. Many people I follow on Micro.blog have got into using a very clever note-taking tool called Roam. I tried it out, and while I thought the ease of linking between ideas was very useful and clever, I kept finding myself thinking that surely org-mode could do this. Evidently I am not the first person to think that, as Jethro Kuan has written about it, and uses a system that combines Deft (which I was already using) with his own package, org-roam. Here’s how I integrate it:

(use-package! deft
  :after org
  ("<f7>" . deft)
  (setq deft-file-naming-rules
      '((noslash . "-")
        (nospace . "-")
        (case-fn . downcase)))
  (deft-recursive t)
  (deft-use-filename-as-title nil)
  (deft-use-filter-string-for-filename t)
  (deft-extensions '("md" "txt" "org"))
  (deft-default-extension "org")
  (deft-directory (expand-file-name "~/Dropbox/SemanticNotes/")))

;; org-roam
(use-package! org-roam
  :after deft org
  :bind (("C-c r t" . org-roam-today)
         :map org-mode-map
         (("<C-f7>" . org-roam)
          ("C-c r u" . org-roam-update-buffer)
          ("C-c r l" . org-roam-get-linked-files)
          ("C-c r i" . org-roam-insert)))
  (org-roam-directory (expand-file-name "~/Dropbox/SemanticNotes/")))

I used to use Markdown format for my Deft notes, but I now use org-mode to make it easier to include code snippets, images and so on. Deft is modelled on Notational Velocity/nvALT, and intended to store relatively short notes. The idea is that when you launch it you are immediately in the search field. You start typing words and it filters the list of matching notes live. You can hit enter to open the selected note, or — if there are no matching notes — create a new note of that name. The configuration I use converts the filter string to a sanitized form (substituting spaces for hyphens for example) and then adds the original title as the org-mode title header.

As originally conceived, Deft deals with lots of separate and independent notes, but if you are constructing a knowledge base of interconnected information (as Roam does), you need to be able to link ideas together easily. This is what org-roam does. It provides functions which enable you to easily insert links to other files, providing a list of files which gets filtered live using either Ivy, Helm or Ido, depending on what you use. It also caches a list of notes that link to the currently-open note, so you can use another function to view them in a side window, and jump to them if you want. It also replicates the ‘daily notes’ feature of Roam, though I use org-journal for that instead. It covers the main things I would want from Roam, but also offers the full power of org-mode and enables me to stay in Emacs which is where I am most of the time. The files are on my own computer (and backed up and synced), and I can use pandoc at any time to export some or all of them to other formats like HTML or PDF. Jethro actually generates a public website from his notes (Jethro’s Braindump), which he builds using Hugo, the same tool I use to generate this blog. It’s a really slick system.

The final change I have made is to switch from syncing my org files with iCloud to Dropbox. iCloud seems to have a maddening tendency to stubbornly refuse to sync in some circumstances, so I was having to touch a file in the relevant iCloud folder from the command line in order to force it to notice changes to the files and sync. So far, Dropbox is working beautifully and syncs changes very quickly.