From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Qs on key-description, substitute-command-keys Date: Sat, 15 Oct 2005 14:27:57 +0300 Organization: JURTA Message-ID: <878xwvvx36.fsf@jurta.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129377827 23939 80.91.229.2 (15 Oct 2005 12:03:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Oct 2005 12:03:47 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 15 14:03:44 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EQkkW-0004IC-Ot for ged-emacs-devel@m.gmane.org; Sat, 15 Oct 2005 14:02:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQkkW-0004BO-6B for ged-emacs-devel@m.gmane.org; Sat, 15 Oct 2005 08:02:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EQkdW-0002YO-R7 for emacs-devel@gnu.org; Sat, 15 Oct 2005 07:55:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EQkdT-0002Xn-6m for emacs-devel@gnu.org; Sat, 15 Oct 2005 07:55:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQkdR-0002XX-KH for emacs-devel@gnu.org; Sat, 15 Oct 2005 07:55:33 -0400 Original-Received: from [194.126.101.114] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EQkdR-0003vE-O8 for emacs-devel@gnu.org; Sat, 15 Oct 2005 07:55:33 -0400 Original-Received: from mail.neti.ee (80-235-32-180-dsl.mus.estpak.ee [80.235.32.180]) by Relayhost1.neti.ee (Postfix) with ESMTP id 38C4916D1; Sat, 15 Oct 2005 14:55:40 +0300 (EEST) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Fri, 14 Oct 2005 15:53:00 -0700") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee 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:44063 Archived-At: > Also, is there a good way to control which of several key bindings for a > command is output by `substitute-command-keys'? The only way > I've found is to make sure that the one I want is the last of the key > sequences for that command defined in the map - and that's not always > feasible. I found nothing in the manual about which binding is displayed > or how to control that. > > Does anyone know how to control which of several bindings for a command is > displayed by `substitute-command-keys'? There is the same problem for the key suggestion feature activated by `suggest-key-bindings' displaying in the echo area only the "first" key binding which is not always better than other key bindings. A good solution is to suggest all key bindings in the echo area just like `where-is' (`C-h w') does. Perhaps it is not a good solution for `substitute-command-keys' to replace key descriptions with all key bindings since the resulting string might be too long. However, how about introducing a new convention that all strings on which `substitute-command-keys' is used should be designed to reserve enough space for the case when the command is not on any keys, and so `M-x COMMAND' is printed. The size of the command name plus 4 characters of the "M-x " string should define the maximum length of allowed substitutions, and if the command is bound to several key, then to print as many keys as many of them fits into this limit. For example: M-x scroll-left -> defines the maximum 15 characters C-next, C-x < -> both keys fit into 15-characters limit, so replace \[scroll-left] with both keys -- Juri Linkov http://www.jurta.org/emacs/