More plaintext primitivism with Denote

· 377 words · 2 minute read

Denote is a note-taking package for Emacs I find sort of interesting because its creator is trying very hard to make something that is structured and can provide some of the affordances we’re all coming to expect from PKMs without requiring a bunch of extra overhead: At the content level he wants you to use existing file types and markup languages (org, Markdown), and at the management/search level he wants you to use existing Emacs tools, like dired in combination with a file naming scheme that incorporates title, date, and tags into the filename.

It doesn’t toss you into the plaintext-n-filesystem primitivist deep end on your own. It comes with a dired mode that fontifies based on its own filenaming convention, so what seems like it could be super ungainly is actually pretty easy to scan in practice:

Screenshot of files colorized by their datestamp, title, and tags in Emacs dired

dired in denote-dired-mode

… and it has a collection of functions that let you add/remove keywords, rename files using its naming convention, etc. There are even a few next-level sorts of things, such as the ability to create content “silos,” so you can set up a note directory for personal stuff, work stuff, etc. without clashing label namespaces and other things that come up when you have to manage a few discrete areas with the same tool.

As “what would my exit plan be” tools go, this one is pretty good, given It’s All Just Text with no particularly difficult conventions.

It was trivial to move a bunch of notes into a directory, use Denote’s built-in tools to convert them to the proper naming convention, and start using it. It took under a minute to convert a function I cribbed from org-roam’s forums to use ripgrep to provide fulltext search:

(defun mph/denote-rg-search ()
  "Search denote directory using consult-ripgrep. With live-preview."
  (let ((consult-ripgrep-command "rg --null --smart-case --type org --line-buffered --color=always --max-columns=500 --no-heading --line-number . -e ARG OPTS"))
    (consult-ripgrep denote-directory)))

(map! :leader
      (:prefix-map ("n" . "notes")
      (:prefix ("D" . "Denote")
       :desc "ripgrep" "/" #'mph/denote-rg-search)))

The obvious comparisons in the Emacs ecosystem are Deft and org-roam. I haven’t given Deft much time. I’ve used org-roam more. I like Denote’s lack of a dependency on a database. I don’t know how Denote will compare in terms of scale if it’s all filesystem-and-native-tools.