[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to insert space in minibuffer while in completing-read ?
From: |
Brian Adkins |
Subject: |
How to insert space in minibuffer while in completing-read ? |
Date: |
Fri, 7 Mar 2008 12:41:26 -0800 (PST) |
User-agent: |
G2/1.0 |
I've been using the Emacs timeclock to track my time on various
activities. When I invoke timeclock-in, I'm unable to enter a project
name containing embedded space characters (unless it's already in the
auto complete list by virtue of me manually editing the timelog file
beforehand).
I think I tracked the problem down to the completing-read function
that eventually gets invoked from timeclock-in. I put the following
snippet (from timeclock.el) in the *scratch* buffer and invoked it via
C-M-x
(completing-read "Enter string (default foo): " '("bar" "fuz") nil nil
nil nil "foo")
If I type b <space> the minibuffer will complete to bar, but I can't
then type a space. My temporary work around was to do the following:
(global-set-key (kbd "C-#") (lambda () (interactive) (insert-char ?\s
1)))
and then press C-# instead of <space> while in the minibuffer, and
that works fine :)
I suppose my question is how to unbind the <space> key from the
minibuffer-complete-word command when invoking the timeclock-in
command?
- How to insert space in minibuffer while in completing-read ?,
Brian Adkins <=