summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2025-01-19 01:53:08 +0200
committerThanos Apollo <[email protected]>2025-01-19 01:56:47 +0200
commit44b4a82031eecf3b4d5eece7ee96a6288160f4e2 (patch)
treee44b79bfb5ebcdc6eed1f2c962c6329ba5bda8b2
parent62be48df445b1bf880b4e0b87144395aa0e4f793 (diff)
[fix]: org-mode bug for creation of files.
* Make sure org-mode is enabled before we run #'org-id-get-create. * Enable org-gnosis-mode.
-rw-r--r--org-gnosis.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/org-gnosis.el b/org-gnosis.el
index e33ff27..decd88a 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -298,9 +298,8 @@ Removes all contents of FILE in database, adding them anew."
lst))
(defun org-gnosis--create-file (title &optional file extras)
- "Create a node and optionally a FILE for TITLE.
-
- Insert initial Org metadata if the buffer is new or empty."
+ "Create a node FILE for TITLE.
+Insert initial Org metadata if the buffer is new or empty."
(let* ((file-name (replace-regexp-in-string "#" ""
(replace-regexp-in-string " " "_" title)))
(file (or file (expand-file-name
@@ -313,11 +312,11 @@ Removes all contents of FILE in database, adding them anew."
(unless (or (file-exists-p file)
(> (buffer-size) 0))
(insert (format "#+title: %s\n#+filetags: \n" title))
+ (org-mode)
(org-id-get-create)
- (when extras (insert extras))
- (org-mode)))
+ (when extras (insert extras))))
(switch-to-buffer buffer)
- file-name))
+ (org-gnosis-mode 1)))
(defun org-gnosis-find--with-tags (&optional prompt entries)
"Select gnosis node with tags from ENTRIES.