unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>, Drew Adams <drew.adams@oracle.com>,
	Richard Stallman <rms@gnu.org>
Cc: 23129@debbugs.gnu.org
Subject: bug#23129: 25.1.50; Prefix key is not echoed during minibuffer completion
Date: Mon, 28 Mar 2016 09:00:35 -0700 (PDT)	[thread overview]
Message-ID: <5a83c42d-50c1-4217-b1dd-506814a7ed34@default> (raw)
In-Reply-To: <<83shzay6fd.fsf@gnu.org>>

> > 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?

Complicated?  It is intended to be clear and sufficient.
Can you not reproduce the problem using that recipe?

If you think the same bug can be repro'd another way, fine.

> 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?

Is `C-x' a prefix key in `minibuffer-local-filename-completion-map'
at that point?  Yes, but not directly.  So this is not quite the
same as what I reported.  But if you think it adequate to show the
problem, fine.

But consider also this:

M-x C-(

You see the message "C-( is undefined" for a second or so.
`minibuffer-message' is presumably used to show this message.

This shows Emacs's intention to provide help to users by echoing
stuff even when the minibuffer is active.  There is nothing odd
about this.  It is helpful, not harmful.

> > BUG: The prefix key `M-i' should be echoed during completion.
> 
> How do you mean "should"?

How do I mean "should"?  Should.  It is helpful for a user
(as well as consistent) to echo the prefix keys s?he hits.

> AFAICT, this is a deliberate feature:

Do you have evidence for that?  If so, I'll argue that that
is a misfeature (design bug).  If not, I'll argue that it is
an oversight (implementation bug).

I suspect it is an oversight, but I could be wrong.

> we only echo the prefix keys when there's nothing in the
> minibuffer (more accurately, when the minibuffer level of
> recursion is zero).

That's the bug.  Whether deliberate or by accident, it is not
helpful behavior.

We echo lots of things when the minibuffer is active.  That's
what we have `minibuffer-message' for.

> 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.

Yes, I know the bug is longstanding.  And as long as we're
guessing, I guess it is an oversight.

I also know that Emacs itself has so far not bound many keys
in minibuffer keymaps.  But that has changed in the wider Emacs
world.  My guess is that vanilla Emacs never even considered
the use case of prefix keys bound in minibuffer keymaps.

A user hitting a prefix key during minibuffer input has just as
much need to see that echoed as s?he does when hitting a prefix
key at top-level.  I see no reason not to echo it.  It is not
good interaction for users to see nothing happen when they hit
keys, especially if those keys are bound and they do, in fact,
have an (unreported) effect.


[FWIW, in Icicles I echo prefix arguments (e.g. `C-u', `M-7')
used during minibuffer input.  And you can apply a prefix arg to
individual candidates.  Without such echoing, this interaction
would be less helpful and more confusing than it needs to be.
I haven't seen (or really looked for) a way to echo prefix keys
as well, or else I would have done that also.]





       reply	other threads:[~2016-03-28 16:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<e28dfa52-d2e2-40ae-80e2-112b30cdad25@default>
     [not found] ` <<83shzay6fd.fsf@gnu.org>
2016-03-28 16:00   ` Drew Adams [this message]
2016-03-28 16:16     ` bug#23129: 25.1.50; Prefix key is not echoed during minibuffer completion Eli Zaretskii
2022-01-24 11:07       ` Lars Ingebrigtsen
     [not found] <<<e28dfa52-d2e2-40ae-80e2-112b30cdad25@default>
     [not found] ` <<<83shzay6fd.fsf@gnu.org>
     [not found]   ` <<5a83c42d-50c1-4217-b1dd-506814a7ed34@default>
     [not found]     ` <<83io06y3vi.fsf@gnu.org>
2016-03-28 17:32       ` Drew Adams
2016-04-08 15:56         ` Drew Adams
2016-04-08 16:03           ` Eli Zaretskii
2016-03-27 22:34 Drew Adams
2016-03-28 15:21 ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=5a83c42d-50c1-4217-b1dd-506814a7ed34@default \
    --to=drew.adams@oracle.com \
    --cc=23129@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rms@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).