From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wanrong Lin Newsgroups: gmane.emacs.bugs Subject: bug#39484: 26.3; try-completion bug Date: Tue, 27 Oct 2020 20:57:30 -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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17111"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 Cc: Lars Ingebrigtsen , Stefan Monnier , 39484@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 28 01:58:16 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 1kXZn5-0004KW-RV for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Oct 2020 01:58:15 +0100 Original-Received: from localhost ([::1]:56762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXZn4-0005ik-T8 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Oct 2020 20:58:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXZms-0005hM-C2 for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2020 20:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34891) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXZms-00089b-2t for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2020 20:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kXZms-0007Dk-2Q for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2020 20:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wanrong Lin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Oct 2020 00:58: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.160384666127729 (code B ref 39484); Wed, 28 Oct 2020 00:58:02 +0000 Original-Received: (at 39484) by debbugs.gnu.org; 28 Oct 2020 00:57:41 +0000 Original-Received: from localhost ([127.0.0.1]:46437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXZmW-0007DB-NX for submit@debbugs.gnu.org; Tue, 27 Oct 2020 20:57:40 -0400 Original-Received: from mail-pj1-f47.google.com ([209.85.216.47]:37121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXZmV-0007Cw-1x for 39484@debbugs.gnu.org; Tue, 27 Oct 2020 20:57:39 -0400 Original-Received: by mail-pj1-f47.google.com with SMTP id lt2so1629798pjb.2 for <39484@debbugs.gnu.org>; Tue, 27 Oct 2020 17:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=udf3mD/u0IbIrSTlelf3/vY4mo4KazqxUPl+FF1yFbE=; b=vVUirPzXJ2Jlf0tk9rjJdxqVXxdvYXhryvdj42nZdblHOQw2cgpva9/X5qoi+Q8Z5m wccyBettEMI70nRuZQYKKaM+PMPcdJVtIkNYT+6OizqKxvN1rQZGd/qGzrLqd1XQD0tF 7dwdqwk7qI+tFhx0V1u8q4G4YbYS4UVRr0EzSxNz0rNOqG3S1kKLRUyK2G81Wsf/3zF0 GO+A6yx4Kxr1BgLCM5gP0iIusZ4lldjzQGzCf9ltHCNUmxdnI9OHewlxTkTucpj7GjGR 5a9WGTK8OJHi2bsDI/6jWg8LSISr+5iSY51e6LEfGPForH8Ua+6wonN77g3hhkjjkMul fj8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=udf3mD/u0IbIrSTlelf3/vY4mo4KazqxUPl+FF1yFbE=; b=nnObu0P2J1I78ZGxVt9qFtzfhxxBuOy9aOyOqRiY5pGRfEnFXThka37vob4sZvPdDG 4PFVLe3yJg1j3OMRDt0UFL12I0sI6aHKcuNuuDr9ttaYsMMU7OsXKIUnodyg0FQT3QIo lpKV3M4DnIOwowYOKVMGHepY8ft3mJDoLnkK67tINrMtVWPZPzJtuYQe6YGRtt4A6P2c ZUy5nCmQub/PcoI6c5TE0JZRXMh0GmelM1kYvB5SOS4hlYisQKpHSFUO6WwxuW8bziMK SceJuT2Nz+fybb1geUgW2sIdLHzUTm+46K36rrxKTPeFSIbpVxXfiTF8sF4rvFNNv++X JRug== X-Gm-Message-State: AOAM530PUv0J9n7kALMArSnYuuj6cMstaWUEhOj3+mP5e/37Z55X5MRa 4+YiTyzYa7RKNCWnMURywXPDWNseMRUC+w== X-Google-Smtp-Source: ABdhPJzFUJUyahb9jT3AIV85Ji2Ra0yQLLq2jHUJIMxTOkn1WbWwoKE8fWieUszST40LoBn9r6XxiA== X-Received: by 2002:a17:902:bc43:b029:d6:711c:1a77 with SMTP id t3-20020a170902bc43b02900d6711c1a77mr844487plz.43.1603846652802; Tue, 27 Oct 2020 17:57:32 -0700 (PDT) Original-Received: from [192.168.2.19] (c-71-226-226-185.hsd1.nj.comcast.net. [71.226.226.185]) by smtp.googlemail.com with ESMTPSA id q189sm3588777pfc.94.2020.10.27.17.57.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Oct 2020 17:57:32 -0700 (PDT) In-Reply-To: Content-Language: en-US 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:191809 Archived-At: I just tried this in Emacs 26.3: (let ((completion-ignore-case t))   (try-completion "abc" '("Abcde" "aBcdf" "abCdg"))) -> "Abcd" The answer is not bad, matching at least one of the candidates. That makes the answer to my original example even more odd: (let ((completion-ignore-case t))        (try-completion "xyz" '("XyzD" "XyzAbc"))        ) ==> "xyz" Why does it matter whether any additional chars follow the user input in the match? Wanrong On 10/27/2020 8:47 PM, Wanrong Lin wrote: > Sorry, I meant "abcd" as the answer for your example. > > On 10/27/2020 8:44 PM, Wanrong Lin wrote: >> For this case, "abc" might be OK, unless you think there is another >> better answer. But in the example I gave, don't you think "Xyz" is >> obviously a better answer than "xyz"? >> >> The argument here is for some examples, the function does not return >> the best answer, and also, does not seem to be consistent to me (for >> those two examples I gave). There might be a reason behind this >> "compromise", or, it might be just an arbitrary decision as >> documented in the comments you gave. If it is the latter, can we >> improve on it? I think those are valid questions. >> >> Wanrong >> >> On 10/27/2020 5:21 PM, Andreas Schwab wrote: >>> So what should (try-completion "abc" '("Abcde" "aBcdf" "abCdg")) >>> return? >>> >>> Andreas. >>> >> >