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

**URL:** <https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262>\
**Category:** Troubleshooting\
**Created:** [December 7, 2021, 11:20am UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262 "2021-12-07T11:20:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![gluesniffmonkey](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@gluesniffmonkey](https://org-roam.discourse.group/u/gluesniffmonkey)\
**Post date:** [December 7, 2021, 11:20am UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/1 "2021-12-07T11:20:24Z")

</div>

I get the following error:

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

```

When running the following:

```auto
  ("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](https://systemcrafters.net/build-a-second-brain-in-emacs/5-org-roam-hacks/)

My full [Emacs.org](http://Emacs.org) is [here](https://github.com/pauljamesharper/emacs-from-scratch/blob/master/Emacs.org)

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 7, 2021, 1:53pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/2 "2021-12-07T13:53:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gluesniffmonkey](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@gluesniffmonkey](https://org-roam.discourse.group/u/gluesniffmonkey)\
**Post date:** [December 7, 2021, 2:03pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/3 "2021-12-07T14:03:27Z")

</div>

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 7, 2021, 2:20pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/4 "2021-12-07T14:20:18Z")

</div>

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:

```auto
  ;; 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.

---

<div class="post-metadata">

**Author:** ![gluesniffmonkey](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@gluesniffmonkey](https://org-roam.discourse.group/u/gluesniffmonkey)\
**Post date:** [December 7, 2021, 4:41pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/5 "2021-12-07T16:41:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 7, 2021, 4:47pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/6 "2021-12-07T16:47:58Z")

</div>

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

> [@nobiot](#):
>
> ```auto
> (org-roam-node-read
> nil
> (lambda (node)
> (member "Project" (org-roam-node-tags node))
> 
> ```

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

---

<div class="post-metadata">

**Author:** ![gluesniffmonkey](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@gluesniffmonkey](https://org-roam.discourse.group/u/gluesniffmonkey)\
**Post date:** [December 7, 2021, 5:19pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/7 "2021-12-07T17:19:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 7, 2021, 5:52pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/8 "2021-12-07T17:52:45Z")

</div>

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.

```auto
(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:

```auto
(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”.

```auto
(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"))))))

```

 ![Screenshot from 2021-12-07 18-51-57](https://global.discourse-cdn.com/free1/uploads/orgroam/original/2X/0/08f139a80e9a7b4b087ccd217afe6feb8ecc384b.png)

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 7, 2021, 5:57pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/9 "2021-12-07T17:57:24Z")

</div>

Not sure if this is doing anything:

```auto
(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)

```

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 7, 2021, 6:05pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/10 "2021-12-07T18:05:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gluesniffmonkey](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@gluesniffmonkey](https://org-roam.discourse.group/u/gluesniffmonkey)\
**Post date:** [December 8, 2021, 7:51am UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/11 "2021-12-08T07:51:17Z")

</div>

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](http://Emacs.org) is here with the relevant bit in the **Welcome** section.

[Emacs From Scratch Configuration](https://github.com/pauljamesharper/emacs-from-scratch/blob/master/Emacs.org)

Thanks for the assistance!

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [December 8, 2021, 8:08am UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/12 "2021-12-08T08:08:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gluesniffmonkey](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@gluesniffmonkey](https://org-roam.discourse.group/u/gluesniffmonkey)\
**Post date:** [December 8, 2021, 8:18am UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/13 "2021-12-08T08:18:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![arvydas](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@arvydas](https://org-roam.discourse.group/u/arvydas)\
**Post date:** [March 26, 2022, 2:13pm UTC](https://org-roam.discourse.group/t/symbol-s-value-as-variable-is-void-tag-name/2262/14 "2022-03-26T14:13:58Z")

</div>

I had exactly the same issue, thanks for reminding me about ;; -_- lexical-binding: t; -_-.

I use org file as my init file, so I had to put THIS at the very top of my init file:

#+BEGIN\_SRC emacs-lisp  
;; -_- lexical-binding: t; -_-  
#+END\_SRC

And now everything in [this](https://www.youtube.com/watch?v=CUkuyW6hr18) video works as expected.
