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: Qs on key-description, substitute-command-keys Date: Sat, 15 Oct 2005 07:54:14 -0400 Message-ID: <878xwvuhwu.fsf-monnier+emacs@gnu.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129377368 22818 80.91.229.2 (15 Oct 2005 11:56:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Oct 2005 11:56:08 +0000 (UTC) Cc: Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 15 13:56:04 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EQkcw-0002Pq-HB for ged-emacs-devel@m.gmane.org; Sat, 15 Oct 2005 13:55:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQkcv-0001yu-Q4 for ged-emacs-devel@m.gmane.org; Sat, 15 Oct 2005 07:55:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EQkcE-0001wE-NP for emacs-devel@gnu.org; Sat, 15 Oct 2005 07:54:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EQkcC-0001s2-11 for emacs-devel@gnu.org; Sat, 15 Oct 2005 07:54:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQkcB-0001rQ-Mc for emacs-devel@gnu.org; Sat, 15 Oct 2005 07:54:15 -0400 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EQkcB-0003rK-SK for emacs-devel@gnu.org; Sat, 15 Oct 2005 07:54:16 -0400 Original-Received: from alfajor ([70.48.83.21]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20051015115414.EBFZ16985.tomts36-srv.bellnexxia.net@alfajor>; Sat, 15 Oct 2005 07:54:14 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 8DD09D7A7E; Sat, 15 Oct 2005 07:54:14 -0400 (EDT) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Fri, 14 Oct 2005 15:53:00 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:44061 Archived-At: > Does anyone know how to control which of several bindings for a command is > displayed by `substitute-command-keys'? There is no way to get this kind of control. `substitute-command-keys' has some rules such as "prefer a binding using plain ascii keys" (so it'll prefer C-x < over C-next, based on the principle that not all terminals have a `next' key and even fewer have a way to generate a C-next event) and "prefer a shorter binding". In Emacs, what we do usually when we need to control which binding to show, is to define `advertized-foo' as an alias for `foo' and then bind the key we want shown to `advertized-foo' (and then use \\[advertized-foo] in the string). I find this to be a bad solution: it interacts very poorly with things like `remap' or `substitute-key-definition' and C-h f `foo' forgets to show the main advertized binding (bummer!). I think we should devise some way to get the desired result without going through contorsions like `advertized-bla'. I haven't thought very deep about how to do that, but the first thing that jumps to my mind is to rely on a `preferred-binding' property (containing a key-sequence) on the command symbol, or otherwise require the use of a menu-item for the main binding and then obey a boolean ":preferred-binding" property placed on the menu-item. Stefan