From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Tweak to key-description for menu bindings Date: Mon, 28 Feb 2005 13:55:30 +0100 Message-ID: References: <1814.220.255.78.196.1108996512.squirrel@220.255.78.196> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1109596170 15383 80.91.229.2 (28 Feb 2005 13:09:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Feb 2005 13:09:30 +0000 (UTC) Cc: Chong Yidong , rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 28 14:09:30 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D5keI-0000qP-KI for ged-emacs-devel@m.gmane.org; Mon, 28 Feb 2005 14:09:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D5kwe-0003RL-Oi for ged-emacs-devel@m.gmane.org; Mon, 28 Feb 2005 08:28:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D5kqZ-00061n-A6 for emacs-devel@gnu.org; Mon, 28 Feb 2005 08:22:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D5kqX-0005zc-Ao for emacs-devel@gnu.org; Mon, 28 Feb 2005 08:22:01 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D5kpp-0005D9-RA for emacs-devel@gnu.org; Mon, 28 Feb 2005 08:21:17 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D5kR0-0006Pz-Ii for emacs-devel@gnu.org; Mon, 28 Feb 2005 07:55:38 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1D5kQt-0007LG-PP; Mon, 28 Feb 2005 07:55:32 -0500 Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Mon, 28 Feb 2005 13:14:49 +0100") 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33920 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33920 storm@cua.dk (Kim F. Storm) writes: > David Kastrup writes: > >> storm@cua.dk (Kim F. Storm) writes: >> >>> It also improves handling of menu bar entries in two ways: >>> >>> 1) If menu-bar-mode is disabled, it doesn't mention menu bar bindings. >>> >>> 2) It pretty prints menu bar entries like this: >>> e.g. "File Menu" rather than " " >> >> Uh, how is it an improvement to leave off the "New file" information >> from the menu? > > I have been looking further into "menu binding pretty-printing", > and I agree that my previous approach was too narrow-minded. > > I now have a solution where key-description produces a real human > readable text for menu bindings. > > For example, > > (key-description [menu-bar file new-file]) > > now prints > > > > whereas with my patch to key-description, it will print > > File=>New File... > > New: > Options=>Mule (Multilingual Environment)=>Set Coding Systems=>For Next Command > > > Shall I install this? My vote is "yes". However, I would also want to suggest that such pretty-printed key sequences can, as some sort of a general principle, be passed to the kbd macro to make a target for define-key, so that the developer can be spared having to switch on his brain as often as possible. I don't know how feasible this is as kbd is a macro, and the lookup could depend on the keymaps currently active or something. But since kbd is a macro, it could also return a substitution that will do the lookup at runtime depending on the maps then current. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum