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 19:39:03 +0100 Message-ID: <87r06sin20.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> <87h67obon5.fsf@mail.linkov.net> 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="1139"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 74617@debbugs.gnu.org, monnier@iro.umontreal.ca To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 30 19:40:28 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 1tHSOK-000096-IS for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Nov 2024 19:40:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHSNz-000541-4e; Sat, 30 Nov 2024 13:40: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 1tHSNu-00051d-DQ for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 13:40:02 -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 1tHSNu-0004Ui-35 for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 13:40:02 -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=rxrN2w4mzegmp8RWTdxWuWCnalryR97YA2bKn3QHTkw=; b=NXSH8yQh3aJ9l9LSCdJbR63Si7HnFeIQoL/4TXYZkaJiuMfvIzuEmSar+a6lB8NrXLpyJB8bAgUBTaBm0DhYzEQNnpCu0UDrDV0P9LvzjESqcnW2MadaBJbSxpz9gPIHxSYoshCyMzA+swUy3/ilyTgVktAiL258xYjpWVAsVAmb1jivpTf8QFRxnB2ibiJ7drEvzA2dS9NGsfF82E5gKwms5DIiHrfGG28t4TR/kg6dqeIdVJUKnqG1VnKPG/snZKGEWJTnOlAlsQV6qYi1kBKwqFXfjVa+NoKuTuQBW0/5DZd/W+rcrgudFuUGHNrB2Rf1QVrPzXGjXyLZ1aGFiQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tHSNt-0001d4-Ss for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 13:40: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 18:40: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.17329919546183 (code B ref 74617); Sat, 30 Nov 2024 18:40:01 +0000 Original-Received: (at 74617) by debbugs.gnu.org; 30 Nov 2024 18:39:14 +0000 Original-Received: from localhost ([127.0.0.1]:49022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHSN8-0001be-Aq for submit@debbugs.gnu.org; Sat, 30 Nov 2024 13:39:14 -0500 Original-Received: from server.qxqx.de ([49.12.34.165]:60875 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHSN6-0001bI-3r for 74617@debbugs.gnu.org; Sat, 30 Nov 2024 13:39:13 -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=rxrN2w4mzegmp8RWTdxWuWCnalryR97YA2bKn3QHTkw=; b=RSm9h1hlT2EUft9F/7UStPWOIZ yILVNEqpPamB550CYkfUxa/E228l/nvX1eoL9L7MuwsohQS2QK23izIPCalGxZBqavTk/PRgXx5X/ ZNTzes7dI23cPaT1+iNerenTKjTeE3JnDbI6Bm0zkTscqTljZwufdeqwzADpdX8yeWzE=; In-Reply-To: <87h67obon5.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 30 Nov 2024 19:46:38 +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:296195 Archived-At: Juri Linkov writes: >> The pattern where completion commands want to display candidates >> immediately is not uncommon. There are ffap, tmm and multiple >> third-party packages which have such a requirement. So I suggest to not >> necessarily treat "immediate candidate display" as a bug report, but >> rather as a feature request for `completing-read'. > > And imenu.el calls minibuffer-completion-help conditionally > unless imenu-eager-completion-buffer is not nil. Thanks, I wasn't aware of this option. It seems the behavior is inverted? The completion buffer pops up if imenu-eager-completion-buffer is nil. (defcustom imenu-eager-completion-buffer t "If non-nil, eagerly pop up the completion buffer." :type 'boolean :version "22.1") It is likely that there are more such uses in the Emacs code and other packages. One possible solution would be a display-eager metadata: (completing-read "Test: " (lambda (string pred action) (if (eq action 'metadata) '(metadata (display-eager . t)) (complete-with-action action #'read-file-name-internal string pred)))) This pushes the responsibility of displaying the candidates to `completing-read'. In `completing-read-default' the following code would have to be added to the `minibuffer-with-setup-hook': (when (completion-metadata-get (completion-metadata "" minibuffer-completion-table nil) 'display-eager) (minibuffer-completion-help)) Daniel