From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: C-l while in menu? Date: 23 Apr 2002 14:06:02 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5x7kmyhb6d.fsf@kfs2.cua.dk> References: <200204072343.g37NhIC20114@aztec.santafe.edu> <200204201727.g3KHRD401381@aztec.santafe.edu> <200204220746.g3M7kvY01878@aztec.santafe.edu> <200204220928.g3M9S9H32293@rum.cs.yale.edu> <3CC40A74.5040600@666.com> <3CC525C5.70400@666.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1019560000 21270 127.0.0.1 (23 Apr 2002 11:06:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 23 Apr 2002 11:06:40 +0000 (UTC) Cc: Ben Wing , Pavel =?iso-8859-1?q?Jan=EDk?= , Stefan Monnier , Richard Stallman , gerd@gnu.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16zy88-0005Wx-00 for ; Tue, 23 Apr 2002 13:06:40 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16zy9H-0000xe-00 for ; Tue, 23 Apr 2002 13:07:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16zy7p-0005V5-00; Tue, 23 Apr 2002 07:06:21 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16zy6o-0005Sf-00; Tue, 23 Apr 2002 07:05:19 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id 5D82D7C047; Tue, 23 Apr 2002 11:05:14 +0000 (GMT) Original-To: Miles Bader In-Reply-To: Original-Lines: 70 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:3094 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3094 Miles Bader writes: > Ben Wing writes: > > the fact is that things work quite well when you have only a meta key. > > e.g. meta+letter is an accelerator only when such a menu exists; > > otherwise, you get the regular binding -- and even then you can > > retrieve the shadowed binding with shift+meta+letter. > > Do people really like this? It sounds astonishly annoying to have > random meta keys stolen by the menus, especially since emacs has many > useful and common commands on M-letter keys. E.g., doesn't the `File' > menu steal `M-f', the `Buffers' menu `M-b', etc.? > > I am skeptical ... So am I. I rarely use the menus, so I definitely don't want any accellerator keys to steal *ANY* of the M- key bindings which are hardwired into my spine after +15 years of emacs usage... On the other hand, I think many new users would expect that M-f would open the File menu, and since he doesn't already know that M-f runs forward-word, he'll probably never be bothered with having to use S-M-f to invoke that command. Personally, I wouldn't mind if I could use S-M-f to open the File menu - but if I'm in message mode, I'd much rather prefer if it opened the Field menu... So, what's the right approach here? Well, at least make the accellerator modifier(s) configurable!!! Default could be 'meta or 'alt or '(shift meta) or nil -- depending on whether we want to help new users (annoying old-timers), or vice versa. BTW, I think most of this logic be implemented in lisp if we just had two built-in functions like (menu-bar-item-matching-p key) -> returns t if menu starting with KEY exists (open-menu-bar-item-matching key) -> opens that menu. Then, in a menu-accell minor mode, we could have code and bindings like (defun menu-accell-check-item () (menu-bar-item-matching-p (this-command-key)) (defun menu-accell-open-item () (interactive) (open-menu-bar-item-matching (this-command-key))) (defcustom menu-accell-modifiers '(meta)) ... for KEY in ?a to ?z do ... (define-key menu-accell-map (vector (append menu-accell-modifiers (list key))) ;; eg M-f '(menu-item "accell" menu-accell-open-item :filter menu-accell-check-item)) If we want another accellerator modifier, simply clear the menu-accell-map and rebuild it using the new accellerator modifier. This can be done automatically in the :set action of menu-accell-modifiers. Just an idea... -- Kim F. Storm http://www.cua.dk