Org-roam-node-find space not allowed in node title?

Hi,
when I use org-roam-node-find to create a new node, I’m unable to create titles with spaces in it.
Is this a limitation of org-roam or is there is something wrong with my configuration?

Thank you,
Ingo

  • Emacs: GNU Emacs 27.2.50 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.7 (Build 19H1030))
    of 2021-06-02
  • Framework:
  • Org: Org mode version 9.4.6 (9.4.6-11-g1ee52c-elpaplus @ /Users/irichter/.emacs.d/elpa/org-plus-contrib-20210726/)
  • Org-roam: 2.0.0

I’ve not observed such a limitation. What’s your configuration like, I suspect any templates would be most interesting to share in order to get a good answer.

I didn’t realize that the capture template is used in this case. After removing the capture template from the config it was working. Thanks for the tip :clap:

That was the template that I used to capture from the browser

  (setq org-roam-capture-ref-templates
        '(("r" "ref" plain (function org-roam-capture--get-point)
           "%?"
           :file-name "websites/${slug}"
           :head "#+TITLE: ${title}\n#+roam_key: ${ref}\n#+HUGO_SLUG: ${slug}\n#+roam_tags: website\n#+title: ${title}\n\n- source :: ${ref}\n"
           :unnarrowed t)))

If you are on V2 you might want to read up on how the templates have changed in the documentation.

Yes, I glanced over the documentation, but I need to do read the template section to update my template

1 Like

Hm, I was wrong. That didn’t resolve the issue. I’m able to type this is and then no space will appear after is. Writing some other word and I’m unable to have a space after the word. That is really bizarre and I don’t know what is responsible for that completion behavior

What’s your completion framework?

Ido-mode? Or no completion framework?
If either of them, I believe that’s the standard behaviour (not bizarre from Emacs’ perspective).

You might like to try evaluating this:

(define-key minibuffer-local-completion-map (kbd "SPC") 'self-insert-command)

Source: emacs - How to enter a space in the minibuffer instead of completing a word? - Stack Overflow

It works on my end for Icomplete-mode, Ido-mode, and Emacs stock completion (no completion framework).

Searching this forum for “completion space” can also get you this: Using org-roam with ido, - #8 by nobiot

1 Like

Thank you, bizarre was not the correct word to describe my perception of that misbehavior :wink:
Sometimes, I don’t even know exactly what to call a certain feature or behavior correctly.
Anyway, emacs is a huge learning experience and it keeps going day in, day out.

Your snippet was definitely helping me solve the issue in the minibuffer, and spaces works fine now. That makes navigating and creating links much easier.

If you paste the title rather than typing it into the minibuffer, spaces will be allowed. It might be a goofy hack, but it’s simple enough that I haven’t been motivated to really solve the problem, which I of course share.

A standard hack here too is to use the literal character escape thing. Type C-q and then space. It’s a bit like using \ in a literal string in programming.

I use it all the time to search and replace \n to an actual newline in printed output, typing C-q C-j to get newline.

The detail

quoted-insert is an interactive compiled Lisp function in ‘simple.el’.

It is bound to C-q.

(quoted-insert ARG)

Read next input character and insert it.
This is useful for inserting control characters.
With argument, insert ARG copies of the character.

If the first character you type after this command is an octal digit,
you should type a sequence of octal digits that specify a character code.
Any nondigit terminates the sequence. If the terminator is a RET,
it is discarded; any other terminator is used itself as input.
The variable ‘read-quoted-char-radix’ specifies the radix for this feature;
set it to 10 or 16 to use decimal or hex instead of octal.

In overwrite mode, this function inserts the character anyway, and
does not handle octal digits specially. This means that if you use
overwrite as your normal editing mode, you can use this function to
insert characters when necessary.

In binary overwrite mode, this function does overwrite, and octal
digits are interpreted as a character code. This is intended to be
useful for editing binary files.

1 Like