# Org-roam-capture--prepare-buffer: Wrong type argument: integer-or-marker-p, nil

**URL:** <https://org-roam.discourse.group/t/org-roam-capture-prepare-buffer-wrong-type-argument-integer-or-marker-p-nil/2692>\
**Category:** Troubleshooting\
**Created:** [July 8, 2022, 5:26pm UTC](https://org-roam.discourse.group/t/org-roam-capture-prepare-buffer-wrong-type-argument-integer-or-marker-p-nil/2692 "2022-07-08T17:26:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xanaus](https://avatars.discourse-cdn.com/v4/letter/x/a88e4f/32.png) [@Xanaus](https://org-roam.discourse.group/u/Xanaus)\
**Post date:** [July 8, 2022, 5:26pm UTC](https://org-roam.discourse.group/t/org-roam-capture-prepare-buffer-wrong-type-argument-integer-or-marker-p-nil/2692/1 "2022-07-08T17:26:04Z")

</div>

So I wanted to change the default file naming system so I added the following to my doom config file

```auto
;; Org-roam Template ---------------------------------------------------------------------------------------------------
      org-roam-capture-templates `(("d" "default" plain "%?"
      :target
      (file+head "${slug}.org" "#+title: ${title}\n"
      :unnarrowed t)))

```

After which I reloaded the doom config file. And got this error in the messges buffer

```auto
org-roam-capture--prepare-buffer: Wrong type argument: integer-or-marker-p, nil

```

upon doing a back trace as one of the discord member of the doom server sadid I got the following error

 ![image](https://global.discourse-cdn.com/free1/uploads/orgroam/original/2X/b/b439533215d091d63fadab7093051bf75963ca3d.png)

So How do I fix the `target` issue?

---

<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:** [July 9, 2022, 7:26am UTC](https://org-roam.discourse.group/t/org-roam-capture-prepare-buffer-wrong-type-argument-integer-or-marker-p-nil/2692/2 "2022-07-09T07:26:44Z")

</div>

Missing a closing parenthesis after “${title}\n”:

This worked on my end. Adjust it for your doom. Note the closing parenthesis before `:unnarrowed`.

```auto
(setq org-roam-capture-templates `(("d" "default" plain "%?"
                                    :target
                                    (file+head "${slug}.org" "#+title: ${title}")
                                    :unnarrowed t)))

```

---

<div class="post-metadata">

**Author:** ![Xanaus](https://avatars.discourse-cdn.com/v4/letter/x/a88e4f/32.png) [@Xanaus](https://org-roam.discourse.group/u/Xanaus)\
**Post date:** [July 9, 2022, 8:36am UTC](https://org-roam.discourse.group/t/org-roam-capture-prepare-buffer-wrong-type-argument-integer-or-marker-p-nil/2692/3 "2022-07-09T08:36:51Z")

</div>

Yes that was th mistake!

Is there any way of preserving the case sensitivity of the name That I enter?

Say rt now with the current config if i make a note called “Bakery” it will be created as “bakery” the ‘B’ is saved as ‘b’. Is this possible?

---

<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:** [July 9, 2022, 9:32am UTC](https://org-roam.discourse.group/t/org-roam-capture-prepare-buffer-wrong-type-argument-integer-or-marker-p-nil/2692/4 "2022-07-09T09:32:43Z")

</div>

I suggest that you consider overriding the slug function. A [wiki entry](https://github.com/org-roam/org-roam/wiki/User-contributed-Tricks#overriding-the-slug-function) here as a guide. At the end of the function, the slug gets lowercased. Remove it. That would be one-line change. Or you can create your own function to use, I think.

---

<div class="post-metadata">

**Author:** ![Xanaus](https://avatars.discourse-cdn.com/v4/letter/x/a88e4f/32.png) [@Xanaus](https://org-roam.discourse.group/u/Xanaus)\
**Post date:** [July 9, 2022, 9:37am UTC](https://org-roam.discourse.group/t/org-roam-capture-prepare-buffer-wrong-type-argument-integer-or-marker-p-nil/2692/5 "2022-07-09T09:37:13Z")

</div>

Ok thanks. Is there a way to add certain property values while node is created?

[I found this article](https://org-roam.discourse.group/t/automatically-adding-information-to-org-roam-file-properties/1931), is there any way else to do this?

---

<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:** [July 9, 2022, 10:25am UTC](https://org-roam.discourse.group/t/org-roam-capture-prepare-buffer-wrong-type-argument-integer-or-marker-p-nil/2692/6 "2022-07-09T10:25:39Z")

</div>

You can put them in the template directly. You can call a function too. But I’m not sure why you look for an alternative from the one linked?

---

<div class="post-metadata">

**Author:** ![Xanaus](https://avatars.discourse-cdn.com/v4/letter/x/a88e4f/32.png) [@Xanaus](https://org-roam.discourse.group/u/Xanaus)\
**Post date:** [July 9, 2022, 1:20pm UTC](https://org-roam.discourse.group/t/org-roam-capture-prepare-buffer-wrong-type-argument-integer-or-marker-p-nil/2692/7 "2022-07-09T13:20:57Z")

</div>

Ok will try it out.
