From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.devel Subject: easymenu.el bug Date: Wed, 14 Aug 2002 18:48:10 -0300 Sender: emacs-devel-admin@gnu.org Message-ID: <200208142148.g7ELmAs31066@hillux.cpqd.com.br> NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1029361766 19780 127.0.0.1 (14 Aug 2002 21:49:26 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 14 Aug 2002 21:49:26 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17f617-00058v-00 for ; Wed, 14 Aug 2002 23:49:25 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17f6QI-0008IM-00 for ; Thu, 15 Aug 2002 00:15:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17f61z-0000Dy-00; Wed, 14 Aug 2002 17:50:19 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17f60t-0008TK-00 for emacs-devel@gnu.org; Wed, 14 Aug 2002 17:49:11 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17f60q-0008St-00 for emacs-devel@gnu.org; Wed, 14 Aug 2002 17:49:10 -0400 Original-Received: from conde.cpqd.com.br ([200.231.0.49]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17f60n-0008R3-00; Wed, 14 Aug 2002 17:49:06 -0400 Original-Received: from fw-cpqd (dmz-int.cpqd.com.br [200.231.0.35]) by conde.cpqd.com.br (8.11.6/8.11.6) with SMTP id g7ELn3424880; Wed, 14 Aug 2002 18:49:03 -0300 Original-Received: from dragon.cpqd.com.br ([10.202.48.9]) by fw-cpqd; Wed, 14 Aug 2002 18:48:41 -0700 (PDT) Original-Received: from hillux.cpqd.com.br (hillux [10.202.224.35]) by dragon.cpqd.com.br (8.8.8+Sun/8.8.8) with ESMTP id SAA18593; Wed, 14 Aug 2002 18:48:27 -0300 (EST) Original-Received: (from vinicius@localhost) by hillux.cpqd.com.br (8.11.6/8.11.1) id g7ELmAs31066; Wed, 14 Aug 2002 18:48:10 -0300 Original-To: emacs-pretest-bug@gnu.org, emacs-devel@gnu.org Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6542 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6542 Hi, I'm using: GNU Emacs 21.2.90.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2002-05-27 on hillux.cpqd.com.br I found a bug on easy-menu-return-item function of easymenu.el file. It doesn't return the right answer if a menu item exists. For example, if you execute the code below with M-: (easy-menu-return-item (easy-menu-get-map nil '("files")) "print-buffer") Then answer will be nil, but it should return ("print-buffer" . print-buffer). To fix this bug I applied the patch below. Vinicius diff -c easymenu.el.original easymenu.el *** easymenu.el.original Thu May 16 13:23:44 2002 --- easymenu.el Wed Aug 14 18:19:32 2002 *************** *** 517,524 **** (let ((item (lookup-key menu (vector (intern name)))) ret enable cache label) (cond - ((or (keymapp item) (eq (car-safe item) 'menu-item)) - (cons name item)) ; Keymap or new menu format ((stringp (car-safe item)) ;; This is the old menu format. Convert it to new format. (setq label (car item)) --- 517,522 ---- *************** *** 532,538 **** (and (symbolp item) (setq enable (get item 'menu-enable)) ; Got enable (setq ret (cons :enable (cons enable ret)))) (if cache (setq ret (cons cache ret))) ! (cons name (cons 'menu-enable (cons label (cons item ret)))))))) (defun easy-menu-get-map-look-for-name (name submap) (while (and submap (not (or (equal (car-safe (cdr-safe (car submap))) name) --- 530,539 ---- (and (symbolp item) (setq enable (get item 'menu-enable)) ; Got enable (setq ret (cons :enable (cons enable ret)))) (if cache (setq ret (cons cache ret))) ! (cons name (cons 'menu-enable (cons label (cons item ret))))) ! (item ! (cons name item)) ; Keymap or new menu format ! ))) (defun easy-menu-get-map-look-for-name (name submap) (while (and submap (not (or (equal (car-safe (cdr-safe (car submap))) name) Diff finished at Wed Aug 14 18:21:34