unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>,
	<michael_heerdegen@web.de>
Cc: 11718@debbugs.gnu.org
Subject: bug#11718: 24.1.50; `all-completions' returns results with wrong case
Date: Sat, 23 Jun 2012 07:18:00 -0700	[thread overview]
Message-ID: <F5C37F739E624CC988480B69ED37858B@us.oracle.com> (raw)
In-Reply-To: <jwvzk7ups04.fsf-monnier+emacs@gnu.org>

> > I have a directory "~/Trash".  If I eval
> >    (let ((completion-ignore-case t))
> >      (all-completions "~/tra" 'read-file-name-internal 
> >                       'file-exists-p nil))
> > in emacs -Q, I get
> >   (#("trash/" 0 3 (face completions-common-part)))
> > Note the wrong lower case of the result.
> 
> While not strictly wrong,

See below.

> it is indeed an undesirable result. 
> I'll try and see how to fix it.
> 
> > Not sure if this is really a bug, but, at least, this change in
> > behavior is documented nowhere, and it causes a completion bug in
> > Icicles.
> 
> Sounds like it hits a real Icicles bug: there are rather few 
> guarantees about the actual case of the returned string when 
> completion-ignore-case is set.  So while we do want to fix the
> problem, code should not assume anything about the particular
> case of the return string (which is only considered to be a
> "cosmetic" issue).

I don't know what the Icicles connection is.

But is it not the case that `completing-read' should return an actual completion
candidate (or a string copy, but with the same case at least)?  If a candidate
is "Trash" and that candidate is chosen then it should not return "trash" or
"TRASH" or "trAsh", no?

Likewise, for `read-file-name': If the actual file-name candidate is "Trash"
then it should not return "trash", no?

I would think this would be true regardless of the value of
`completion-ignore-case'.  That variable should control only completion
_matching_, acting as a filter.  It should not affect/alter the completion
candidate that is returned.

To perform case-insensitive matching it would be permissible as a matching
implementation to uppercase or lowercase everything and then compare.  But such
an implementation should not provide an excuse to _return_ such a massaged
candidate.  The original candidate (or a string copy) should be returned.

`completion-ignore-case' should not affect the result in any way.  That's the
only proper interpretation of "no guarantees wrt the result": it should have no
effect on the result.  It should affect only whether one of the candidates
proposed matches your input.

Returning one of the actual completion candidates (or a `string=' copy), and not
returning its uncle or "halloween" or its mirror image or ... is not a
"cosmetic" issue.  So it seems to me, and I see nothing in either the doc or in
past Emacs behavior to contradict that.  Ignoring case during completion, just
like a PREDICATE arg, has only to do with matching.  Or so it should.






  reply	other threads:[~2012-06-23 14:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 18:58 bug#11718: 24.1.50; `all-completions' returns results with wrong case Michael Heerdegen
2012-06-23  4:38 ` Stefan Monnier
2012-06-23 14:18   ` Drew Adams [this message]
2012-06-23 15:48     ` Stefan Monnier
2012-06-23 21:01       ` Drew Adams
2012-06-24  4:38         ` Stefan Monnier
2012-06-24 14:33           ` Drew Adams
2012-06-24 16:38             ` Stefan Monnier
2012-06-24 20:20               ` Drew Adams
2012-06-25  1:38                 ` Stefan Monnier
2012-06-26  2:17                   ` Michael Heerdegen
2012-06-26 13:06                     ` Stefan Monnier
2012-06-23 19:51     ` Michael Heerdegen
2016-07-08 23:17 ` npostavs

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=F5C37F739E624CC988480B69ED37858B@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=11718@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@iro.umontreal.ca \
    /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).