Skip to main content

Baty.net

A blog about everything by Jack Baty 👋

Tag: Emacs

Sending Org-journal entries to Day One

I mentioned that I should create a lisp function for sending my org-journal entries to Day One. Turns out I’d already done it. The only problem was that the original version assumed I was using a new org file every day. I’m now doing monthly files, so I needed to change how the text selection was made. Here’s the new function.

(defun jab/dayone-add-note ()
  "Sends current subtree as Day One entry"
  (interactive)
  (org-mark-subtree)
  (shell-command-on-region
   (point)
   (mark)
  "/usr/local/bin/dayone2 -j=Journal new"
  nil))

It’s not perfect, since it includes any PROPERTY drawers and leading stars, but it works and was easy to make.

When a minor annoyance sparks an unreasonable change

This morning, I had trouble finding something that I was certain I’d written yesterday. I was pretty sure I’d written it in one org-mode file or another, but it seemed to be missing. Turns out it wasn’t missing. I just couldn’t see it because of the way the results show up when searching for something in Emacs. The display of search results when running projectile-ripgrep is pretty awful, and I missed what I was searching for. Here’s what it looks like in Doom Emacs by default.