reddit / emacs

How to write spaces in minibuffer?

Rapiz · 2022-11-15 02:41
Whenever I hit the space bar in the minibuffer I get "No match" but I just want to write a space. I need this to add nodes in org-roam with spaces in the name. I was able to write a space on windows with Alt+Space Bar or some combination like this, but now I'm working on Arch Linux and this combination doesn't work. Does someone know how to disable the search for a match on space bar in the config? Edit: Solved by using Arrow Up Key + Arrow Right Key
sickofthisshit · 2022-11-15 03:25
You could also try Control-q and space (In Emacs notation `C-q SPC`). C-q generally is supposed to suppress other interpretations of keys by Emacs. Up-arrow is probably scrolling back through the relevant minibuffer history.
[deleted] · 2022-11-15 05:00
[deleted]
7890yuiop · 2022-11-15 05:05
`M-SPC` is a convenient option (so long as you only need one space). Edit: Oh, but you said... > I was able to write a space on windows with Alt+Space Bar or some combination like this, but now I'm working on Arch Linux and this combination doesn't work. That sounds weird. Which Alt key? Sometimes the right-hand Alt sends a different modifier to the left, in which case you may need to tell your OS to make it act as Meta. Or perhaps your window manager is capturing `M-SPC` before it reaches Emacs. It's common to need to mess with WM key bindings to avoid conflicts with Emacs. What does `C-h k M-SPC` tell you?
Rapiz · 2022-11-15 05:09
Yeah, the right one! M-SPC runs the command just-one-space (found in global-map), which is an interactive native-compiled Lisp function in ‘simple.el’. Thanks!
7890yuiop · 2022-11-15 05:50
So you're seeing `just-one-space` reported, but using that same key sequence is *not* producing a space in the minibuffer? Can you reproduce the same problem when using `emacs -Q` ?
oantolin · 2022-11-15 06:40
By default `SPC` is bound to `minibuffer-complete-word` in `minibuffer-local-completion-map`. If you prefer `SPC` to just insert a space, simply unbind it: (define-key minibuffer-local-completion-map (kbd "SPC") nil)
kennethpbowen · 2022-11-15 11:38
This is how I enter a space in link text while in markdown mode.