I'm using Spacemacs v.0.200.13, and GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-09-16.

I'd like to install and use the org-roam package.

The instructions indicate that Spacemacs users should create a custom layer, use use-package to fetch the package using recipe :fetcher github :repo (url).

I have done so.


(defconst org-roam-packages
  '((org-roam :location
              (recipe :fetcher github :repo "jethrokuan/org-roam" :branch "develop"))))

(defun org-roam/init-org-roam ()
  (use-package org-roam
    :after org
    (after-init . org-roam-mode)
    (org-roam-directory "~/Dropbox/org/notes")
      (spacemacs/declare-prefix "ar" "org-roam")
        "arl" 'org-roam
        "art" 'org-roam-today
        "arf" 'org-roam-find-file
        "arg" 'org-roam-show-graph)

      (spacemacs/declare-prefix-for-mode 'org-mode "mr" "org-roam")
      (spacemacs/set-leader-keys-for-major-mode 'org-mode
        "rl" 'org-roam
        "rt" 'org-roam-today
        "rb" 'org-roam-switch-to-buffer
        "rf" 'org-roam-find-file
        "ri" 'org-roam-insert
        "rg" 'org-roam-show-graph))))

Then, in my .spacemacs, I add the package to my dotspacemacs-configuration-layers.



Now, if I restart emacs using restart-emacs-resume-layouts, and attempt to run any of the org-roam functions, I get the following error:

command-execute: Wrong type argument: commandp, org-roam-find-file

Looking through my messages, I see no obvious warnings or errors.

Then, I delete org-roam from my dotspacemacs-configuration-layers. I restart-emacs-resume-layouts. I re-add org-roam to my ``dotspacemacs-configuration-layers. Now, if I run any of theorg-roamfunctions, they work. However, I get the infamousSPC SPC is undefinederror, which I usually take to mean there's some kind of error in my.spacemacs. Again, though, nothing inmessages.` And, if I restart again, the functions again error.

Here is my .spacemacs in its entirety.

If I do describe-package when spacemacs is in a state where any of the org-roam functions give the commandp error, I see:

org-roam is an installed package.

     Status: Installed in ‘org-roam-20200224.258/’ (unsigned). Delete
    Version: 20200224.258
    Summary: Roam Research replica with Org-mode
   Requires: emacs-26.1, dash-2.13, f-0.17.2, s-1.12.0, async-1.9.4, org-9.0
   Homepage: https://github.com/jethrokuan/org-roam
   Keywords: org-mode roam convenience 

How can I successfully use org-roam while still maintaining my SPC SPC keybindings, and in a way where it persists across emacs restarts?

EDIT: If I delete the org-roam folder in .emacs.d/elpa, then restart emacs, I get into the state wherein org-roam functions work, but I get SPC SPC is undefined errors.

Here is my entire messages buffer after a restart into the state where org-roam functions work, but SPC SPC doesn't.


You might try and add this to the top of the packages file or in a layers.el file.

(configuration-layer/declare-layer 'org)

I placed this in a separate layers.el file since spacemacs will load that first.

This has worked for me but I can't get the shortcuts to work.


I also compared my config to yours. I'm using defer in the use-package init:

    (defun org-roam-layer/init-org-roam ()
  (use-package org-roam
    :after org
    (after-init . org-roam-mode)
    :defer t
  • I tried both adding the configuration-layer setting to the top of the packages.el file as well as to a new layers.el file, neither seemed to solve the issue (though I did get SPC SPC back`. – Caleb Jay Feb 25 '20 at 19:16
  • With the line at the top of the packages.el file, the behavior is identical to before regarding resets. Adding the :defer t didn't seem to change anything either... though I appreciate your help. – Caleb Jay Feb 25 '20 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.