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#19032: bug#43120: 28.0.50; fido-mode: M-j before completions appear selects wrong choice Date: Thu, 10 Sep 2020 20:15:25 +0100 Message-ID: <87363pv3xu.fsf@gmail.com> References: <8736433l4c.fsf@iris.silentflame.com> <87zh66qoi9.fsf@gnus.org> <87pn72w7j2.fsf@iris.silentflame.com> <87eenifcgr.fsf@gnus.org> <87mu25wqdf.fsf@iris.silentflame.com> <87k0x876ls.fsf@gnus.org> <87k0x8tf1n.fsf@iris.silentflame.com> <87363w2ajd.fsf@gnus.org> <87tuwaoj6g.fsf@gmail.com> <871rjcwsmr.fsf@gmail.com> <87y2ljcaml.fsf@mail.parknet.co.jp> <87k0x2vk4n.fsf@gmail.com> <87ft7qvc0j.fsf@gmail.com> <87lfhh8nyh.fsf@mail.linkov.net> 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="28405"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 19032@debbugs.gnu.org, Stefan Monnier , 43120@debbugs.gnu.org, Lars Ingebrigtsen , OGAWA Hirofumi , Sean Whitton To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 10 21:16:12 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 1kGS3H-000773-NI for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Sep 2020 21:16:11 +0200 Original-Received: from localhost ([::1]:50988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGS3G-0003kq-PW for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Sep 2020 15:16:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGS38-0003kV-RI for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2020 15:16:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGS38-0003q6-IJ for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2020 15:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kGS38-0005pJ-EC for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2020 15:16:02 -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: Thu, 10 Sep 2020 19:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19032 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed Original-Received: via spool by 19032-submit@debbugs.gnu.org id=B19032.159976533622333 (code B ref 19032); Thu, 10 Sep 2020 19:16:02 +0000 Original-Received: (at 19032) by debbugs.gnu.org; 10 Sep 2020 19:15:36 +0000 Original-Received: from localhost ([127.0.0.1]:41236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGS2h-0005o7-Lm for submit@debbugs.gnu.org; Thu, 10 Sep 2020 15:15:35 -0400 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:38680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGS2g-0005nq-KX; Thu, 10 Sep 2020 15:15:35 -0400 Original-Received: by mail-wm1-f42.google.com with SMTP id l9so1483328wme.3; Thu, 10 Sep 2020 12:15:34 -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=YgUdFFn8tPd8XaApra/ASmehqu8CYfqEUHLzfwob9RU=; b=pqMO9xpDjm6easyrF21iAZBUUZFqxeIJZw8ssKhRAV24Idy2tAdwB/8vprA1nzji4a 9kSCg0cEZ+Z2JAqIGfIPQwO9C4HDrya5v0yRQL/GmZik4asC++EOg0t/8XJSQCWShMmi wEUcnBbxYOPHjkL43DuHtxqpT23vJAnv3NcCv/KmKUjOAUKHUHlXCaHi5eoo/9hB7Gzr vtEaShL/Lz2Ujq75X3d/hZtG8LE0LX5nNJPu4Q7Ub/EJ//GPA0kxwX7HN+7CS7q6Rsfk FPSOw+Ug2CI/csJft3UknWNdUaZ1cXV8xy9Hz0RrItExH4jTfwQ4B5fOdOiZ0PMsgZGM qUWg== 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=YgUdFFn8tPd8XaApra/ASmehqu8CYfqEUHLzfwob9RU=; b=NAq4w/H/l+B0DbYVh5ZnXlJXWr5O1lx8fI18oWOhPmXcMqV+6nxmmGnjY7Ey8khkCZ wE29HoCReh3DW4sFdmpGdIieRZWbcv3C/1goeTdo2yMcUKAUUwwjy8a2mnh1WcT7ZHwK NnK9OtfmhE+ZSBgqJ4OwKuPSuDSnkXKR8B+eaSvKDNXEhv53acOKJtfYr1STTT/QXJW3 5Ig2S2m3DMpDj5YOxZRsEXmFXp7khPDoE+jV9ekd6/Zkw90dvHYGVYpSD44m1186Z2mh Ow6JCywVY3NdUvR5qBvvd3wx1shv4uvZaFnwgrFkszOyPXxx1pOPyvt3PNHsh1kLmWVY GREg== X-Gm-Message-State: AOAM531+kzliNQcs8MAotP9R26eW4zNgRnOjDtjlMSlT3VrvA3bk0Omc U+WE4RgoUqlTgpuvdJ+Ehws= X-Google-Smtp-Source: ABdhPJx8SfkZtNB7ADatTSK++Tf895nunkKosR+RnhOs5G7a5r5JmB5ygHW1B3Xda4ziBgY88aB6aw== X-Received: by 2002:a1c:105:: with SMTP id 5mr1586527wmb.83.1599765328631; Thu, 10 Sep 2020 12:15:28 -0700 (PDT) Original-Received: from krug ([89.180.146.237]) by smtp.gmail.com with ESMTPSA id o124sm4849958wmb.2.2020.09.10.12.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 12:15:27 -0700 (PDT) In-Reply-To: <87lfhh8nyh.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 10 Sep 2020 21:51:34 +0300") 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:187761 Archived-At: Juri Linkov writes: >> Though I'm starting to think that when require-match is nil, an >> icomplete user wouldn't want the new icomplete-show-matches-on-no-input >> behaviour anyway. > > This is confusing, I don't understand why behaviour of > icomplete-show-matches-on-no-input should depend on require-match. > > Here are two examples that produce a different result. > > The first example is from hi-lock-read-face-name: > > (defvar hi-history nil) > (icomplete-mode) > (let ((icomplete-show-matches-on-no-input t) > (defaults '("hi-yellow" "hi-green")) > (hi-history '("hi-blue"))) > (completing-read > (format-prompt "Highlight using face" (car defaults)) > obarray 'facep t nil 'hi-history defaults)) > > displays this prompt: > > Highlight using face (default hi-yellow): {link | menu | bold ... > > Typing RET returns "link" (and sometimes returns "hi-blue" from the histo= ry), > but never returns the expected default value "hi-yellow". > > Whereas the second example from tab-bar-switch-to-tab > works correctly since its arg require-match is nil: > > (let ((icomplete-show-matches-on-no-input t) > (defaults '("yellow" "green")) > (hi-history '("blue"))) > (completing-read > (format-prompt "Switch to tab by name" (car defaults)) > defaults nil nil nil 'hi-history defaults)) > > displays this prompt: > > Switch to tab by name (default yellow): {green | yellow} > > Typing RET returns the default value "yellow", not the first candidate "g= reen". > > This makes the behaviour of icomplete-show-matches-on-no-input > unpredictable, and thus in some cases dangerous. I think I agree, but I've just tested this with the version of icomplete.el before I started messing with this stuff (commit c8472cc69d4bce7f53c9a62966245a4de3d99fbd) and I get exactly the same results as you. So I'd leave my work here for someone else to pick up on: To be clear, I just wanted to simplify/refactor the code to be less intrusive on minibuffer.el. I'm not much of an icomplete-mode user, more of a fido-mode user where these discrepancies are "fixed" by copying ido-mode's behaviour. Jo=C3=A3o