How to enter a space in the minibuffer, and not fill the word?

I would like to print from dired-mode using P This is great for the default print command that I set via lpr-switches , but I often want to edit this command. For example, if P offers lpr , I would like to add -o number-up=2 . The problem is that it contains a space after -o and falling into a space gives me No match . How can I configure lpr (or other commands facing the same problem)?

+6
source share
2 answers

In the mini-buffer, space tied to the termination command. If you want to enter the actual '', you need to quote it: Cq <space> . This is a lot for me, so I linked M-<space> to enter the literal space in the minibuffer:

EDIT: next phils comment, the following code snippet is really pointless. You can get the desired behavior with M-space without any bindings.

 (define-key minibuffer-local-completion-map "\M- " (lambda () (interactive) (insert " "))) 
+6
source

You can also bind SPC to self-insert-command in each of the mini-buffers of the mini-buffers. Then you do not need to use Cq .

(In the 21st century, there is no reason to end SPC in the minibuffer. Emacs finally got rid of this residue to complete the file name, but it has not yet received an answer to other kinds of terminations. No printable character should be attached to the command that ends - - they should all be inserted. The inability to insert ? or SPC without using Cq is archaic.)

+2
source

Source: https://habr.com/ru/post/948721/


All Articles