`org-roam-node-insert` sometiems creates unwanted PROPERTIES drawer

Suppose I am a file called Original, and I highlight some text (the word “New”, let’s say) and run org-roam-node-insert. Sometimes it does what I want, sometimes not.

It behaves exactly as I would like if New already matches the title of a node.

But suppose the node New does not yet exist. In that case, org-roam creates a new file called new.org, with a new ID, and the text I had highlighted becomes a link to the new file. So far so good. But org-roam also inserts an (almost always) useless PROPERTIES drawer in the Original file. The only data it contains is an ID that nothing links to. Every time it does that, I have to delete the PROPERTIES drawer.

Does it do that for everybody? How can I prevent it?

I suspect this is related to user option org-id-link-to-org-use-id.

And I cannot reproduce the issue … not sure what “useless drawer” looks like but I don’t see anything odd on my end.

@JeffBrown you probably need to use the built-in Emacs Profiler. In case you’ve never done that - it’s not that difficult. You just need to start it, repeat actions you’re trying to investigate, stop it and check the report. If you use Doom, it adds a simple function to toggle it on and off, running it for both mem and cpu. I personally prefer the former - for some reason, it shows more data. If you don’t use Doom, you can add the command - it’s tiny, yet very useful.

(defvar doom--profiler nil)

(defun doom/toggle-profiler ()
  "Toggle the Emacs profiler. Run it again to see the profiling report."
  (interactive)
  (if (not doom--profiler)
      (profiler-start 'cpu+mem)
    (profiler-report)
    (profiler-stop))
  (setq doom--profiler (not doom--profiler)))

Please show us what the drawer created is, without seeing it, it is not possible to suggest anything.

Thanks.

Are you in an org roam node when you highlight “New”?

Thanks, @nobiot! Indeed, I was setting org-id-link-to-org-use-id to t. Setting that to nil did the trick. (First I tried simply deleting any mention of it, but it respawned like a zombie in custom-set-variables.)

And thanks to everybody for responding so much faster than I was able to reply to …

1 Like