From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Key bindings proposal Date: Mon, 30 Aug 2010 08:34:51 -0700 Message-ID: References: <19534.1494.627000.357123@gargle.gargle.HOWL><19537.40472.267000.563053@gargle.gargle.HOWL><87tymlv41y.fsf@mail.jurta.org><8D701A9E7D444011925CB68BF0883D2B@us.oracle.com><87hbikdss4.fsf@mail.jurta.org><87iq2yzvpo.fsf@mail.jurta.org><15A1E47393A44678811B41A238C09E73@us.oracle.com><87wrrd3qot.fsf@mail.jurta.org> <4C77AB35.4010803@gnu.org><87eidjj3zk.fsf@mail.jurta.org> <83vd6vkxfs.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1283182547 1913 80.91.229.12 (30 Aug 2010 15:35:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 30 Aug 2010 15:35:47 +0000 (UTC) Cc: juri@jurta.org, emacs-devel@gnu.org, jasonr@gnu.org To: "'Stefan Monnier'" , "'Eli Zaretskii'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 30 17:35:45 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq6Of-0005ZA-7s for ged-emacs-devel@m.gmane.org; Mon, 30 Aug 2010 17:35:45 +0200 Original-Received: from localhost ([127.0.0.1]:44406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq6Oe-0007Vx-L0 for ged-emacs-devel@m.gmane.org; Mon, 30 Aug 2010 11:35:44 -0400 Original-Received: from [140.186.70.92] (port=57876 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq6OZ-0007UA-6Q for emacs-devel@gnu.org; Mon, 30 Aug 2010 11:35:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq6OY-0003OF-2s for emacs-devel@gnu.org; Mon, 30 Aug 2010 11:35:39 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:56287) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq6OV-0003MX-7r; Mon, 30 Aug 2010 11:35:35 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o7UFZRT4031891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Aug 2010 15:35:29 GMT Original-Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o7UEPgXd023715; Mon, 30 Aug 2010 15:35:26 GMT Original-Received: from abhmt009.oracle.com by acsmt353.oracle.com with ESMTP id 560875961283182494; Mon, 30 Aug 2010 08:34:54 -0700 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 30 Aug 2010 08:34:53 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: ActIVANM6kqWx+d8Qv+0OdeatKzmjAAAYFSw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:129424 Archived-At: > That basically implies that it has to be part of the text (and not as > a text-property). So the scheme using an underscore or some such char > seems to be the way to go. > I see two questions left open: > 1- which char to use (I'd favor _ since it's what's used in the Free > toolkit I happen to know). > 2- how to deal with breaking backward compatibility (e.g. menus which > currently include _). Not really to weigh in here. And I have not been following this with much attention or interest... Just a reminder that dynamically generated menus can contain nearly anything. A buffer name used as a menu item could easily contain `_', as could a function, class, etc. name used as an Imenu menu item. Always treating `_' in a name as an accelerator indicator would be quite limiting and bug-/error-prone, I expect. Typically for this kind of thing (treating a char as special sometimes but not always) some char escaping/unescaping mechanism is used. Jan D. mentioned that `_' could escape an underscore (it does in Gtk+) so that `__' (2 of them) inhibits acting as an accelerator indication. But then there needs to be an unambigous way to specify an underscore itself as an accelerator char. Perhaps `___' (3 or them) could (be made to) do that. How does Gtk+ deal with this? In any case, this stuff needs to be well thought out before going ahead. I'm glad (and surprised) to see that you are concerned about backward compatibility here. ;-) I doubt there is a good way to respect that, however, if the menu-item text itself is changed. (But I also agree about the limitations of using a text property instead of a char.) If a menu item contains an underscore and there was no intention of indicating an accelerator, then there is little or nothing to be done - modulo some way to test the intention (e.g. version of the code that creates the menu item). I see no good way to both (a) respect `_' in old code as _not_ meaning anything special and (b) make `_' (together with an appropriate escape feature) indicate an accelerator. 3rd-party code will just have to adjust, providing two sets of menu items: one that works in old Emacs versions (no accelerator indication) and one that works in new versions. Ugh. And code that dynamically generates menu items would need to be adapted to always DTRT. Ugh. It is also true that introducing a new keyword would complicate code that parses menu items (or keymaps generally).