help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to insert space in minibuffer while in completing-read ?


From: Drew Adams
Subject: RE: How to insert space in minibuffer while in completing-read ?
Date: Fri, 7 Mar 2008 14:09:37 -0800

> > I suppose my question is how to unbind the <space> key from the
> > minibuffer-complete-word command when invoking the timeclock-in
> > command?
> 
> C-q SPC

Sure, you can quote each space character with `C-q'. Or you can fix Emacs to
do what you want all the time.

Emacs users should be able to type space chars in minibuffer input. Period.
Emacs 22 finally allows that for file-name input, but it should be available
for all minibuffer input. Input completion is not limited to command names.

Solutions:

1. Use Icicles: http://www.emacswiki.org/cgi-bin/wiki/Icicles.

2. If you don't want to use Icicles, but you do want to allow space chars in
minibuffer input, do this:

 (define-key minibuffer-local-completion-map
             " " 'self-insert-command))
 (define-key minibuffer-local-must-match-map
             " " 'self-insert-command))

Emacs 22 adds the keymaps `minibuffer-local-filename-completion-map' and
`minibuffer-local-must-match-filename-map', but space should already DTRT
there.


You might also want to do the same thing for the `?' character, in the same
maps: (define-key MAP "?" 'self-insert-command), where MAP is as above (plus
the two filename completion maps if you use Emacs 22 or later).

In Icicles, BTW, it is `C-?', not `?', that displays help. Printable
characters like `?' should not need to be quoted to input them.

You might also want to do the same thing for "\n", the newline character.
Icicles does that so you can have multi-line input without resorting to `C-q
C-j' for each newline char.

HTH.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]