deafpolygon · 2022-12-04 19:48
Fedora 37 - emacs 29
edit: sorry, I think I should add that I'm using spacemacs and the config was added to my user-config section
Every time I start emacs up, it recompiles the EmacSQL SQLite binary- it takes 20s every time, and it started doing that as I started to setup Org-roam.
Why? And can I improve this?
Relevant config:
(use-package org-roam
:ensure t
:init
(setq org-roam-v2-ack t)
:custom
(org-roam-directory (file-truename "~/Notes/org-roam/"))
: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 i" . org-roam-node-insert)
("C-c n c" . org-roam-capture)
;; Dailies
("C-c n j" . org-roam-dailies-capture-today))
:config
(org-roam-db-autosync-mode)
)
(add-hook 'org-mode-hook #'toggle-word-wrap)
edit: I've commented out the relevant config for now - it starts up in 1.5s which seems more reasonable.
phr46 · 2022-12-04 20:57
The compilation is triggered by the "emacsql-sqlite-ensure-binary" function, which looks for the executable in a path given by the "emacsql-sqlite-executable" variable and, if not found, compiles it. So, try running your org-roam setup again, then look at the "emacsql-sqlite-executable" variable to see where emacsql thinks the executable should have been saved, and check in your filesystem that it is indeed there. Is it maybe going to a temporary folder?
doolio_ · 2022-12-04 22:53
FYI, the `org-roam-v2-ack` setting hasn't been necessary for a while now. In fact, I believe it has been removed.
deafpolygon · 2022-12-05 04:46
`M-x describe-variable emacsql-sqlite-executable` but I did find `emacsql-sqlite-executable-path`.
Doesn't exist.
emacsql-sqlite-executable-path is a variable defined in ‘emacsql-sqlite.el’.
Its value is "sqlite/emacsql-sqlite"
Relative path to emacsql executable.
Searching for sqlite in my .emacs.d directory finds:
`elpa/28.1/develop/emacsql-sqlite-20221127.2146/sqlite/emacsql-sqlite`
Is that where it should be?
EDIT:
On restarting I notice it says
Found 4 orphan package(s) to delete...
--> deleting emacsql... [4/4]
deaddyfreddy · 2022-12-05 08:12
- `setq` is not needed, you can set `org-roam-v2-ack` in the `:custom` section
- `add-hook` could be (almost) directly translated to `:hook`
phr46 · 2022-12-05 13:10
Ok, it looks like you can't install a package to Spacemacs by just putting the commands on your user config.
According to [this doc](https://develop.spacemacs.org/layers/+emacs/org/README.html#org-roam-support), Spacemacs has support for org-roam on its own configuration system for org-mode. I believe this dotspacemacs-configuration-layers should be in a \~/.spacemacs file, and you just change where it says "org" to "(org :variables org-enable-roam-support t)" as it shows. Then you won't need to install it manually on your user config. But I'm not familiar with Spacemacs, so I can't test this :( just going off docs.
I also found [this answer on the Spacemacs FAQ](https://develop.spacemacs.org/doc/FAQ.html#why-are-packages-installed-with-package-install-automatically-deleted-by-spacemacs-when-it-boots) about why this happens. It lists some other alternatives: you could add emacsql to a dotspacemacs-additional-packages list, which I assume is a list of externally installed packages that spacemacs will ignore; or you could set the dotspacemacs-install-packages variable to 'used-but-keep-unused, which will prevent this behavior. But I suggest you go with the previous option.
deafpolygon · 2022-12-05 13:41
That was it. Thank you very much!