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: Assignment of misc packages for emacs Date: 06 Jun 2002 01:10:20 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xn0u9l3tv.fsf@kfs2.cua.dk> References: <200205050534.g455YfF01634@aztec.santafe.edu> <5xbsbumexh.fsf@kfs2.cua.dk> <200205141941.g4EJfud15293@aztec.santafe.edu> <5xvg9qmgzt.fsf@kfs2.cua.dk> <200205151927.g4FJRRW26103@rum.cs.yale.edu> <5x3cwr4q7m.fsf@kfs2.cua.dk> <87g00rd74y.fsf@tc-1-100.kawasaki.gol.ne.jp> <87sn4otknt.fsf@tc-1-100.kawasaki.gol.ne.jp> <200205191441.g4JEfMg23080@rum.cs.yale.edu> <200205202134.g4KLYHj26031@aztec.santafe.edu> <200205222227.g4MMRIX29393@aztec.santafe.edu> <87g0030xah.fsf@tc-1-100.kawasaki.gol.ne.jp> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1023315229 29169 127.0.0.1 (5 Jun 2002 22:13:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 5 Jun 2002 22:13:49 +0000 (UTC) Cc: rms@gnu.org, monnier+gnu/emacs@RUM.cs.yale.edu, 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 17Fj2L-0007aM-00 for ; Thu, 06 Jun 2002 00:13:49 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17FjMw-0000ox-00 for ; Thu, 06 Jun 2002 00:35:06 +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 17Fj0f-0000TK-00; Wed, 05 Jun 2002 18:12:05 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 17FiyV-0000J1-00; Wed, 05 Jun 2002 18:09:51 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id BC1787C016; Wed, 5 Jun 2002 22:09:36 +0000 (GMT) Original-To: Miles Bader In-Reply-To: <87g0030xah.fsf@tc-1-100.kawasaki.gol.ne.jp> Original-Lines: 52 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.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:4594 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4594 Miles Bader writes: > Richard Stallman writes: > > Is there any reason we couldn't make it call out to lisp to do the > > formatting? > > > > It's ok with me if someone finds it easy to do. > > What do you think of the appended patch? It moves all the formatting > and prompting for keyboard-menus to lisp (and in the process gets rid > of the one-line-at-a-time interface, since the lisp code just displays > the whole menu at once). > I would suggest that the key-menu-prompt function uses an abnormal hook key-menu-format-entry-function to make it easy to provide alternative formattings of the entries without having to deal with the overall formatting and prompting of the key-menu (which need to be more complex than the current implementation as Stefan has pointed out). Something like: (defvar key-menu-format-entry-function nil "Function called to format key-menu entry. Arguments are: EVENT PROMPT &optional BINDING TOGGLE-TYPE TOGGLE-STATE. If nil, `key-menu-format-entry' is used.") ;; Args correspond to a menu ENTRY. (defun key-menu-format-entry (event prompt &optional binding toggle-type toggle-state) (if (eq event (aref prompt 0)) (format "%s%s" (propertize (char-to-string event) 'face key-menu-event-face) (substring prompt 1)) (format "%s = %s" (propertize (char-to-string event) 'face key-menu-event-face) prompt))) (defun key-menu-prompt (menu) "Display the keyboard-menu MENU, and read the user's response. This function is appropiate for `key-menu-prompt-function', which see." (let* (...) (dolist (entry (cdr menu)) (let* ((entry-prompt (apply (or key-menu-format-entry-function 'key-menu-format-entry) entry)) ... -- Kim F. Storm http://www.cua.dk