From: Andreas Schwab <schwab@suse.de>
Cc: emacs-devel@gnu.org
Subject: Re: Fixed bug in completing-read
Date: Wed, 24 Dec 2003 18:29:35 +0100 [thread overview]
Message-ID: <m3vfo6nmyo.fsf@whitebox.m5r.de> (raw)
Luc Teirlinck <teirllm@auburn.edu> 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" == "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.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next reply other threads:[~2003-12-24 17:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-24 17:29 Andreas Schwab [this message]
2003-12-24 20:03 ` Fixed bug in completing-read Luc Teirlinck
2003-12-25 15:33 ` Richard Stallman
2003-12-25 18:53 ` Luc Teirlinck
-- strict thread matches above, loose matches on Subject: below --
2003-12-18 3:25 Bug " Luc Teirlinck
2003-12-24 3:18 ` Fixed bug " Luc Teirlinck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3vfo6nmyo.fsf@whitebox.m5r.de \
--to=schwab@suse.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).