Error Message .emacs file

Hi,

Hope some kind soul here can please advise…as I am emacs newbie…

Using Emacs 27.2 in Manjaro linux on my laptop.

Installed org-roam package OK, I think…

Copied configuration code from org-roam wiki into my .emacs file.

Now I get error at startup:

Warning (initialization): An error occurred while loading ‘/home/marks/.emacs’:

Symbol’s function definition is void: org-roam-setup

Here’s the config code I used:

(defun my/org-roam-load ()
(interactive)
(add-to-list 'load-path “~/local-repos/org-roam/”)
(load-library “org-roam”)
(setq org-roam-directory (file-truename my/permanent-notes-directory))
(setq org-roam-file-extensions '(“org”)))
(org-roam-setup)
(define-key global-map (kbd “C-c n /”) #'org-roam-node-find)
(define-key global-map (kbd “C-c n c”) #'org-roam-capture)
(define-key global-map (kbd “C-c n i”) #'org-roam-node-insert)
(define-key global-map (kbd “C-c n r”) #'org-roam-buffer-toggle)

Thanks for any help in correcting error!

Mark

Assuming you’ve checked out the v2 branch – you should, the master branch does not have org-roam-setup – the likely reason is the misplaced closing parenthesis. Your function definition stops right before (org-roam-setup). Thus (org-roam-setup) is evaluated immediately when .emacs is loaded, before you have a chance to call my/org-roam-load interactively and load the library that defines this function. You probably want this:

(defun my/org-roam-load ()
  (interactive)
  (add-to-list 'load-path “~/local-repos/org-roam/”)
  (load-library “org-roam”)
  (setq org-roam-directory (file-truename my/permanent-notes-directory))
  (setq org-roam-file-extensions '(“org”))
  (org-roam-setup)
  (define-key global-map (kbd “C-c n /”) #'org-roam-node-find)
  (define-key global-map (kbd “C-c n c”) #'org-roam-capture)
  (define-key global-map (kbd “C-c n i”) #'org-roam-node-insert)
  (define-key global-map (kbd “C-c n r”) #'org-roam-buffer-toggle))

P.S. Please use code blocks when posting code examples, consider indenting the code too.

Thank you for your help!

Error message is gone now.

Will use code blocks next time…don’t know what happened with indents, as it is indented in my .emacs file.

You are welcome!