unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Fixed bug in completing-read
Date: Wed, 24 Dec 2003 14:03:40 -0600 (CST)	[thread overview]
Message-ID: <200312242003.hBOK3el14828@raven.dms.auburn.edu> (raw)
In-Reply-To: <m3vfo6nmyo.fsf@whitebox.m5r.de> (message from Andreas Schwab on Wed, 24 Dec 2003 18:29:35 +0100)

Andreas Schwab wrote:

   "POSITION characters into string" == "at position POSITION in the
   minibuffer" - 1.  String positions are zero-origin, buffer positions
   are one-origin.

To me, the English phrase "POSITION characters into string" is
equivalent with the technical Lisp phrase "at (zero-indexed) position
POSITION - 1 in string".  I could be wrong and, clearly, you
understand it differently.  The one thing this means for certain is
that things should be reformulated more unambiguously, in all involved
places, which I will do.

   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.

Again, to me, the English phrase "POSITION characters from the
beginning" agrees with the behavior of read-from-minibuffer and
contradicts the old behavior of completing-read.  Again, I could be
wrong.  Same remark as above.

Anyway, terminology aside, we have three choices:

1. Adapt `completing-read' to `read-from-minibuffer'.  This is done in
   current CVS.

2. Adapt `read-from-minibuffer' to `completing-read', as you propose.

3. Keep the pre-yesterday behavior and clearly document the difference
   in behavior.

When I first brought this up, I offered to implement either (1) or
(3).  Richard decided on (1).  I could easily implement (2) too, if it
would be decided that this would be better.  In terms of "writing the
code", it just means adding or erasing a + 1 or -1, completely
trivial, and we do not need to undo the moving of the involved code
into read_minibuf, which was necessary, because certain functions
claimed they could handle conses for INITIAL, whereas they could not
(they can now).

Note that (2) would break existing code, just like (1) does, and it
would be equally difficult to find all that code.  (3) does not have
that problem, but the inconsistency is ugly and confusing.

If we decide to stay with (1), I would adapt `read-file-name'.

Maybe it might be good to move the duplicate (but currently, in as far
as I know, consistent) treatment of the HISTORY argument from
`read-from-minibuffer' and `completing-read' into `read_minibuf', as
was done for INITIAl, just to prevent future inconsistencies from
developing. I could easily do so, if desired.

Sincerely,

Luc.

  reply	other threads:[~2003-12-24 20:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-24 17:29 Fixed bug in completing-read Andreas Schwab
2003-12-24 20:03 ` Luc Teirlinck [this message]
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=200312242003.hBOK3el14828@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --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).