summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2025-01-19 02:02:02 +0200
committerThanos Apollo <[email protected]>2025-01-19 02:02:02 +0200
commitb7ea215496969f1fc3302855e0d4f6f5da5e815b (patch)
treecc2cf68c14a82d9e34f5a2824cc7b5be2f0df389
parent9d09fa8b1a6ed01b0487d7db21a7acef5ffe2584 (diff)
journal-find: Update values for new schema.
-rw-r--r--org-gnosis.el25
1 files changed, 13 insertions, 12 deletions
diff --git a/org-gnosis.el b/org-gnosis.el
index fd07377..6d85299 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -371,7 +371,8 @@ DIRECTORY."
(node
(funcall org-gnosis-completing-read-func
"Select node: "
- (org-gnosis-select 'title 'nodes `(like tags ',(format "%%\"%s\"%%" tag))))))
+ (org-gnosis-select 'title 'nodes
+ `(like tags ',(format "%%\"%s\"%%" tag))))))
(org-gnosis-find node)))
(defun org-gnosis-select-template (&optional templates)
@@ -401,8 +402,9 @@ If node does not exist, create it."
(org-gnosis--create-file node)
;; Save buffer to store new node id
(save-buffer)
- (setf id (concat "id:"
- (car (org-gnosis-select 'id 'nodes `(= ,node title) '1=1)))))
+ (setf id (concat
+ "id:"
+ (car (org-gnosis-select 'id 'nodes `(= ,node title) '1=1)))))
(org-insert-link nil id node)
(message "Created new node: %s" node))
(t (org-insert-link nil id node)))))
@@ -424,17 +426,16 @@ If node does not exist, create it."
(newline))))))
;;;###autoload
-(defun org-gnosis-journal-find (&optional date)
+(defun org-gnosis-journal-find (&optional title)
"Find journal entry for DATE."
(interactive)
- (let* ((prompt "Select journal entry: ")
- (date (or date (org-gnosis--find
- prompt
- (org-gnosis-select '[date tags] 'journal)
- (org-gnosis-select 'date 'journal))))
- (id (car (org-gnosis-select 'id 'journal `(= date ,date) t)))
- (file (car (org-gnosis-select 'file 'journal `(= date ,date) t))))
- (org-gnosis-find date file id org-gnosis-journal-dir)))
+ (let* ((title (or title (org-gnosis--find
+ "Select journal entry: "
+ (org-gnosis-select '[title tags] 'journal)
+ (org-gnosis-select 'title 'journal))))
+ (id (car (org-gnosis-select 'id 'journal `(= title ,title) t)))
+ (file (car (org-gnosis-select 'file 'journal `(= title ,title) t))))
+ (org-gnosis-find title file id org-gnosis-journal-dir)))
;;;###autoload
(defun org-gnosis-journal-insert ()