Zero to Emacs and Org-roam: a step-by-step guide on Windows 10

S U C C E S S
And you dear comrade brought me there:

  • Yes, I do have another (add-hook 'after-init-hook 'global-company-mode) in my one and only config.org
    (use-package company
    :ensure t
    :config
    (add-hook 'after-init-hook 'global-company-mode)
    (setq company-idle-delay 1)
    (setq company-minimum-prefix-length 3))
  • That one is above the other
    #+begin_src emacs-lisp
    (use-package org-roam
    :ensure t
    :hook
    (after-init . org-roam)
    :custom
    (org-roam-directory “~/org/”)
  • The first worked always, but org-roam wouldn’t even after commenting out company
  • BUT: I changed the latter to:
    (use-package org-roam
    :ensure t
    :init
    (add-hook 'after-init-hook 'org-roam-mode)
    :custom
    (org-roam-directory “~/org/”)
  • And Boom, it worked

Learning:

  • Yes, multiple after-init-hooks are allowed, if done correctly
  • preferably preceded with :init

So here is my Messages buffer output now (even reopened Emacs after disbled org-roam-mode:
Loading c:/Users/JochenBurkhard/iCloudDrive/iCloud~com~appsonthemove~beorg/.emacs.d/config.el (source)…
[yas] Prepared just-in-time loading of snippets successfully.
Loading c:/Users/JochenBurkhard/iCloudDrive/iCloud~com~appsonthemove~beorg/.emacs.d/config.el (source)…done
Loaded c:/Users/JochenBurkhard/iCloudDrive/iCloud~com~appsonthemove~beorg/.emacs.d/config.el
(org-roam) files: Δ0, headlines: Δ0, links: Δ0, tags: Δ0, titles: Δ0, refs: Δ0, deleted: Δ0
Loading c:/Users/JochenBurkhard/iCloudDrive/iCloud~com~appsonthemove~beorg/.emacs.d/recentf…done
Cleaning up the recentf list…done (0 removed)
For information about GNU Emacs and the GNU system, type C-h C-a.
Package cl is deprecated

1 Like