Hi, I am new to emacs and org-roam and have set up basic functionalities using codes available in this and other platforms. I do find org-roam to be extremely useful in my note-taking workflow and can see its tremendous potential in organizing and retaining information.
My workflow involves using org-roam-bibTex and org-roam. However, based on my current setup, the load time for org-roam is too high. I used benchmark-init to assess load time and this it showed that org-roam is taking more than 30 seconds to load.
Also, when I load emacs it gives me the following error message, which I think is related to the high load time:
Blockquote Error (use-package): org-roam/:config: Query timeout error: “Query timed out”, 30
Can someone please help me troubleshoot this problem?
Here is the configuration that I am using:
;;========== Org-roam Configuration======
(use-package org-roam
:ensure t
:custom
(org-roam-directory (file-truename "C:/Doc/roam"))
(org-roam-completion-everywhere t)
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n g" . org-roam-graph)
("C-c n c" . org-roam-capture)
("C-c n r" . org-roam-node-random)
(:map org-mode-map
("C-c n i" . org-roam-node-insert)
("C-c n o" . org-id-get-create)
("C-c n t" . org-roam-tag-add)
("C-c n a" . org-roam-alias-add)
("C-c n m". completion-at-point)
("C-c n l" . org-roam-buffer-toggle)))
:config
(org-roam-db-autosync-mode)
(org-roam-db-autosync-enable))
(setq org-roam-capture-templates
'(("i" "new_ideas" plain "%?"
:if-new (file+head "research/new_ideas/${title}.org" "#+title: ${title}\n")
:immediate-finish t
:unnarrowed t)
("n" "annotations" plain "%?"
:if-new
(file+head "research/annotations/${title}.org" "#+title: ${title}\n")
:immediate-finish t
:unnarrowed t)
("m" "my_pub" plain "%?"
:if-new
(file+head "research/my_pub/${title}.org" "#+title: ${title}\n#+filetags: :article:\n")
:immediate-finish t
:unnarrowed t)
(setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
;; ===== Configure Deft ========
(use-package deft
:config
(setq deft-directory "C:/Dey/memories"
deft-extensions '("txt" "tex" "org")
deft-recursive t
deft-strip-summary-regexp ":PROPERTIES:\n\\(.+\n\\)+:END:\n"
deft-use-filename-as-title t)
:bind
("C-c n d" . deft))
;; ====== Configure org-roam-ui =======
(use-package org-roam-ui
:ensure t
:bind
("C-c n g" . org-roam-ui-mode))
;;========== BibTex Setup ======
;;Fine tuning BibTex mode
;;; Allow org-ref to find pdfs - basically align filenames in someway
(setq org-ref-get-pdf-filename-function #'org-ref-get-pdf-filename-helm-bibtex)
;;; Spell checking (requires the ispell software)
(add-hook 'bibtex-mode-hook 'flyspell-mode)
;;; Change fields and format
(setq bibtex-user-optional-fields '(("keywords" "Keywords to describe the entry" "")
("file" "Link to document file." ":"))
bibtex-align-at-equal-sign t)
;; Setup BibLaTex
(setq bibtex-dialect 'biblatex)
;; Assign File Locations
(setq bib-files-directory (directory-files "G:/My Drive/Research" t "^[A-Z|a-z].+.bib$")
pdf-files-directory "G:/My Drive/Zotero")
;; Configure Helm BibTeX to manage bibliographies, read documents and take notes
(use-package helm-bibtex
:config
(setq bibtex-completion-bibliography bib-files-directory
bibtex-completion-library-path pdf-files-directory
bibtex-completion-pdf-field "File"
bibtex-completion-notes-path org-directory
bibtex-completion-additional-search-fields '(keywords))
:bind
(("C-c n c" . helm-bibtex)))
;; configure org-ref
(require 'org-ref)
(require 'org-ref-helm)
(require 'org-ref-ivy)
(require 'org-ref-bibtex)
(setq org-ref-insert-link-function 'org-ref-insert-link-hydra/body
org-ref-insert-cite-function 'org-ref-cite-insert-ivy
org-ref-insert-label-function 'org-ref-insert-label-link
org-ref-insert-ref-function 'org-ref-insert-ref-link
org-ref-cite-onclick-function (lambda (_) (org-ref-citation-hydra/body)))
(define-key org-mode-map (kbd "C-c i") 'org-ref-insert-link)
;; Configure org-roam BibTex
(use-package org-roam-bibtex
:after (org-roam helm-bibtex)
:bind (:map org-mode-map ("C-c n b" . orb-note-actions))
:config
(require 'org-ref))
(org-roam-bibtex-mode)
Just for context, I do not understand codes that well and the code above is mostly copied from multiple sources and somehow made to work for my workflow (as one can tell perhaps ). I will really appreciate any tips on optimizing the code above