Setting up org-roam v2, doom emacs on a Mac

Hi
I am a new user here and installed org-roam v2 by
setting the (org +roam2) flag in the init.el

For configuration, I have simply set the location of the org directory as well as the org-roam directory in the config.el

(setq org-directory “~/folder/org/”)
(setq org-roam-directory “~/folder/org/roam/”)
where folder is a path specific to my Mac. This is basically all I have done but things appear to be working.
New nodes can be created, links work etc but I am unsure how to proceed.

I am bewildered by the multitude of different tutorials that have all slightly different prerequisites and I am too new to gauge which guidelines are near universal and thus interchangeable and which ones would conflict.
Since the basic things are working, where will the configuration go? I should probably refrain from simply copying anything that would imply the use of a package manager lest it create conflicts further down the road, right?
Also, one tutorial suggests checking if this variable is set to t:
org-roam–sqlite-available-p
but I cannot find that variable. Has it meanwhile become obsolete or am I doing something wrong?

Sorry for asking what is presumably very basic questions, but any guidance would be much appreciated.

If the basics are working, I suggest you stop being worried about configuration and start focusing on taking notes, adding links between them, and making the best out of them.

This part is a bit hard to follow. What do you mean by a “package manager” and “conflicts”? Conflicts between what and what?

It is not a variable but a function so you won’t set it. If the basics are working, you don’t need to be worried about it — if you evaluate the function, I believe it will return t, but it should not matter.

The configuration bits that I looked at start out like this (taken from System Crafters):

(use-package org-roam
  :ensure t
  :init
  (setq org-roam-v2-ack t)
  :custom
  (org-roam-directory "~/RoamNotes")
  (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 i" . org-roam-node-insert)
         :map org-mode-map
         ("C-M-i"    . completion-at-point))
  :config
  (org-roam-setup))

What I meant was that since I did not actually install org-roam via use-package I probably should not utilise the code above, at least not verbatim.
I have two questions here::

  • If I install by (org +roam2) in my init.el is that a completely unrelated install or is it already included in doom emacs and merely activated (I am lacking the ability to phrase my question accurately due to my unfamiliarity, a bit of a chicken and egg problem)?
  • I understand your advice to leave things alone if they appear to be functioning. Some configuration (or should this be called customisation?) might be needed further down the road still, but where would that go? In the config.el? And if my concern regarding the installation of org-roam should be somewhat justified, would I leave out the line
    use-package org-roam
    If so, how would I make it clear that the customisation concerns org-roam?

Many thanks for taking the time to answer, I much appreciate your helpful guidance

Christoph

I understand that it seems confusing with too much information, which does not seem to provide consistent and unified view. Don’t worry. Everyone has been there, and once you have grasped a few basics, it should not be too hard from then on.

Doom is not vanilla Emacs

But the first thing first. If you have chosen to use Doom Emacs, then I suggest you focus on Doom-specific tutorials and ignore all the tutorials that are not Doom-specific. At least when you have just started out, focus on Doom (or the basic Emacs). This is because Doom has its own layers of “package management” and “configuration”, which are so distinct from the basic Emacs (often called “vanilla Emacs” as opposed to Doom Emacs) that the knowledge of the vanilla Emacs may not directly help beginner Doom Emacs users.

I realize Doom is popular as a starter kit now, though I don’t find it particularly easy for a complete beginner. I am not trying to dissuade you. You just need to spend some time to learn Emacs + Doom from the community of Doom users. Perhaps this FAQ from Doom GitHub will help you settle in (or choose to leave the Doom camp). I was told once that they are responsive and helpful. As for me, I used Doom for a few months. Together with Spacemacs, both of them have made me realize how far you could get with Emacs. I ultimately decided to come back to the vanilla – I use Emacs only to write notes and code Emacs for note-taking. Doom felt too much for my minimal use.

Package Management and Modules (org +roam2) in Doom

I suggest you read the sections named Configure and Package management in the Getting Started guide in the Doom’s own GitHub repository carefully.

init.el
Where you’ll find your doom! block, which controls what Doom modules are enabled and in what order they will be loaded.

This file is evaluated early when Emacs is starting up; before any other module has loaded. You generally shouldn’t add code to this file unless you’re targeting Doom’s CLI or something that needs to be configured very early in the startup process.

config.el
Here is where 99.99% of your private configuration should go. Anything in here is evaluated after all other modules have loaded, when starting up Emacs.

packages.el
Package management is done from this file; where you’ll declare what packages to install and where from.

Doom Emacs does not use package.el (the package manager built into Emacs). Instead, it uses its own declarative package manager built on top of straight.el.

As for (org +roam2), that’s using a module in init.el. A module is explained as below:

A Doom module is a bundle of packages, configuration and commands, organized into a unit that can be toggled easily by tweaking your doom! block".

So you activated the org module with passing the +roam2 flag. You have got a couple of packages installed in your system with straight.el and default configuration as defined by the Doom module.

Where do we put configuration ?

By my own reading of the documentation (and my experience), if you need any additional configuration on top of what the module provides, you put it in config.el. I believe you then need to use CLI command doom sync (please consult Doom’s documentation further on this).

Read README on Org-roam GitHub

In addition to the Doom’s official documentation, you can also confirm the same understanding in this part of README in Org-roam GitHub repo. Below is a screen capture.You need to toggle the instructions to expand it.

Additionally, just to be sure: use-package is not a package manager in either vanilla Emacs or Doom. See this in the first part of its user manual.

Note that use-package is not a package manager. Although use-package does have the useful capability to interface with the Emacs package manager, its primary purpose is help with the configuration and loading of packages, not with managing their download, upgrades, and installation.

The built-in “Emacs package manager” is package.el, which Doom does not use. As the Doom documentation above says, it has its own system built on top of straight.el (another package manager you can install to the vanilla Emacs – a “third-party” package manager).

Use-package can also work with other package managers, but I guess that’s too much of information for now.