From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#52389: 29.0.50; Imenu does not pop up the Completions eagerly Date: Sun, 12 Dec 2021 19:36:15 +0200 Organization: LINKOV.NET Message-ID: <86sfuxlo8g.fsf@mail.linkov.net> References: <87bl1pj44k.fsf@protesilaos.com> <87mtl8znih.fsf@gnus.org> <87h7bfx1p6.fsf@gnus.org> <86h7belwxq.fsf@mail.linkov.net> <877dcacq2k.fsf@protesilaos.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19556"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 52389@debbugs.gnu.org, Daniel =?UTF-8?Q?Mart=C3=ADn?= To: Protesilaos Stavrou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 12 18:43:08 2021 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 1mwSsO-0004tN-Od for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Dec 2021 18:43:08 +0100 Original-Received: from localhost ([::1]:59884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwSsN-000712-Ff for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Dec 2021 12:43:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwSsI-00070u-1j for bug-gnu-emacs@gnu.org; Sun, 12 Dec 2021 12:43:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwSsH-0006Pc-PX for bug-gnu-emacs@gnu.org; Sun, 12 Dec 2021 12:43:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mwSsH-0002VN-Lc for bug-gnu-emacs@gnu.org; Sun, 12 Dec 2021 12:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Dec 2021 17:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52389 X-GNU-PR-Package: emacs Original-Received: via spool by 52389-submit@debbugs.gnu.org id=B52389.16393309489585 (code B ref 52389); Sun, 12 Dec 2021 17:43:01 +0000 Original-Received: (at 52389) by debbugs.gnu.org; 12 Dec 2021 17:42:28 +0000 Original-Received: from localhost ([127.0.0.1]:53026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwSrk-0002UX-1b for submit@debbugs.gnu.org; Sun, 12 Dec 2021 12:42:28 -0500 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:41681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwSri-0002UJ-J2 for 52389@debbugs.gnu.org; Sun, 12 Dec 2021 12:42:27 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 1ADD6200006; Sun, 12 Dec 2021 17:42:18 +0000 (UTC) In-Reply-To: <877dcacq2k.fsf@protesilaos.com> (Protesilaos Stavrou's message of "Sun, 12 Dec 2021 08:09:07 +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:222239 Archived-At: >> This is a good opportunity for generalization. >> Like there is icomplete-show-matches-on-no-input, >> would it be possible to create a new user option >> e.g. minibuffer-auto-show-completions, and allow >> to customize what commands should use it. >> Then it could be like completion-auto-select >> recently proposed by Philip. > > That is possible with my mct package on GNU ELPA. It has the option of > a passlist for commands that should eagerly pop up the Completions' > buffer. > > [ Philip mentioned mct in those patches. ] > > Note, however, that the case here with Imenu is different because even > if you pop the completions eagerly upon M-x imenu, you still need to > handle the case of nested Imenu entries. That is what the user option > imenu-eager-completion-buffer helps deal with. Actually, what prompted > me to report this bug was due to an issue in the mct repo, where I > discovered the confusing doc string of that Imenu user option: > . Thanks for the reference, I see the problem now: after adding ‘imenu’ to mct-completion-passlist, ‘M-x imenu RET’ auto-displays completions correctly. But the problem is that selecting e.g. a nested completion doesn't auto-display the nested completion list, because in the first case ‘this-command’ is ‘imenu’, but in the second case it's a command that selects the nested completion. Fortunately, it's possible to solve this problem using the new variable introduced in 28.1: ‘current-minibuffer-command’ that is like ‘this-command’, but preserves its value during the nested minibuffer activities. To make it backward-compatibile with Emacs 27.1, 'bound-and-true-p' could help to check if the variable is defined, e.g. #+begin_src emacs-lisp ((memq (or (bound-and-true-p current-minibuffer-command) this-command) mct-completion-passlist) #+end_src Then 'imenu' in 'mct-completion-passlist' will be available for the nested minibuffer commands. PS: Overall, your package mct makes progress towards better minibuffer/completions interactions. However, its behaviour can't be enabled by default in Emacs, because e.g. such keys as up/down arrows traditionally are used for history navigation.