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

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

RE: completing-read does not accept spaces (was: Command timeclock-out)


From: Drew Adams
Subject: RE: completing-read does not accept spaces (was: Command timeclock-out)
Date: Thu, 16 Jan 2014 10:13:56 -0800 (PST)

> > I've just noticed that when executing `timeclock-out' and inputting a
> > reason it does not accept spaces.  This command makes use of the
> > function `completing-read'.
> >
> > Is not accepting spaces when entering a reason for clocking out the
> > intended behaviour?
> 
> Reading the docstring of completing-read I see no reason why it should
> not accept spaces. So either the docstring is at fault or there is a bug
> on completing-read. 

No.  The doc to read is (elisp) `Completion Commands', in particular,
about the variables named `minibuffer-local-*-map'.

> Curiously, the function will complete the user's input to a string
> containing spaces if there is one on the collection of candidates:
> (completing-read "say: " (list "hello there"))

Irrelevant here.  As the doc I mentioned says, `SPC' is bound to
`minibuffer-complete-word', and that is what you are seeing.  `SPC' is
not bound to `self-insert-command' here - it is not inserting itself.
It is just completing a "word" at a time.

> Please submit a bug report (M-x report-emacs-bug) against completing-read.

No.  There is no bug here.  This is the behavior by design, like
it or not.

Do I personally think that `SPC' should generally be self-inserting
during completion?  You bet I do.  And so should `?'.  And so should
`C-j' (newline).  (And this is the case in Icicle mode, for instance.)

But that is not the opinion of Emacs Dev.  It took decades to finally
get `SPC' to be self-inserting for file-name completion (see variable
`minibuffer-local-filename-completion-map', in the same Elisp manual
node).  Patience. ;-)



reply via email to

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