From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#39484: 26.3; try-completion bug Date: Wed, 28 Oct 2020 12:34:00 -0400 Message-ID: References: <874kmf1peq.fsf@gnus.org> <87361zbi5x.fsf@igel.home> <87h7qfzdf8.fsf@gnus.org> <87y2jr9zwt.fsf@igel.home> <8fed8748-8331-5ca7-6c91-108c27945bb2@gmail.com> <87tuuf9xgp.fsf@igel.home> <87ft5y3i17.fsf@igel.home> <87tuuevgl2.fsf@gnus.org> <87zh461yas.fsf@igel.home> <87lffqvfvk.fsf@gnus.org> <87v9eu1xon.fsf@igel.home> <87tuuetxbb.fsf@gnus.org> <87lffq1snn.fsf@igel.home> <44009e48-c8b7-72c1-b505-4308d84c24e7@gmail.com> <962e72d1-451f-7725-a22c-e35b4a5784b1@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22580"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , Andreas Schwab , 39484@debbugs.gnu.org To: Wanrong Lin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 28 17:35:32 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXoQ8-0005jt-EF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Oct 2020 17:35:32 +0100 Original-Received: from localhost ([::1]:59916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXoQ7-00039d-FU for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Oct 2020 12:35:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXoPe-000305-Ln for bug-gnu-emacs@gnu.org; Wed, 28 Oct 2020 12:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXoPe-0008Vi-Bx for bug-gnu-emacs@gnu.org; Wed, 28 Oct 2020 12:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kXoPe-0004Xm-8l for bug-gnu-emacs@gnu.org; Wed, 28 Oct 2020 12:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Oct 2020 16:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39484 X-GNU-PR-Package: emacs Original-Received: via spool by 39484-submit@debbugs.gnu.org id=B39484.160390285017392 (code B ref 39484); Wed, 28 Oct 2020 16:35:02 +0000 Original-Received: (at 39484) by debbugs.gnu.org; 28 Oct 2020 16:34:10 +0000 Original-Received: from localhost ([127.0.0.1]:50336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXoOn-0004WR-MB for submit@debbugs.gnu.org; Wed, 28 Oct 2020 12:34:10 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXoOm-0004W3-4D for 39484@debbugs.gnu.org; Wed, 28 Oct 2020 12:34:08 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9E229440B5C; Wed, 28 Oct 2020 12:34:02 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 52C00440AD7; Wed, 28 Oct 2020 12:34:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1603902841; bh=fh4uZKVsO1btTZvYf3ZdoyS3KLqj2nCP6tzgC0r0v8k=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=bWuR8Nl2OCHisFWxqsbun+VUvZka+Jm9sRtWdEArQZWJKFdMIkDQwh+RUswpW0cOU SzjhxNNRp1uNlG2Joy87c9ltsO2Q7mzmNWQ193nEvCqp2PNii5A8VdRDU9Dv+G5+tT 9pTt+8ntZDwn/XB7l+jYs/3fxo9FzNu6TgWGmG3EpdausWYWK2ha94hpzg9iPEp7v7 wFhMwMrT9+e3BvGfOeVM8h++iDeBe2GJIyJFlOgR3/h4HPaHV1p6FqhGcDLOKl+T6c Kiyz414OJdWGylUPFLFlzTIO0kZ61DS246MBJfFGhFbr6WCtZAyt3W9qxuMUHjIAkP sNHxqjaWuPXjw== Original-Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 10F62120298; Wed, 28 Oct 2020 12:34:01 -0400 (EDT) In-Reply-To: <962e72d1-451f-7725-a22c-e35b4a5784b1@gmail.com> (Wanrong Lin's message of "Wed, 28 Oct 2020 11:47:34 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:191898 Archived-At: > The examples I gave are real life situations. All the examples I see are of the "abcd" or "xyz", i.e. made up examples. I understand they are meant to illustrate real-life examples, but they are not themselves real life. > 1. x is a prefix of y, ignoring case. > 2. y is the maximum common prefix, ignoring case, among all candidates That's what is guaranteed by the semantics, so our code already does that (barring bugs). > 3. y is the *exact* (including case) prefix of at least one of the > candidates We could try that, indeed. It still satisfies the constraint I described as "conservative", and it wouldn't cost extra efforts either. If someone wants to try that, feel free to do so, but I personally would prefer if we only do that when all the matching candidates agree on the capitalization. BTW, we currently have the following tests in test/src/minibuffer-tests.el: (ert-deftest test-try-completion-ignore-case () (let ((completion-ignore-case t)) (should (equal (try-completion "bar" '("bAr" "barfoo")) "bAr")) (should (equal (try-completion "bar" '("bArfoo" "barbaz")) "bar")) (should (equal (try-completion "bar" '("bArfoo" "barbaz")) (try-completion "bar" '("barbaz" "bArfoo")))) ;; bug#11339 (should (equal (try-completion "baz" '("baz" "bAz")) "baz")) ;And not `t'! (should (equal (try-completion "baz" '("bAz" "baz")) (try-completion "baz" '("baz" "bAz")))))) -- Stefan