From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: doc of prompt change with minor mode for read-key-sequence? Date: Wed, 13 Sep 2006 13:58:07 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1158170368 5424 80.91.229.2 (13 Sep 2006 17:59:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Sep 2006 17:59:28 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 13 19:59:25 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GNZ0t-0001Bd-OJ for ged-emacs-devel@m.gmane.org; Wed, 13 Sep 2006 19:59:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GNZ0s-0000dx-Vz for ged-emacs-devel@m.gmane.org; Wed, 13 Sep 2006 13:59:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GNZ09-0000Hg-Qs for emacs-devel@gnu.org; Wed, 13 Sep 2006 13:58:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GNZ08-0000H2-4X for emacs-devel@gnu.org; Wed, 13 Sep 2006 13:58:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GNZ07-0000Gv-Vo for emacs-devel@gnu.org; Wed, 13 Sep 2006 13:58:20 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GNZ1t-0000s2-Cl for emacs-devel@gnu.org; Wed, 13 Sep 2006 14:00:09 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 131EC2CEB97; Wed, 13 Sep 2006 13:58:19 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id BD8153FE0; Wed, 13 Sep 2006 13:58:07 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id AA7E04C6D25; Wed, 13 Sep 2006 13:58:07 -0400 (EDT) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Wed\, 13 Sep 2006 10\:19\:49 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59789 Archived-At: >> 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