From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#42149: Substring and flex completion ignore implicit trailing =?UTF-8?Q?=E2=80=98any=E2=80=99?= Date: Wed, 01 Jul 2020 12:03:20 +0100 Message-ID: <87k0znsdjb.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23898"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 42149@debbugs.gnu.org To: Dario Gjorgjevski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 01 13:04:09 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 1jqaXA-00067f-Qr for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Jul 2020 13:04:08 +0200 Original-Received: from localhost ([::1]:50582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqaX9-0003Ep-O4 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Jul 2020 07:04:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqaX4-0003EH-2Y for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2020 07:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jqaX3-0004EC-PT for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2020 07:04:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jqaX3-00046G-LK for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2020 07:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Jul 2020 11:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42149 X-GNU-PR-Package: emacs Original-Received: via spool by 42149-submit@debbugs.gnu.org id=B42149.159360141015717 (code B ref 42149); Wed, 01 Jul 2020 11:04:01 +0000 Original-Received: (at 42149) by debbugs.gnu.org; 1 Jul 2020 11:03:30 +0000 Original-Received: from localhost ([127.0.0.1]:52377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqaWX-00045Q-R4 for submit@debbugs.gnu.org; Wed, 01 Jul 2020 07:03:30 -0400 Original-Received: from mail-wr1-f50.google.com ([209.85.221.50]:36699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqaWX-00045C-2p for 42149@debbugs.gnu.org; Wed, 01 Jul 2020 07:03:29 -0400 Original-Received: by mail-wr1-f50.google.com with SMTP id k6so23359804wrn.3 for <42149@debbugs.gnu.org>; Wed, 01 Jul 2020 04:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=ZN2zfyQr5gI/cr8jhIzIq6UOMYk41O6BDjDqmgILs2c=; b=oq3fcEGVtr6NycHGsu9+y9MSbwGzwQj9FOTEUMZOQwTkycbQSqJH5RD7Zx4QuZi0sI GcegYFLyNXHF0FMQdOPDVlVYMKou2W0ozSk3neHOABGcgBqctelvcE8e7QAw4rRYs8LP MHiuHDiYhv/lSny6u9diaQ+CsQMYNqMq12GLQuJAwBBa35h93NB8I6oBtiaKvuJV5/om j9AJ/b98fZmUHeocNGO9TBsp3t7Q95mpqJ7NRHKpPlmokUJ9UWetnk5CFZOaxVao4I+3 9PKguIktWklEZShHO53k35zIL0JQRoTXZvqxsFNQ2xbMjwRMvb399bYZiuBC+RZP+sTT Tf9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=ZN2zfyQr5gI/cr8jhIzIq6UOMYk41O6BDjDqmgILs2c=; b=kPLPnQQIV0lrE1rgvH5QNerVPlXZPRSTwup1MW+CupGRRku8KCazHavxXK7rcOQVok 0nRZ55mmUt9LlDJ46jOyJIDzsbOYIT3Nq/AsvENU6fQRQ7NoMGkSgSyyjayC+AqQfFbA ZAOpDcKcdBxC91TZBqNKSGJP2KlLb38bexyBhnamJg14loQZj1qqbT7f41bsQDw4gUCO V29Rl/qsglW3a8JmEmyJWLFs8aNDImBbMRTk51dtEvGd6pcckSf2M7J18p/rjdl2fp9Y 3c89G89UZkAurEIRff+09lMhDMJnC326J85gLY3fyGOSK2oAjgtW2UsTkmrx8Pq/c80M IUCA== X-Gm-Message-State: AOAM533672tVy1liBaC/o+NcD6aaYp7x2nd550fTz1NnQ5aSV4otGQOy OoHZvvZALLJlzubKWw3DfPrntx/f X-Google-Smtp-Source: ABdhPJysSB30FPGfd/375WR7T0eKL9GHhJ7iGgO4svhVdOnMPtxBPrsBj8r+x51KKsM+nCbP3JY+MA== X-Received: by 2002:adf:9148:: with SMTP id j66mr24091058wrj.311.1593601402995; Wed, 01 Jul 2020 04:03:22 -0700 (PDT) Original-Received: from krug ([89.180.158.80]) by smtp.gmail.com with ESMTPSA id c5sm6659587wmb.24.2020.07.01.04.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2020 04:03:22 -0700 (PDT) In-Reply-To: (Dario Gjorgjevski's message of "Wed, 01 Jul 2020 12:40:42 +0200") 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:182598 Archived-At: Dario Gjorgjevski writes: > > Hi, > > > > I have found out that substring and flex completion ignore the implicit > > trailing =E2=80=98any=E2=80=99 introduced by =E2=80=98completion-pcm--o= ptimize-pattern=E2=80=99. This > > is evident from the examples shown next. > > > > My Emacs version is 28.0.50, built on 2020-07-01 from commit e98ddd6fc1. > > > > Example 1 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > (completion-substring-all-completions "f" (list "f") nil 1) > > > > and > > > > (completion-flex-all-completions "f" (list "f") nil 1) > > > > both result in > > > > (#("f" 0 1 (face completions-common-part completion-score 0.0)) . 0) > > > > whereas I would expect a completion score of 1. > > > > Example 2 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > (completion-substring-all-completions "fo" (list "fo") nil 1) > > > > results in > > > > (#("fo" 0 1 (face completions-common-part completion-score 0.5) 1 2 > > (face (completions-first-difference completions-common-part))) . 0) > > > But does the problem also manifest itself with two-character > completions? I.e. is the 0.5 perfect match for "fo" (in the example you > gave) ever surpassed by another, presumably less good, match? Answering my own question, the answer seems to be "no". (completion-substring-all-completions "fo" (list "f" "fo" "foot") nil 1) (#("fo" 0 1 (face completions-common-part completion-score 0.5) 1 2 (face (completions-first-difference completions-common-part))) #("foot" 0 1 (face completions-common-part completion-score 0.25) 1 2 (face (completions-first-difference completions-common-part))) . 0) But indeed there is the problem of the 1-long. And the problem is that _every_ completion gets 0. (completion-substring-all-completions "f" (list "f" "fo" "foot") nil 1) (#("f" 0 1 (face completions-common-part completion-score 0.0)) #("fo" 0 1 (face completions-common-part completion-score 0.0) 1 2 (face completions-first-difference)) #("foot" 0 1 (face completions-common-part completion-score 0.0) 1 2 (face completions-first-difference)) . 0) I still don't know what the proper fix this, just adding some information I think is relevant. Thanks, Jo=C3=A3o