From c9bc28595ad0c63dda2631be478defd466904e71 Mon Sep 17 00:00:00 2001 From: Random936 Date: Mon, 27 May 2024 20:54:58 -0700 Subject: [PATCH] Added auto id adder to emacs config for org roam --- dotfiles/.emacs.d/functions.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dotfiles/.emacs.d/functions.org b/dotfiles/.emacs.d/functions.org index 01a9431..a157f05 100644 --- a/dotfiles/.emacs.d/functions.org +++ b/dotfiles/.emacs.d/functions.org @@ -2,6 +2,18 @@ As of now, I haven't added anything here, though I do expect to start adding some custom functions as I learn more about Elisp. +* Automatic Todo IDs + +The following function and hooks automatically adds IDs to each todo item for easier searching with ~org-roam~. + +#+begin_src emacs-lisp +(defun jm/org-todo-auto-add-ids () + (when (org-get-todo-state) + (org-id-get-create))) + +(add-hook 'org-after-todo-state-change-hook 'jm/org-todo-auto-add-ids) +#+end_src + * Org Roam Dailies Shortcuts Shortcut to goto todays org-roam dailies document.