all messages for Emacs-related lists mirrored at yhetil.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: Tue, 23 Dec 2003 21:18:43 -0600 (CST)	[thread overview]
Message-ID: <200312240318.hBO3IhB14118@raven.dms.auburn.edu> (raw)
In-Reply-To: <200312180325.hBI3PSm02368@raven.dms.auburn.edu> (message from Luc Teirlinck on Wed, 17 Dec 2003 21:25:28 -0600 (CST))

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
concerns the initial position of point in an inserted default string
after entering the minibuffer.  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.

This is now fixed.  There is no change in the (usual) case where
INITIAL is just a string: point appears at the end of the inserted
string.  In nearly all cases where initial is a cons, the purpose was
to make point appear at the _beginning_ of the inserted string.  To
get around the bug, many packages specified a position of 0 instead of
1.  This is *no problem*.  _Any_ integer 1 _or_ less puts point at the
beginning of the string.  The *only* time there is a problem is when
one tries to put point somewhere in the _middle_ of the inserted
string.  In that case, point will now appear one position more to the
_left_ than intended.  This can trivially be fixed by adding 1 to the
formula computing the position.  I fixed the one single example I knew
of.  However, the number of calls to `completing-read' is so huge and
many calls are so complex, that it is impossible to be certain that
there are no other cases.  So, if after entry to the minibuffer, on a
function that provides completion, point appears one position too far
to the left in the pre-inserted string, you know what the problem is
and it is trivial to fix.

Sincerely,

Luc.

  reply	other threads:[~2003-12-24  3:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-18  3:25 Bug in completing-read Luc Teirlinck
2003-12-24  3:18 ` Luc Teirlinck [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-12-24 17:29 Fixed bug " Andreas Schwab
2003-12-24 20:03 ` Luc Teirlinck
2003-12-25 15:33   ` Richard Stallman
2003-12-25 18:53     ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200312240318.hBO3IhB14118@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.