From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74617: 30.0.92; ffap-menu always displays the *Completions* buffer Date: Sat, 30 Nov 2024 17:25:07 +0100 Message-ID: <87zflgit98.fsf@daniel-mendler.de> References: <87r06turur.fsf@daniel-mendler.de> <86ser99lrd.fsf@gnu.org> <875xo5unlo.fsf@daniel-mendler.de> <86frn99iky.fsf@gnu.org> <8734j9ukju.fsf@daniel-mendler.de> <86v7w47vkn.fsf@gnu.org> Reply-To: Daniel Mendler Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7216"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74617@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 30 17:28:19 2024 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 1tHQKR-0001jU-2Q for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Nov 2024 17:28:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHQKF-00009W-Hh; Sat, 30 Nov 2024 11:28:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHQKA-00009H-5L for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 11:28:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHQK9-0006jw-TF for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 11:28:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=KDgje/6HD2v+Ap5lfeJFPJVlCPpO7rFeYW8CABaUwys=; b=LdNHzdtiUqmszfGjY5afdHIaRBmaAIhUESqEClkWGzCollgByiTgndxUnDgbvmVPg+RV4YmIzwGJJgcoDqTsRQ6mFTFNTlWif5CF8lNgUSLBe1FrecrlBOx0w3x1b0uKkkRQx/UJo7GDSEuBBkVAJ4X2UN/b7uYvfRbZBK6kkEkxUzZ27aY8om0Pt4hKT9D5agx9tC72EyiQY3FiQQYq9dxhdD2tRp1g0b1hJPGStaGZwBTU38tw+4xh6zxTdnvKrfPCXS6g1NZ9r8kkwWb6H52B7OIr2aPkQlfEFNTQk21ejWiLmJkFj+TlNRzSr+kk9CD9rOOhGKxrvqntIYl9Ew==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tHQK9-0002ny-O2 for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 11:28:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Nov 2024 16:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74617 X-GNU-PR-Package: emacs Original-Received: via spool by 74617-submit@debbugs.gnu.org id=B74617.173298405210725 (code B ref 74617); Sat, 30 Nov 2024 16:28:01 +0000 Original-Received: (at 74617) by debbugs.gnu.org; 30 Nov 2024 16:27:32 +0000 Original-Received: from localhost ([127.0.0.1]:48411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHQJf-0002mv-M3 for submit@debbugs.gnu.org; Sat, 30 Nov 2024 11:27:32 -0500 Original-Received: from server.qxqx.de ([49.12.34.165]:42903 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHQJd-0002mg-5B for 74617@debbugs.gnu.org; Sat, 30 Nov 2024 11:27:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KDgje/6HD2v+Ap5lfeJFPJVlCPpO7rFeYW8CABaUwys=; b=lGSHFCy8UuGVdnxkeAhMEKoLvt kFc0fp/ZEBUtkG5MF1oETljxOOqAcCi0u0a89ziHRwxEhchDI24QCuvihZxih0kEE54FwyjT7PWpp YZ6/LvTXB4ZX5beEpFLetqTYhlYMj4KIxPlDAx9h9IZnr0Snrcc21OqyPrP+Ogi81du4=; In-Reply-To: <86v7w47vkn.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Nov 2024 14:30:32 +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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296177 Archived-At: Eli Zaretskii writes: >> From: Daniel Mendler >> Cc: 74617@debbugs.gnu.org, monnier@iro.umontreal.ca >> Date: Sat, 30 Nov 2024 10:40:05 +0100 >> >> Eli Zaretskii writes: >> > Alternatively, we could consider the cases where more than one >> > completion list is shown a bug in the mode which shows the completions >> > even though the application already did. IOW, instead of considering >> > this a problem of the command the user invokes, consider this a bug in >> > the non-default completion UI currently in effect. It is basically a >> > flaw in the design of those completion UIs. >> >> I see it differently. The problem is in the tmm and ffap commands which >> lead to a mixture of completion UIs. Even if another completion UI is in >> effect, the default completion UI is called by tmm and ffap, bypassing >> the `completing-read' abstraction. > > I don't understand: ffap-menu calls completing-read, so what > abstraction does it bypass, and how? It also calls `minibuffer-completion-help' which belongs to the default completion UI but not strictly to the abstract `completing-read' API. Unfortunately the API boundaries are not clearly defined. In principle one could separate the generic `completing-read' code from the default completion UI code. This could help keeping the complexity of the completion code in check. Right now the default completion UI code is scattered across minibuffer.el and simple.el. >> It is not the responsibility of >> alternative completion UIs to work around this. > > Work around what? Hiding the *Completions* buffer. It should not be shown in the first place if the user replaced the `completing-read-function' with something else by turning on the mode of an alternative UI. >> >> Another alternative to auto detection could be that the completion table >> >> communicates to `completing-read' via metadata that immediate candidate >> >> display is desired. The completion UI could then act accordingly. >> >> Default completion would call `minibuffer-completion-help' and Icomplete >> >> could update immediately, ignoring `icomplete-compute-delay'. >> > >> > This sounds too indirect to me, it could cause unintended adverse >> > consequences, especially in nested scenarios. >> >> By using the completion metadata as part of the completion table, the >> effect on nested scenarios is explicitly avoided. Problems with nesting >> only occur if a variable is let-bound around `completing-read'. > > You assume that the completion table is never passed to inner levels? > Is that assumption solid? Yes, as far as I can tell. Completion can work well in recursive minibuffers, such that the inner completion session does not interfere with the outer session. Stefan even changed the scope of the `minibuffer-completion-table' variables a while ago, such that it is only bound buffer-locally in the minibuffer. Earlier it was let-bound around the `read-from-minibuffer' call. (Of course it is still possible to access the completion table by reading the buffer local variable from the minibuffer directly, but this doesn't happen accidentally.)