diff options
author | Thanos Apollo <[email protected]> | 2024-12-18 23:32:16 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-12-18 23:32:16 +0200 |
commit | 91955d8344c2dc9418657291e34f2309eb389025 (patch) | |
tree | 139e05efbd2f07a48a1f184da060c78582dae3e2 | |
parent | 9eedd4fa2e6fc8ec02588d630f39ac0c04451773 (diff) |
Remove auto sync functions.
* Uneeded & do not fit with the minimal design.
-rw-r--r-- | org-gnosis.el | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/org-gnosis.el b/org-gnosis.el index b1dd302..4ecb2a1 100644 --- a/org-gnosis.el +++ b/org-gnosis.el @@ -70,8 +70,6 @@ (defvar org-gnosis-db (emacsql-sqlite-open (locate-user-emacs-file "org-gnosis.db"))) -(defvar org-gnosis-auto-sync--timer nil) - (cl-defun org-gnosis-select (value table &optional (restrictions '1=1) (flatten nil)) "Select VALUE from TABLE, optionally with RESTRICTIONS. @@ -459,35 +457,6 @@ TEMPLATE: Journaling template, refer to `org-gnosis-journal-templates'." (add-hook 'after-save-hook #'org-gnosis-update-file nil t) ;; buffer local hook (remove-hook 'after-save-hook #'org-gnosis-update-file))) -(defvar org-gnosis-db-sync-timer nil - "Timer for org-gnosis-db-sync minor mode.") - -(defvar org-gnosis-db-sync-interval 60 - "Second interval to sync database.") - -(define-minor-mode org-gnosis-db-sync-mode - "Minor mode to automatically run `org-gnosis-db-sync` every 30 seconds." - :lighter nil - :global t - (if org-gnosis-db-sync-mode - (setq org-gnosis-db-sync-timer - (run-with-timer 0 org-gnosis-db-sync-interval #'org-gnosis-db-sync-async)) - (when org-gnosis-db-sync-timer - (cancel-timer org-gnosis-db-sync-timer) - (setq org-gnosis-db-sync-timer nil)))) - -(defun org-gnosis-db-sync-async () - "Run `org-gnosis-db-sync` asynchronously using a subprocess." - (let ((script (concat - "(progn " - "(require 'org-gnosis) " ;; Ensure the necessary package is loaded - "(org-gnosis-db-sync))"))) - (start-process "org-gnosis-db-sync-process" - nil - "emacs" - "--batch" - "--eval" script))) - ;; Org-Gnosis Database (defconst org-gnosis-db-version 1) |