From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: completing-read does not accept spaces Date: Thu, 16 Jan 2014 10:50:35 -0800 (PST) Message-ID: References: <52d7f748$0$29470$862e30e2@ngroups.net> <8761pj3lek.fsf@wanadoo.es> <871u073han.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389898268 4513 80.91.229.3 (16 Jan 2014 18:51:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jan 2014 18:51:08 +0000 (UTC) To: =?iso-8859-1?B?03NjYXIgRnVlbnRlcw==?= , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 16 19:51:14 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W3s25-0000zx-DK for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Jan 2014 19:51:13 +0100 Original-Received: from localhost ([::1]:34533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3s24-0006Mv-Ir for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Jan 2014 13:51:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3s1i-0006L4-4i for help-gnu-emacs@gnu.org; Thu, 16 Jan 2014 13:50:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3s1Z-0006nJ-HC for help-gnu-emacs@gnu.org; Thu, 16 Jan 2014 13:50:50 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:22456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3s1Z-0006n8-9U for help-gnu-emacs@gnu.org; Thu, 16 Jan 2014 13:50:41 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s0GIobX7017557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 16 Jan 2014 18:50:39 GMT Original-Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s0GIoaid028446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Jan 2014 18:50:37 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s0GIoaqJ028432; Thu, 16 Jan 2014 18:50:36 GMT In-Reply-To: <871u073han.fsf@wanadoo.es> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95451 Archived-At: > >> 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 b= ug > >> on completing-read. > > > > No. The doc to read is (elisp) `Completion Commands', in particular, > > about the variables named `minibuffer-local-*-map'. >=20 > This is terrible. completing-read docstring says > > Read a string in the minibuffer, with completion. >=20 > A string is a string is a string. It doesn't say "a word", or "a > symbol", or "a string without spaces". It says "a string". It should perhaps say something like "Read your input in the minibuffer with completion, and return a string." It says "a string" because that is what `completing-read' returns. But if you find that doc string confusing, then by all means, consider filing a doc bug. =20 > >> 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. >=20 > So by not binding SPC to self-insert-command they are breaking > completing-read stated purpose. The purpose as stated does not say anything about what keys you can type to produce the minibuffer content that gets read. > > 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. >=20 > The docstring is wrong when it says "Read a string". That's a bug, IMO. See above. The input part of the minibuffer (i.e., after the prompt) can be said to be read as a string. But even that is not necessarily accurate. It is certainly not simply read as a Lisp string, in the sense of what function `read' does. But really, I believe what is intended by "Read a string" here is that the minibufer content is possibly completed and then is accepted and interpreted. IOW, this use of "read" is in the general sense of _reading input_. The "as a string" really refers to the fact that what is produced by the act of reading (i.e., what is returned by the function) is a string. But again, if the doc is not clear to you, consider letting Emacs Dev know, by filing a bug report. Perhaps they can improve it to remove the perceived ambiguity. > > 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. ;-) >=20 > Sigh. I know what you mean. Hang in there, Oscar.