diff options
author | Thanos Apollo <[email protected]> | 2024-11-23 12:44:10 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-11-23 12:44:10 +0200 |
commit | dc599a68fa34cbdd2a682bfe99b61398f5b1100d (patch) | |
tree | 647404c5f7afd69b8ef2e18f815f3bb8b09e1553 /org-gnosis.el | |
parent | 75d6fd29cb9296b9893395726adeb10ba4134202 (diff) |
[fix] title adjust & journal-insert
Diffstat (limited to 'org-gnosis.el')
-rw-r--r-- | org-gnosis.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/org-gnosis.el b/org-gnosis.el index 628ce47..be96e1b 100644 --- a/org-gnosis.el +++ b/org-gnosis.el @@ -47,7 +47,7 @@ :type 'string :group 'org-gnosis) -(defcustom org-gnosis-journal-dir "~/Notes/journal" +(defcustom org-gnosis-journal-dir (expand-file-name "journal" org-gnosis-dir) "Gnosis journal directory." :type 'directory :group 'org-gnosis) @@ -176,7 +176,8 @@ FILE: File path" (defun org-gnosis-adjust-title (input) "Adjust the INPUT string to replace id link structures with plain text." - (replace-regexp-in-string "\\[\\[id:[^]]+\\]\\[\\(.*?\\)\\]\\]" "\\1" input)) + (when (stringp input) + (replace-regexp-in-string "\\[\\[id:[^]]+\\]\\[\\(.*?\\)\\]\\]" "\\1" input))) (defun org-gnosis-get-file-info (filename) "Something FILENAME." @@ -402,8 +403,8 @@ instead." (let* ((node (org-gnosis--find "Select journal entry: " (org-gnosis-select '[date tags] 'journal '1=1) (org-gnosis-select 'date 'journal '1=1))) - (id (concat "id:" (car (org-gnosis-select 'id 'nodes `(= ,node title) '1=1))))) - (org-insert-link nil id node))) + (node-id (concat "id:" (car (org-gnosis-select 'id 'journal `(= ,node date) '1=1))))) + (org-insert-link nil node-id node))) (defun org-gnosis-journal (&optional template) "Start journaling for current date." |