From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David PONCE Newsgroups: gmane.emacs.devel Subject: Another easymenu problem Date: Wed, 10 Nov 2004 09:43:22 +0100 (CET) Message-ID: <23643873.1100076202866.JavaMail.www@wwinf0801> Reply-To: david.ponce@wanadoo.fr NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1100076315 13267 80.91.229.6 (10 Nov 2004 08:45:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Nov 2004 08:45:15 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 10 09:45:05 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CRo6D-000217-00 for ; Wed, 10 Nov 2004 09:45:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRoEe-0006GA-HG for ged-emacs-devel@m.gmane.org; Wed, 10 Nov 2004 03:53:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CRoEK-0006FC-Ji for emacs-devel@gnu.org; Wed, 10 Nov 2004 03:53:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CRoEI-0006E3-HJ for emacs-devel@gnu.org; Wed, 10 Nov 2004 03:53:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRoEI-0006Dq-AN for emacs-devel@gnu.org; Wed, 10 Nov 2004 03:53:26 -0500 Original-Received: from [193.252.22.23] (helo=mwinf0804.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CRo4a-0003dJ-8Y for emacs-devel@gnu.org; Wed, 10 Nov 2004 03:43:24 -0500 Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0804.wanadoo.fr (SMTP Server) with SMTP id E0163180004B for ; Wed, 10 Nov 2004 09:43:22 +0100 (CET) Original-Received: from wwinf0801 (wwinf0801 [172.22.139.28]) by mwinf0804.wanadoo.fr (SMTP Server) with ESMTP id D8C5C1800070 for ; Wed, 10 Nov 2004 09:43:22 +0100 (CET) Original-To: emacs-devel@gnu.org X-Originating-IP: [195.75.25.231] X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-REPLYTO: |~| 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: main.gmane.org gmane.emacs.devel:29700 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29700 Hi All, I discovered another problem with easy-menu-get-map that breaks some external libraries like igrep.el. Here is an example of what is failing with the latest CVS version of easymenu.el, and which works as expected in Emacs 21.3: (easy-menu-define my-menu nil "My menu." '("My menu" :active may-be ["An item" do-something :help "Text"])) => nil my-menu => menu-function-35 (easy-menu-add-item nil '("MyMenuBarEntry") my-menu) Fails with: Debugger entered--Lisp error: (wrong-type-argument listp menu-function-35) easy-menu-add-item(nil ("MyMenuBarEntry") menu-function-35) eval((easy-menu-add-item nil (quote ("MyMenuBarEntry")) my-menu)) eval-last-sexp-1(t) eval-last-sexp(t) eval-print-last-sexp() call-interactively(eval-print-last-sexp) I think the problem is in `easy-menu-get-map' which in 21.3 always returns a keymap in its list form, but can return a keymap in a symbol form in latest CVS version. I fixed that with the following patch, however I am not sure it is the right thing to do. So please review. Regards David Index: easymenu.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/easymenu.el,v retrieving revision 1.69 diff -c -r1.69 easymenu.el *** easymenu.el 9 Nov 2004 14:37:09 -0000 1.69 --- easymenu.el 10 Nov 2004 08:04:05 -0000 *************** *** 631,637 **** (apply 'vector (mapcar 'easy-menu-intern path)) (if name (cons name newmap) newmap)) newmap)))) ! (or (keymapp map) (error "Malformed menu in easy-menu: (%s)" map)) map) (provide 'easymenu) --- 631,640 ---- (apply 'vector (mapcar 'easy-menu-intern path)) (if name (cons name newmap) newmap)) newmap)))) ! (if (keymapp map) ! (while (and (symbolp map) (keymapp map)) ! (setq map (symbol-function map))) ! (error "Malformed menu in easy-menu: (%s)" map)) map) (provide 'easymenu)