Text selection with doom emacs in evil mode

Hello everyone,

I just recently started using org-roam and emacs, coming from LogSeq and editorwise from the vim/neovim camp.

I started capturing my fleeting notes and my general notes now with org-roam, created capture templates to distinguish between work and private stuff and that all works pretty good.
But when using org-roam-node-insert, I find emacs to ignore my visual selection. I reckon this has something to do with doom/evil-mode not using the same way vanilla emacs handles selections?

Maybe someone can point me in the right direction to fix this, because this is currently blocking me from completely ditching logseq unfortunately.

best regards,
thrym

What does your “visual selection” mean? Can you show us?

C-v for Visual Selection in evil mode, mark the word with hjkl direction keys
M-x org-roam-node-insert - now I would expect the marked word as preselected, but it ignores the selection as seen here:


After that it’s inserting the link after the marked word when I would instead inspect it to replace the marked word

Unfortunately I could not insert more than one image, hopefully I could explain it with enough detail

I spent more time searching and reading and finally found a way:

What is needed, is the set-mark-command (in my case bound to C-SPC) and then marking the word with hjkl or other vim movements. Then the selection is accepted by org-roam-node-insert.

You are using C-v, which is visual block. If you use just v for your visual selection then org-roam-node-insert should work.

study the function definition

when region-active-p is true - this is true for the situation that you have simply selected the text - even with mouse – this preps the function - it copies the description component from this selection.

then

(if (org-roam-node-id node) is not true - that is such a node doesnt exist –

it sets off

 (org-roam-capture-
             :node node
             :info info
             :templates templates
             :props (append

and so on.

I would investigate why region-active-p is failing for you when you trivially select the text - this is abnormal.

Awesome, thank you all for your input :slight_smile: