From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: Fixed bug in completing-read Date: Wed, 24 Dec 2003 18:29:35 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1072287310 5820 80.91.224.253 (24 Dec 2003 17:35:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 24 Dec 2003 17:35:10 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Dec 24 18:35:06 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AZCuY-0000pT-00 for ; Wed, 24 Dec 2003 18:35:06 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AZCuY-0005NW-00 for ; Wed, 24 Dec 2003 18:35:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AZDrN-0002g0-J2 for emacs-devel@quimby.gnus.org; Wed, 24 Dec 2003 13:35:53 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AZDqY-0002NJ-6R for emacs-devel@gnu.org; Wed, 24 Dec 2003 13:35:02 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AZDp7-0001th-Hf for emacs-devel@gnu.org; Wed, 24 Dec 2003 13:34:04 -0500 Original-Received: from [134.76.166.209] (helo=lisa.goe.net) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AZDmr-00011g-Sq for emacs-devel@gnu.org; Wed, 24 Dec 2003 13:31:14 -0500 Original-Received: from mutter.goe.net (mutter-lisa0.a11.local [192.168.31.26]) by lisa.goe.net (8.12.10/8.12.10) with ESMTP id hBOHTbSW000409; Wed, 24 Dec 2003 18:29:38 +0100 Original-Received: from whitebox.a11.local ([192.168.31.90] helo=whitebox.as.local) by mutter.goe.net with esmtp (Exim 4.22) id 1AZCpF-0004Q9-HU; Wed, 24 Dec 2003 18:29:37 +0100 Original-Received: by whitebox.as.local (Postfix, from userid 500) id 9DA2980DBA; Wed, 24 Dec 2003 18:29:36 +0100 (CET) Original-To: Luc Teirlinck X-Yow: LOU GRANT froze my ASSETS!! X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18816 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18816 Luc Teirlinck writes: > I have fixed (in CVS) the bug I in `completing-read' which I reported > in my previous message. Some packages may _rely_ on the bug. This includes read-file-name, when called by find-alternate-file. > In the (rare) case where the INITIAL > argument to `completing-read' is a cons of a string and an integer (as > opposed to just a string),`completing-read' used to put point one > positiom more to the right than `read-from-minibuffer', contradicting > its own documentation string. No, it does not. Compare the doc string of completing-read: If it is (STRING . POSITION), the initial input is STRING, but point is placed POSITION characters into the string. with that of read-from-minibuffer: If INITIAL-CONTENTS is (STRING . POSITION), the initial input is STRING, but point is placed at position POSITION in the minibuffer. "POSITION characters into string" =3D=3D "at position POSITION in the minibuffer" - 1. String positions are zero-origin, buffer positions are one-origin. IMHO the behaviour of read-from-minibuffer is actually what should be changed, because the Elisp manual describes it like this: Alternatively, INITIAL-CONTENTS can be a cons cell of the form `(STRING . POSITION)'. This means to insert STRING in the minibuffer but put point POSITION characters from the beginning, rather than at the end. which matches the (old) behaviour of completing-read, not read-from-minibuffer. Andreas. --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstra=C3=9Fe 5, 90409 N=C3=BCrnberg, Germany Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."