branch: externals/org-gnosis
commit 44b4a82031eecf3b4d5eece7ee96a6288160f4e2
Author: Thanos Apollo <pub...@thanosapollo.org>
Commit: Thanos Apollo <pub...@thanosapollo.org>

    [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.
---
 org-gnosis.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index e33ff274a8..decd88a8ba 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.

Reply via email to