From 529f23d067f644c453b5b8ccee150407b3112838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Edstr=C3=B6m?= Date: Mon, 2 Sep 2024 00:56:10 +0200 Subject: [PATCH] chore --- org-node-fakeroam.el | 65 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/org-node-fakeroam.el b/org-node-fakeroam.el index 5714602..fe8b430 100644 --- a/org-node-fakeroam.el +++ b/org-node-fakeroam.el @@ -36,6 +36,26 @@ (require 'emacsql) (message "Install org-roam to use org-node-fakeroam library")) +;; Satisfy compiler +(declare-function emacsql-with-transaction "emacsql") +(declare-function org-roam-buffer--redisplay-h "org-roam-mode") +(declare-function org-roam-buffer--setup-redisplay-h "org-roam-mode") +(declare-function org-roam-buffer--visibility "org-roam-mode") +(declare-function org-roam-buffer-persistent-redisplay "org-roam-mode") +(declare-function org-roam-buffer-refresh "org-roam-mode") +(declare-function org-roam-dailies--capture "org-roam-dailies") +(declare-function org-roam-db "org-roam-db") +(declare-function org-roam-db--close "org-roam-db") +(declare-function org-roam-db-query "org-roam-db") +(declare-function org-roam-fontify-like-in-org-mode "org-roam-utils") +(declare-function org-roam-node-insert-section "org-roam-mode") +(declare-function org-roam-preview-get-contents "org-roam-mode") +(defvar org-roam-buffer) +(defvar org-roam-dailies-directory) +(defvar org-roam-db-autosync-mode) +(defvar org-roam-db-location) +(defvar org-roam-directory) + ;; TODO: Remove after most users have switched to the Melpa recipes (defun org-node-fakeroam--check-compile () "Compile all fakeroam functions if not compiled. @@ -494,6 +514,29 @@ For argument FILE, see that function." ;;;; Series-related +(defvar org-node-fakeroam-dir nil + "Cached value of `org-roam-directory' transformed for org-node. +This path should be directly comparable to the paths saved in +org-node objects, which lets you skip using `file-truename' to +compare paths. + +See also `org-node-fakeroam-daily-dir'.") + +(defvar org-node-fakeroam-daily-dir nil + "Cached value for Roam's dailies dir transformed for org-node. +This path should be directly comparable to the paths saved in +org-node objects, which lets you skip using `file-truename' to +compare paths. + +Rationale: The original `org-roam-dailies-directory' was a +relative path, which incurred verbosity penalties in all code +that used it (plus practically a major performance penalty since +`expand-file-name' was often used instead of `file-name-concat'). + +Even more verbosity is added on top for org-node, which needs to +process the path through `org-node-abbrev-file-names'. Thus +this variable provides an easy shorthand.") + ;; TODO: Somehow make `org-node-new-via-roam-capture' able to do this? ;;;###autoload (defun org-node-fakeroam-daily-create (ymd series-key &optional goto keys) @@ -523,28 +566,6 @@ GOTO and KEYS are like in `org-roam-dailies--capture'." (declare (obsolete nil "2024-08-21")) (org-node-fakeroam-daily-create sortstr "d" t)) -(defvar org-node-fakeroam-dir nil - "Cached value of `org-roam-directory' transformed for org-node. -This path should be directly comparable to the paths saved in -org-node objects, which lets you skip using `file-truename' to -compare paths. - -See also `org-node-fakeroam-daily-dir'.") - -(defvar org-node-fakeroam-daily-dir nil - "Cached value for Roam's dailies dir transformed for org-node. -This path should be directly comparable to the paths saved in -org-node objects, which lets you skip using `file-truename' to -compare paths. - -Rationale: The original `org-roam-dailies-directory' was a -relative path, which incurred verbosity penalties in all code -that used it (plus practically a major performance penalty since -`expand-file-name' was often used instead of `file-name-concat'). - -Even more verbosity is added on top for org-node, which needs to -process the path through `org-node-abbrev-file-names'. Thus -this variable provides an easy shorthand.") (defun org-node-fakeroam--cache-roam-dirs () "Cache some variables.