Symbol’s value as variable is void: tag-name

I get the following error:

Symbol’s value as variable is void: tag-name 

When running the following:

  ("C-c n p" . my/org-roam-find-project)
        ("C-c n t" . my/org-roam-capture-task)

How do I fix this?

My config is based on System Crafters

My full Emacs.org is here

What output do you get after M-x toggle-debug-on-error?

Debugger entered--Lisp error: (void-variable tag-name)
  (member tag-name (progn (progn (aref node 16))))
  (lambda (node) (member tag-name (progn (progn (aref node 16)))))(#s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211124181..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (("CATEGORY" . "Test") ("ID" . "2c15855d-afdb-46f7-bd7f-cde9e6adac89") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211124181...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil))
  #f(compiled-function (n) #<bytecode 0x155d5ae54e15>)((#("test2                                             ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211124181..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (("CATEGORY" . "Test") ("ID" . "2c15855d-afdb-46f7-bd7f-cde9e6adac89") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211124181...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211124181..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (("CATEGORY" . "Test") ("ID" . "2c15855d-afdb-46f7-bd7f-cde9e6adac89") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211124181...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211124181..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (("CATEGORY" . "Test") ("ID" . "2c15855d-afdb-46f7-bd7f-cde9e6adac89") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211124181...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil)))
  cl-remove(nil ((#("test2                                       ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (("CATEGORY" . "Test") ("ID" . "2c15855d-afdb-46f7-bd7f-cde9e6adac89") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil)) (#("test3                                       ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test3" :file-hash nil :file-atime (25007 16337 172325 57000) :file-mtime (25007 16337 172325 57000) :id "cd57089e-8130-487f-8e1b-6a0d65314ce0" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test3" :properties (... ... ... ... ...) :olp nil :tags nil :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test3" :file-hash nil :file-atime (25007 16337 172325 57000) :file-mtime (25007 16337 172325 57000) :id "cd57089e-8130-487f-8e1b-6a0d65314ce0" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test3" :properties (... ... ... ... ...) :olp nil :tags nil :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test3" :file-hash nil :file-atime (25007 16337 172325 57000) :file-mtime (25007 16337 172325 57000) :id "cd57089e-8130-487f-8e1b-6a0d65314ce0" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test3" :properties (("CATEGORY" . "20211207124607-test3") ("ID" . "cd57089e-8130-487f-8e1b-6a0d65314ce0") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211...") ("PRIORITY" . "B")) :olp nil :tags nil :aliases nil :refs nil)) (#("test                                        ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test" :file-hash nil :file-atime (24990 26216 662432 526000) :file-mtime (24990 26314 522871 181000) :id "eea583db-a40f-4238-83ec-f03bf7341bde" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test" :file-hash nil :file-atime (24990 26216 662432 526000) :file-mtime (24990 26314 522871 181000) :id "eea583db-a40f-4238-83ec-f03bf7341bde" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test" :file-hash nil :file-atime (24990 26216 662432 526000) :file-mtime (24990 26314 522871 181000) :id "eea583db-a40f-4238-83ec-f03bf7341bde" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test" :properties (("CATEGORY" . "Test") ("ID" . "eea583db-a40f-4238-83ec-f03bf7341bde") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil))) :if-not #f(compiled-function (n) #<bytecode 0x155d5ae54e15>))
  apply(cl-remove nil ((#("test2                                       ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (("CATEGORY" . "Test") ("ID" . "2c15855d-afdb-46f7-bd7f-cde9e6adac89") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil)) (#("test3                                       ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test3" :file-hash nil :file-atime (25007 16337 172325 57000) :file-mtime (25007 16337 172325 57000) :id "cd57089e-8130-487f-8e1b-6a0d65314ce0" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test3" :properties (... ... ... ... ...) :olp nil :tags nil :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test3" :file-hash nil :file-atime (25007 16337 172325 57000) :file-mtime (25007 16337 172325 57000) :id "cd57089e-8130-487f-8e1b-6a0d65314ce0" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test3" :properties (... ... ... ... ...) :olp nil :tags nil :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test3" :file-hash nil :file-atime (25007 16337 172325 57000) :file-mtime (25007 16337 172325 57000) :id "cd57089e-8130-487f-8e1b-6a0d65314ce0" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test3" :properties (("CATEGORY" . "20211207124607-test3") ("ID" . "cd57089e-8130-487f-8e1b-6a0d65314ce0") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211...") ("PRIORITY" . "B")) :olp nil :tags nil :aliases nil :refs nil)) (#("test                                        ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test" :file-hash nil :file-atime (24990 26216 662432 526000) :file-mtime (24990 26314 522871 181000) :id "eea583db-a40f-4238-83ec-f03bf7341bde" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test" :file-hash nil :file-atime (24990 26216 662432 526000) :file-mtime (24990 26314 522871 181000) :id "eea583db-a40f-4238-83ec-f03bf7341bde" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test" :file-hash nil :file-atime (24990 26216 662432 526000) :file-mtime (24990 26314 522871 181000) :id "eea583db-a40f-4238-83ec-f03bf7341bde" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test" :properties (("CATEGORY" . "Test") ("ID" . "eea583db-a40f-4238-83ec-f03bf7341bde") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil))) :if-not #f(compiled-function (n) #<bytecode 0x155d5ae54e15>) nil)
  cl-remove-if-not(#f(compiled-function (n) #<bytecode 0x155d5ae54e15>) ((#("test2                                       ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test2" :file-hash nil :file-atime (25000 63358 833884 352000) :file-mtime (25000 63358 833884 352000) :id "2c15855d-afdb-46f7-bd7f-cde9e6adac89" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test2" :properties (("CATEGORY" . "Test") ("ID" . "2c15855d-afdb-46f7-bd7f-cde9e6adac89") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil)) (#("test3                                       ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test3" :file-hash nil :file-atime (25007 16337 172325 57000) :file-mtime (25007 16337 172325 57000) :id "cd57089e-8130-487f-8e1b-6a0d65314ce0" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test3" :properties (... ... ... ... ...) :olp nil :tags nil :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test3" :file-hash nil :file-atime (25007 16337 172325 57000) :file-mtime (25007 16337 172325 57000) :id "cd57089e-8130-487f-8e1b-6a0d65314ce0" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test3" :properties (... ... ... ... ...) :olp nil :tags nil :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test3" :file-hash nil :file-atime (25007 16337 172325 57000) :file-mtime (25007 16337 172325 57000) :id "cd57089e-8130-487f-8e1b-6a0d65314ce0" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test3" :properties (("CATEGORY" . "20211207124607-test3") ("ID" . "cd57089e-8130-487f-8e1b-6a0d65314ce0") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211...") ("PRIORITY" . "B")) :olp nil :tags nil :aliases nil :refs nil)) (#("test                                        ..." 0 121 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test" :file-hash nil :file-atime (24990 26216 662432 526000) :file-mtime (24990 26314 522871 181000) :id "eea583db-a40f-4238-83ec-f03bf7341bde" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil)) 121 131 (node #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test" :file-hash nil :file-atime (24990 26216 662432 526000) :file-mtime (24990 26314 522871 181000) :id "eea583db-a40f-4238-83ec-f03bf7341bde" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test" :properties (... ... ... ... ...) :olp nil :tags ("Project") :aliases nil :refs nil) face org-tag)) . #s(org-roam-node :file "/home/pharper/Dropbox/org/Zettelkasten/20211..." :file-title "test" :file-hash nil :file-atime (24990 26216 662432 526000) :file-mtime (24990 26314 522871 181000) :id "eea583db-a40f-4238-83ec-f03bf7341bde" :level 0 :point 1 :todo nil :priority nil :scheduled nil :deadline nil :title "test" :properties (("CATEGORY" . "Test") ("ID" . "eea583db-a40f-4238-83ec-f03bf7341bde") ("BLOCKED" . "") ("FILE" . "/home/pharper/Dropbox/org/Zettelkasten/20211...") ("PRIORITY" . "B")) :olp nil :tags ("Project") :aliases nil :refs nil))))
  org-roam-node-read(nil (lambda (node) (member tag-name (progn (progn (aref node 16))))))
  (org-roam-capture- :node (org-roam-node-read nil (my/org-roam-filter-by-tag "Project")) :templates '(("p" "project" plain "** TODO %?" :if-new (file+head+olp "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags:..." ("Tasks")))))
  my/org-roam-capture-task()
  funcall-interactively(my/org-roam-capture-task)
  call-interactively(my/org-roam-capture-task nil nil)
  command-execute(my/org-roam-capture-task)

For the FILTER-FN arg of org-roam-capture- I think you need to pass function’s name as a symbol or a lambda function directly like this:

  ;; Capture the new task, creating the project file if necessary
  (org-roam-capture- :node (org-roam-node-read
                            nil
                            (lambda (node)
                              (member "Project" (org-roam-node-tags node))))
                     :templates '(("p" "project" plain "** TODO %?"
                                   :if-new (file+head+olp "%<%Y%m%d%H%M%S>-${slug}.org"
                                                          "#+title: ${title}\n#+category: ${title}\n#+filetags: Project"
                                                          ("Tasks"))))))

At least I don’t get the same error; it seems to work on my end.

Thanks for your replies @nobiot! I already have the if-new in my org file. In fact it looks verbatim to me.

I am still at a loss.

I’m not talking about if-new… sorry the second arg of org-roam-node-read.

Compare this above with yours for the second argument.

If you are still lost, let me know; I will try to be clearer when i’m back to my PC

Sorry. Not getting it. Although I found if I delete some Test files the commands will work once. After I create a single Project or Todo file and C-c C-c and try it again I am back to the variable is void stuff.

As far as I can tell from above, you are calling this command my/org-roam-capture-task and get the error message you originally reported — I have reproduced it on my end.

(defun my/org-roam-capture-task ()
  (interactive)
  ;; Add the project file to the agenda after capture is finished
  (add-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)

  ;; Capture the new task, creating the project file if necessary
  (org-roam-capture- :node (org-roam-node-read
                            nil
                            (my/org-roam-filter-by-tag "Project"))
                     :templates '(("p" "project" plain "** TODO %?"
                                   :if-new (file+head+olp "%<%Y%m%d%H%M%S>-${slug}.org"
                                                          "#+title: ${title}\n#+category: ${title}\n#+filetags: Project"
                                                          ("Tasks"))))))

In the form that begins with calling org-roam-capture-, in the :node part, you call org-roam-node-read.

In it, the second arg, you pass (my/org-roam-filter-by-tag "Project").

This is incorrect. Change it to (lambda (node) (member "Project" (org-roam-node-tags node)))

The entire defun should be like this:

(defun my/org-roam-capture-task ()
  (interactive)
  ;; Add the project file to the agenda after capture is finished
  (add-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)

  ;; Capture the new task, creating the project file if necessary
  (org-roam-capture- :node (org-roam-node-read
                            nil
                            (lambda (node)
                              (member "Project" (org-roam-node-tags node))))
                     :templates '(("p" "project" plain "** TODO %?"
                                   :if-new (file+head+olp "%<%Y%m%d%H%M%S>-${slug}.org"
                                                          "#+title: ${title}\n#+category: ${title}\n#+filetags: Project"
                                                          ("Tasks"))))))

I cannot test my/org-roam-project-finalize-hook, and I don’t have Project as a tag, so I did these to test my proof of concept:

  • I commented out (add-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)
  • I use “test” as a tag, instead of “Project”

This below is the command I tested. It works; it filters my node and only returns the ones with tag “test”.

(defun my/org-roam-capture-task ()
  (interactive)
  ;; Add the project file to the agenda after capture is finished
  ;; (add-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)

  ;; Capture the new task, creating the project file if necessary
  (org-roam-capture- :node (org-roam-node-read
                            nil
                            (lambda (node)
                              (member "test" (org-roam-node-tags node))))
                     :templates '(("p" "project" plain "** TODO %?"
                                   :if-new (file+head+olp "%<%Y%m%d%H%M%S>-${slug}.org"
                                                          "#+title: ${title}\n#+category: ${title}\n#+filetags: Project"
                                                          ("Tasks"))))))

Not sure if this is doing anything:

(defun my/org-roam-project-finalize-hook ()
  "Adds the captured project file to `org-agenda-files' if the
capture was not aborted."
  ;; Remove the hook since it was added temporarily
  (remove-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)

My code does not touch the other command, my/org-roam-find-project but I think it has the same problem. Replace the part where calling the named function with the lambda function; the same principle should apply by the looks of it (untested).

Maybe this one works. I don’t know. It’s not part of the call stack you listed above (toggle-debug-on-error).

It looks like you copied code from System Crafters. I can’t see what version of Org-roam his code is compatible with. Perhaps you could ask him to update it.

I had ;; -*- lexical-binding: t; -*- in the wrong place.

The init.el must have that at the top of the file.

My final Emacs.org is here with the relevant bit in the Welcome section.

Emacs From Scratch Configuration

Thanks for the assistance!

I see. Thanks for reporting back. Good to know about the difference between the lexical and dynamic bindings. I don’t fully understand the closure and scope but it’s another instance I can use to learn more about them.

I thought it would be good to report back in case someone else has the same issue. Thanks again!

1 Like