unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* easymenu.el bug
@ 2002-08-14 21:48 Vinicius Jose Latorre
  2002-08-15 19:54 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Vinicius Jose Latorre @ 2002-08-14 21:48 UTC (permalink / raw)



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: easymenu.el bug
  2002-08-14 21:48 easymenu.el bug Vinicius Jose Latorre
@ 2002-08-15 19:54 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2002-08-15 19:54 UTC (permalink / raw)
  Cc: emacs-pretest-bug, emacs-devel

This was fixed in the trunk; I will put the same fix in RC.
Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-15 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-14 21:48 easymenu.el bug Vinicius Jose Latorre
2002-08-15 19:54 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).