diff options
| author | BardofSprites <bard> | 2025-11-29 00:25:04 -0500 |
|---|---|---|
| committer | BardofSprites <bard> | 2025-11-29 00:25:24 -0500 |
| commit | e6d264228cbb6ddcb6f681ceec711dfa5a74cb37 (patch) | |
| tree | e693c5d8453f72449ac9703eb3bb61d97af8b31d /bard-elisp | |
| parent | 22807acab260628f203b90dc70a184ff00efe19e (diff) | |
find-or-create note
Diffstat (limited to 'bard-elisp')
| -rw-r--r-- | bard-elisp/bard-writing.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bard-elisp/bard-writing.el b/bard-elisp/bard-writing.el index 0f18c46..1733ed7 100644 --- a/bard-elisp/bard-writing.el +++ b/bard-elisp/bard-writing.el @@ -83,6 +83,18 @@ ;; Node does not exist (no id): create via Denote (bard/denote-insert-node title)))))) +(defun bard/find-or-create-node () + "Find an Org-roam node by title; if missing, create via Denote." + (interactive) + (let* ((node (org-roam-node-read nil nil)) ;; no auto-create; just selection + (title (org-roam-node-title node))) + (if (org-roam-node-id node) + ;; Node exists → visit + (org-roam-node-visit node) + ;; Node missing → create via Denote + (let ((keyword (denote-keywords-prompt))) + (denote title keyword))))) + (defun bard/denote-insert-node (title) "Denote analogy for `org-roam-insert-node', takes TITLE as node title." (interactive) |
