unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: doc of prompt change with minor mode for read-key-sequence?
Date: Wed, 13 Sep 2006 13:58:07 -0400	[thread overview]
Message-ID: <jwv1wqfodkm.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <EIENLHALHGIMHGDOLMIMGEFECLAA.drew.adams@oracle.com> (Drew Adams's message of "Wed\, 13 Sep 2006 10\:19\:49 -0700")

>> Does someone know what this is all about, what it is for?
>> (And where in the code it happens?)

>     IIUC this is the so-called "HierarKey" feature (or something
>     like that). To see it in (useful) action, try M-o. I can't
>     figure out from your original report what your minor mode
>     "Foo" does (how is it defined, what does its keymap look
>     like, ...?), so I'm not sure if what you see is the
>     "expected" behavior or a bug.

> Thanks for replying. I'm not sure what you mean - how to try it with M-o.
> Could you provide a short recipe, and mention what to look for?

> Searching for "Hierarkey", I found node Keyboard Menus in the Elisp manual.
> I'm not sure if what I'm describing is a bug - I hope so, because I find the
> behavior confusing, if not incomprehensible for users.

> The doc says that the feature is used "When a prefix key ending with a
> keyboard event (a character or function key) has a definition that is a menu
> keymap". In that case, you can "use the keyboard to choose a menu item."

> However, that is not the case here, I believe. The prefix key does not end
> with a function key that has a menu-keymap definition. It has a definition
> that _belongs_ to a menu keymap, which is not the same thing. And I cannot
> see how someone would/could use this feature in this context - it seems only
> to confuse things, to me. But I'm willing to learn.

> Also, since this feature obviously affects user-observable behavior, it
> should be documented in the Emacs manual. It is not only the implementation
> that is of interest to Emacs-Lisp programmers: Apparently, Emacs users must
> also be aware of this feature.

> As for my code, I have this:
> (define-key key-translation-map [f12]
>   (lookup-key key-translation-map "\C-x8"))

> The minor mode is "Icicles", not "Foo". The minor mode
> (`icicle-mode') and its keymap (`icicle-mode-map')
> are defined here:
> http://www.emacswiki.org/cgi-bin/wiki/icicles-mode.el.

> Here is an outline of the keymap definition:

>   (let ((map (make-sparse-keymap "Icicles")))
>     (define-key map [menu-bar] (make-sparse-keymap))
>     (define-key map [menu-bar icicles] (cons "Icicles" map))
>     ...
>     (define-key map [pause] 'icicle-switch-to/from-minibuffer)
>     (define-key map [f10] 'icicle-execute-menu-command)
>     (push (cons 'icicle-mode map) minor-mode-map-alist)
>     (setq icicle-mode-map map))

> As I indicated, when I do `C-h k' for the `f12' key with the minor mode
> active, the prompt changes to "Icicles: ", and there is no longer any "f12-"
> in the prompt to indicate the prefix.

Looks like a bug indeed.  The interaction of key-translation-map with the
rest of the key lookup and handling is pretty messy.  I'll try and take
a look at it.


        Stefan

  reply	other threads:[~2006-09-13 17:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-12 16:27 doc of prompt change with minor mode for read-key-sequence? Drew Adams
2006-09-13 15:10 ` Richard Stallman
2006-09-13 15:42   ` Drew Adams
2006-09-13 16:45     ` Stefan Monnier
2006-09-13 17:19       ` Drew Adams
2006-09-13 17:58         ` Stefan Monnier [this message]
2006-09-14  2:34         ` Richard Stallman
2006-09-14 15:09           ` Drew Adams
2006-09-18 14:58             ` Richard Stallman
2006-09-18 15:38               ` Drew Adams
2006-09-18 23:39                 ` Richard Stallman
2006-09-22 19:21         ` Stefan Monnier

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=jwv1wqfodkm.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@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).