NicolasPetton / nroam

Org-roam backlinks within org-mode buffers
GNU General Public License v3.0
108 stars 6 forks source link

Org roam capture templates leads to "Text is read-only." error #3

Closed Whil- closed 3 years ago

Whil- commented 3 years ago

Seems there is interference between nroam and org roam capture templates.

Using org-roam-capture leads to the following printed in the message-buffer:

user-error: Text is read-only.  Please adjust ‘org-roam-capture-templates’

Using a custom daily capture template led to this:

org-roam-capture--fill-template: Text is read-only
NicolasPetton commented 3 years ago

@Whil- I remember seeing that issue some days ago, have you tried with the latest nroam from master?

If you can reproduce the issue with the latest version, could you provide a recipe to reproduce it?

  1. Do you run org-roam-capture on a new file or an existing file? Is the file empty?
  2. Do you use org-roam-capture or org-roam-dailies-capture-today?
Whil- commented 3 years ago

It was possible to reproduce it with a minimal config, using commit 71dad15 (latest as of now).

Using the default templates for org-roam-capture and org-roam-dailies-capture-today gives the two error messages above.

I'm on Emacs 27.1 on this PC, Org roam from master branch. (Configured using Straight)

@NicolasPetton Does it work to run the captures for you?

NicolasPetton commented 3 years ago

@Whil- can you try again with commit eebd4b9?

Whil- commented 3 years ago

Ahh, found the solution!

I see now that you've already fixed this a bit further down the commit tree. I just hadn't noticed it myself.

It was fixed in commit 02a791b

My initialization code needed the same update that you did in the readme:

-(add-hook 'org-mode-hook #'nroam-mode)
+(add-hook 'org-mode-hook #'nroam-setup-maybe)

All is well again, thanks for the help! Tack!

NicolasPetton commented 3 years ago

Cool, I'm glad it's working for you as well.

PS: If you pull the latest changes, you'll see that nroam now includes a section for unlinked references.

cdlm commented 3 years ago

I'm still seing a similar problem when capturing to an org-roam-dailies file. I have the following structure in the file:

* Journal
** 12:34 mid-day stuff
** 23:45 evening stuff
* Backlinks

and it looks like the capture is trying to insert the new ** entry before the line of nroam's * Backlinks instead of after the preceding line… if you see what I mean 😅 (basically it's doing something equivalent to evil-org-open-above from the readonly line, instead of evil-org-open-below from the writable line just above)

Any clue how I can ensure that nroam doesn't get in the way?