branch: externals/org-gnosis
commit 606af55839a1fe4090fcde859c4e0ccf28d8f834
Author: Thanos Apollo <[email protected]>
Commit: Thanos Apollo <[email protected]>

    [fix] parse-buffer: journals: always parse the actual file.
    
    * Previous implementation would check for current-buffer, which would
      cause issues for the journal todo checking when using
      org-gnosis-db-sync.
---
 org-gnosis.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/org-gnosis.el b/org-gnosis.el
index 02719d34e8..488e972bd0 100644
--- a/org-gnosis.el
+++ b/org-gnosis.el
@@ -442,7 +442,10 @@ FILE can be a full path or basename."
     ;; Update todos
     (when (and journal-p file)
       (let* ((today (format-time-string "%Y-%m-%d"))
-             (parsed-buffer (org-element-parse-buffer))
+             (parsed-buffer (with-temp-buffer
+                              (insert-file-contents file)
+                              (org-mode)
+                              (org-element-parse-buffer)))
              (done-todos (if (and org-gnosis-journal-file
                                   (string= (file-name-nondirectory file)
                                            (file-name-nondirectory 
org-gnosis-journal-file)))

Reply via email to