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: unhelpful menu keybinding notes Date: Mon, 17 Apr 2006 12:29:57 -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 1145291459 13981 80.91.229.2 (17 Apr 2006 16:30:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Apr 2006 16:30:59 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 17 18:30:56 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 1FVWce-0003Sg-SB for ged-emacs-devel@m.gmane.org; Mon, 17 Apr 2006 18:30:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FVWce-0000Yd-BZ for ged-emacs-devel@m.gmane.org; Mon, 17 Apr 2006 12:30:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FVWc2-0000C9-VM for emacs-devel@gnu.org; Mon, 17 Apr 2006 12:30:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FVWc0-0000Ax-UK for emacs-devel@gnu.org; Mon, 17 Apr 2006 12:30:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FVWc0-0000Ar-Qm for emacs-devel@gnu.org; Mon, 17 Apr 2006 12:30:04 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FVWch-0005vc-G2 for emacs-devel@gnu.org; Mon, 17 Apr 2006 12:30:47 -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 A24142CF42A; Mon, 17 Apr 2006 12:30:03 -0400 (EDT) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id EC6B3445C; Mon, 17 Apr 2006 12:29:57 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id E02B77154E; Mon, 17 Apr 2006 12:29:57 -0400 (EDT) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Mon, 17 Apr 2006 08:50:00 -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:52963 Archived-At: > Alternatively, one could put explicit keyboard help strings into the > menus (or have some property for that purpose on the function?). One > might assume that the people with actual "", "", "" > keys would still try using them without being prompted for them. > Yes, this is a general problem with `substitute-command-keys', which we have > discussed before. Whenever there is more than one key sequence bound to a > command, the problem surfaces. > No matter what algorithm is used to choose (ASCII, non-ASCII, shortest, > longest, chords, non-chords, whatever), people will want to be able to > specify the binding to use in the result, and there is no way to do that > now. I hope we will address this after the release and find a good solution. > In my own libraries I sometimes hard-code explicit bindings and sometimes > rely upon \\[...]. The advantage of the former is that you can control what > gets communicated; the disadvantage is that that can be incorrect if the > user has changed the bindings. In some pars of Emacs we use another trick: make and use an alias, like `advertised-undo'. I think this is a bad solution because C-h f undo RET then lists all bindings except for the "advertised" one C-x u. Maybe a better solution is to add a `advertised-binding' property to the function's symbol: (put 'undo 'advertised-binding [?\C-x ?u]) which could be used similarly to the :key-sequence property in menus (i.e. it's used if the key seuqnece is indeed bound to the specified command). Stefan