emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

easymenu.el bug


From: Vinicius Jose Latorre
Subject: easymenu.el bug
Date: Wed, 14 Aug 2002 18:48:10 -0300

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]