Subject: bug#23129: 25.1.50; Prefix key is not echoed during minibuffer completion

From: Eli Zaretskii <[email-masked]>
Date: Mon, 28 Mar 2016 18:21:26 +0300

> Date: Sun, 27 Mar 2016 15:34:02 -0700 (PDT)
> From: Drew Adams <[email-masked]>
> 
> 0. emacs -Q
> 
> 1. 
> (defvar bar-map nil)
> (define-prefix-command 'bar-map)
> (define-key minibuffer-local-must-match-map "\M-i" 'bar-map)
> (define-key bar-map "\M-z" 'foo)
> (defun foo () (interactive) (message "FOOOOOOOOOOO") (sleep-for 2))
> 
> `M-x M-i'
> Wait a second.  The prefix key `M-i' is NOT echoed.
> `M-z'
> The message from `foo' is shown.
> 
> 2. 
> (global-set-key "\M-l" 'bar-map)
> 
> `M-l'
> Wait a second.  The prefix key `M-l' IS echoed.
> `M-z'
> The message from `foo' is shown.

Is it really necessary to use this complex setup?  Does the following
simple recipe exhibit the same behavior?  (If not, please tell why
not.)

  emacs -Q
  C-x C-f C-x

"C-x C-f" causes the prompt showing the current directory; typing
"C-x" afterwards has no visible effect, whereas you expect it to echo
the usual "C-x-".  Right?

> BUG: The prefix key `M-i' should be echoed during completion.

How do you mean "should"?  AFAICT, this is a deliberate feature: we
only echo the prefix keys when there's nothing in the minibuffer (more
accurately, when the minibuffer level of recursion is zero).  I guess
this is so to avoid confusing prompts or something (Richard, can you
comment on this?), but in any case this is how Emacs worked since
forever.