Closed emacsomancer closed 2 months ago
That's interesting, I used org-roam-node-insert
many times but I never became conscious that it pastes the text into the minibuffer. So I didn't reproduce that behavior. I must have just subconsciously erased it as clutter, because of course there were always 0 matches.
How do you use it? Select a region that really is a substring of some node that you know you have?
Yes, either a region that's a substring of a node I think I already have, or else one I want to create. (Sometimes I've typed out a bunch of things first, and am going back to add links/nodes.)
Alright, not sure I like it as a default, so I made an alternative command org-node-insert-link*
:)
Using org-node-insert-link*
, I get an error if I try to insert a non-existing node:
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
org-node-insert-link*()
funcall-interactively(org-node-insert-link*)
command-execute(org-node-insert-link*)
edit: actually, I get it with plain org-node-insert-link
too, so perhaps this should be a new issue?
What's your org-node-creation-fn
? I guess org-node-new-by-roam-capture
? Does it happen with all your capture templates or only some?
Yes, I have (setq org-node-creation-fn #'org-node-new-by-roam-capture)
in my config, as per the example.
I'm just trying calling org-node-insert-link(*)
directly, and it happens with both.
The only thing I can think is that I use vertico
and have C-j
setup in order to force enter with a non-match via
....
:bind (:map vertico-map
("C-j" . vertico-exit-input))
...
in my vertico setup.
Then if you turn off vertico-mode, it works?
Hm, it works for me even with that C-j setting. Anyway I wonder where the arrayp check is happening...
Then if you turn off vertico-mode, it works?
No, same thing, even with vertico turned off.
Not sure where the arrayp check comes from.
(It doesn't happen with org-node-find
.)
That is, when you use org-node-find
to create a new node, it works?
Got anything in 'org-node-insert-link-hook
?
Also, got the newest version of this package? :) What's your Emacs version, btw?
Yes, I can create new nodes with org-node-find
.
org-node-insert-link-hook
is nil
.
I updated all packages this morning.
I'm using Emacs 30.0.50, fairly close to master.
Given the function definition, as far as I can tell, it seems that
org-node-insert-link
should (desirably) behave differently if there's an active region (likeorg-roam-node-insert
does), but in practice it seems to ignore the region, at least as far as (pre-)searching the index for selected text/region.