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#43222: 28.0.50; fido-mode selects wrong buffer to kill when no input Date: Sun, 06 Sep 2020 08:39:20 +0100 Message-ID: <87zh63nyl3.fsf@gmail.com> References: <87ft7wtepz.fsf@iris.silentflame.com> <874kobpesg.fsf@gmail.com> 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="2811"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43222-done@debbugs.gnu.org, larsi@gnus.org To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 06 09:40:10 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 1kEpHV-0000bu-Vt for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Sep 2020 09:40:09 +0200 Original-Received: from localhost ([::1]:39230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEpHV-0004Kt-1x for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Sep 2020 03:40:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEpHO-0004KH-0B for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2020 03:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEpHN-0001ch-NG for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2020 03:40:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kEpHN-0001Dy-LO for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2020 03:40:01 -0400 Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 07:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 43222 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Mail-Followup-To: 43222@debbugs.gnu.org, joaotavora@gmail.com, spwhitton@spwhitton.name Original-Received: via spool by 43222-done@debbugs.gnu.org id=D43222.15993779714662 (code D ref 43222); Sun, 06 Sep 2020 07:40:01 +0000 Original-Received: (at 43222-done) by debbugs.gnu.org; 6 Sep 2020 07:39:31 +0000 Original-Received: from localhost ([127.0.0.1]:44680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEpGt-0001D8-BF for submit@debbugs.gnu.org; Sun, 06 Sep 2020 03:39:31 -0400 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:50921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEpGr-0001Cv-TM for 43222-done@debbugs.gnu.org; Sun, 06 Sep 2020 03:39:30 -0400 Original-Received: by mail-wm1-f42.google.com with SMTP id e17so10314494wme.0 for <43222-done@debbugs.gnu.org>; Sun, 06 Sep 2020 00:39: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=cs66CAgSogcVkLLna8ab11g/eIvs+BkV7dGPo6kQBcg=; b=t9Db6BtJhHWnx5R78dJaMCTOJ9uUPUBJIJGkvrKdwzb0uh4ybPNQ3mfj6c8Ssi51Ag Z081zIDuVvaSgmBaSBelfr2sB7AKjRRa5cHcIgMHG+fyA6xAQxcquG8NU9k4inTRanpj wlwWIuobDCvPyXjl4KLI2vLAtawe8na1+ERypJfY2oh9wFo5IiYtYz3xu0V4PDpQ3+Ne nAi/UUWeEdUgFfj2UFXu1GgqPGSA2dL0SVIhYJKBkp0pOM6wFTpK5Q6wO2Yj/qn23cST Nv8emMG3/1gdMrn290JmznRMVbExTpqvJ23lxwJ+Tizym0LY0mT2jF44f6m/nToFS0gw rpAw== 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=cs66CAgSogcVkLLna8ab11g/eIvs+BkV7dGPo6kQBcg=; b=WgMzqHMoJkmFswH16zSO2yZczreJXDTH6ucVRE01TsmZ4gfvA9IZ+JV0zi4HuqjHmk qC8EeL+6zQzSaex29ZTqc+fEh/Y1jLn6XylsUyzqaZ+/yy3w0SChz/HhAo4rwsTSgt+X QTztc25GZRdeUrOaNE2Ntp5k0/RpxsMubPOUQ/YKRgNlkQHq6jhRYGXMiXp8kXl8VRKR OVvbLm4wVFYc9bfTqa/V8KfZgR7qeqlnexRQOvskg8cbl1gWhieDTqUMsTJtDiBLzNTA bCQZV8Xkiw9nPSa6Vq7s9Q7B1tCzc3PcEIdOHFbN/zHvED+FlFb/CLskmaeIzLPDFQUQ xJIQ== X-Gm-Message-State: AOAM530R5oMh+X1aa7rg2NhCXpQ360pIiYDTSSiq5w0vW0TVMeNfmt67 5Mn2sHvC2PTlQS49Hvo2QA0= X-Google-Smtp-Source: ABdhPJwuy1ijTHXIJfiFA+1/Cysf3d3NeSwfgWiXWNlg9CDUfi5fK4HFBf2C/l7+T8ONaPnrenT51g== X-Received: by 2002:a1c:f70a:: with SMTP id v10mr15203019wmh.39.1599377963912; Sun, 06 Sep 2020 00:39:23 -0700 (PDT) Original-Received: from krug (93.194.137.78.rev.vodafone.pt. [78.137.194.93]) by smtp.gmail.com with ESMTPSA id o6sm20327584wrm.76.2020.09.06.00.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 00:39:22 -0700 (PDT) In-Reply-To: <874kobpesg.fsf@gmail.com> ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sun, 06 Sep 2020 08:03:59 +0100") 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:187312 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > Sean Whitton writes: > >> This is orthogonal to #43120 so far as I can tell. >> >> 1. emacs -q >> 2. M-x fido-mode RET >> 3. C-x C-f ~/src/emacs/lisp/icomplete.el RET >> 4. M-: (find-file (locate-library "icomplete.el.gz")) RET >> 5. C-x b icomplete.el RET >> 6. C-x k [wait for completions] RET|M-j > > Followed your report and confirmed it. Notice that the problem only > happens because the file names share a common prefix: "icomplete.el" > > Maybe the title (and the severity) of this bug should be changed to > reflect that. Do you know how to do that, Lars? > >> The first completion offered by fido-mode is different from the >> default value shown in the minibuffer prompt. > > This sentence indeed describes it. There code is fido-mode to "bubble" > up the default to the first result, but it isn't working for some > reason. I'd say the problem lies somewhere in > icomplete--sorted-completions. I've fixed this in 6fc502c1ef327ab357c971b9bffbbd7cb6a436f1. Author: Jo=C3=A3o T=C3=A1vora Date: Sun Sep 6 08:35:53 2020 +0100 Don't resort Icomplete candidates when default already on top =20=20 Fixes: bug#43222 =20=20 Icomplete mode re-sorts candidates, bubbling the default to top if it's found somewhere down the list. This is done according to two criteria: exact match and prefix match. Before this fix, it didn't take into account the possibility that the exact match for the default would already be on top, and would incorrectly bubble a prefixing completion down the list to the top. This commit fixes that. =20=20 * lisp/icomplete.el (icomplete--sorted-completions): Rework. Recomment.