diff options
author | Thanos Apollo <[email protected]> | 2025-01-19 02:00:44 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2025-01-19 02:00:44 +0200 |
commit | 9d09fa8b1a6ed01b0487d7db21a7acef5ffe2584 (patch) | |
tree | ba9a3c48bfca9eb7362be0a5af3fa91e267f1e35 | |
parent | 44b4a82031eecf3b4d5eece7ee96a6288160f4e2 (diff) |
[fix] find: fix journals bugs & add error handling.
* Improve support for journals by not hardcoding nil in directory.
This will allow us to create journals with custom titles.
* Add error handling for when file does not exist.
-rw-r--r-- | org-gnosis.el | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/org-gnosis.el b/org-gnosis.el index decd88a..fd07377 100644 --- a/org-gnosis.el +++ b/org-gnosis.el @@ -355,12 +355,11 @@ DIRECTORY." (directory (or directory org-gnosis-dir)) (node-template (org-gnosis-select-template org-gnosis-node-templates))) (cond ((null file) - (org-gnosis--create-file title nil node-template)) + (org-gnosis--create-file title (expand-file-name title directory) + node-template)) ((file-exists-p (expand-file-name file directory)) - (find-file - (expand-file-name file directory)) - (ignore-errors (org-id-goto id)))) - (org-gnosis-mode))) + (org-gnosis-goto-id id)) + (t (error "File %s does exist" file))))) ;;;###autoload (defun org-gnosis-find-by-tag (&optional tag) |