Help needed whith configuration

Hi everyone!

This is my first post here and I would like to start by thanking @nobiot & all contributors for all this amazing job. :heart:

(Also all of you who contributed to this forum, some posts were a total life saver).

The Problem Itself


I’m a total noob in Emacs and until recently my configuration was a terrible wall of text inside a module option in NixOS. While that worked when I started hacking things together it has become hard to maintain quickly.

So recently I’ve decided to remake my whole config from the ground up. And do it in a literate way (since all the cool kids do that :sunglasses:). All was going well until I tried to configure Org Roam.

I’m having a bunch of different problems and while I’m sure most if not all are my fault I couldn’t figure out anything from the docs.

Issues

  • Keybinding not working.
  • OrgRoam ignoring the configured paths.
  • Unable to use env vars for paths. (This might be a more general Emacs doubt)

The Config Itself

Here is my whole OrgRoam config:

  (use-package org-roam
    :ensure t
    :defer t
    ;; Had some problems with those? I don't remember right now.
    ;;:require (org)
    ;;:hook (after-init)

    :init
    (setq org-roam-db-gc-threshold most-positive-fixnum)

    :config
    ;; I cannot figure a way to use environment variables insted.
    (setq org-roam-directory (file-truename "~/.local/share/emacs/org-roam")
          org-roam-db-location "~/.cache/emacs/org-roam/org-roam.db"
          ;; Uses the built-in sqlite database.
          org-roam-database-connector 'sqlite-builtin
          ;; Completion.
          org-roam-completion-everywhere t)

    :bind ((C-c n f . org-roam-node-find))

    :custom
    ;; Keeps the DB in sync.
    (org-roam-db-autosync-mode))

Thank you in advice. :slight_smile:

If you read README of use-package, I think key-binding needs to be surrounded by double-quotation marks, making it a string, like this:
:bind ((“C-c n f” . org-roam-node-find))

I don’t use use-package so I don’t understand the rest of your issues

For the issue of paths, I have a feeling that this autosync mode activation should be placed at the end of :config.

You’d need to ensure the path config is done before db sync is run. Perhaps your current way runs the db sync before your path config is done.

I’ve tried both ways and it has no effect at all.

I cannot figure out how this is happening so I’ll need to wait for someone more used to use-package.

And regarding that; I’ve even deleted that line and nothing changed. Org Roam tries to create its folder under ~/org-roam.

Thanks.

I’ve managed to fix my issues. All I needed was to install the bind-key package.

Thanks for your help.

You might like to share the relevant part of your config that has worked for you for others to learn from.

1 Like