[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to insert space in minibuffer while in completing-read ?
From: |
Brian Adkins |
Subject: |
Re: How to insert space in minibuffer while in completing-read ? |
Date: |
Fri, 7 Mar 2008 15:34:24 -0800 (PST) |
User-agent: |
G2/1.0 |
On Mar 7, 5:09 pm, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > > 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.
Definitely helps - exactly what I was looking for. Thx.