all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Protesilaos Stavrou <info@protesilaos.com>
Cc: "Lars Ingebrigtsen" <larsi@gnus.org>,
	52389@debbugs.gnu.org, "Daniel Martín" <mardani29@yahoo.es>
Subject: bug#52389: 29.0.50; Imenu does not pop up the Completions eagerly
Date: Sun, 12 Dec 2021 19:36:15 +0200	[thread overview]
Message-ID: <86sfuxlo8g.fsf@mail.linkov.net> (raw)
In-Reply-To: <877dcacq2k.fsf@protesilaos.com> (Protesilaos Stavrou's message of "Sun, 12 Dec 2021 08:09:07 +0200")

>> 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:
> <https://gitlab.com/protesilaos/mct/-/issues/12>.

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.





  reply	other threads:[~2021-12-12 17:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 13:32 bug#52389: 29.0.50; Imenu does not pop up the Completions eagerly Protesilaos Stavrou
2021-12-10 11:51 ` Lars Ingebrigtsen
2021-12-10 15:16   ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-11  3:25     ` Lars Ingebrigtsen
2021-12-11 20:16       ` Juri Linkov
2021-12-12  4:58         ` Lars Ingebrigtsen
2021-12-12  6:09         ` Protesilaos Stavrou
2021-12-12 17:36           ` Juri Linkov [this message]
2021-12-13  7:20             ` Protesilaos Stavrou
2021-12-13  8:53               ` Juri Linkov
2021-12-17 11:57                 ` Protesilaos Stavrou
2021-12-17 12:34                   ` André A. Gomes
2021-12-17 12:55                   ` Eli Zaretskii
2021-12-18  7:44                     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86sfuxlo8g.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=52389@debbugs.gnu.org \
    --cc=info@protesilaos.com \
    --cc=larsi@gnus.org \
    --cc=mardani29@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.