From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: C-l while in menu? Date: Tue, 23 Apr 2002 10:11:08 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200204231411.g3NEB8Q09176@rum.cs.yale.edu> 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> <5x7kmyhb6d.fsf@kfs2.cua.dk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1019571183 8251 127.0.0.1 (23 Apr 2002 14:13:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 23 Apr 2002 14:13:03 +0000 (UTC) Cc: Miles Bader , 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 17012V-00028y-00 for ; Tue, 23 Apr 2002 16:13:03 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17013i-0005Ag-00 for ; Tue, 23 Apr 2002 16:14:18 +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 17012J-00077d-00; Tue, 23 Apr 2002 10:12:51 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17010z-00072s-00; Tue, 23 Apr 2002 10:11:30 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g3NEB8Q09176; Tue, 23 Apr 2002 10:11:08 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: storm@cua.dk (Kim F. Storm) 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:3112 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3112 > 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)) Looks perfect. Could be just a minor mode. Stefan