emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easymenu.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easymenu.el
Date: Fri, 30 Aug 2002 17:55:07 -0400

Index: emacs/lisp/emacs-lisp/easymenu.el
diff -c emacs/lisp/emacs-lisp/easymenu.el:1.52 
emacs/lisp/emacs-lisp/easymenu.el:1.53
*** emacs/lisp/emacs-lisp/easymenu.el:1.52      Sun Jul  7 05:56:08 2002
--- emacs/lisp/emacs-lisp/easymenu.el   Fri Aug 30 17:55:07 2002
***************
*** 187,197 ****
  return a menu items list (without menu name and keywords).
  This function returns the right thing in the two cases.
  If NAME is provided, it is used for the keymap."
!  (when (and (not (keymapp menu)) (consp menu))
     ;; If it's a cons but not a keymap, then it can't be right
     ;; unless it's an XEmacs menu.
     (setq menu (easy-menu-create-menu (or name "") menu)))
!  (easy-menu-get-map menu nil))                ; Get past indirections.
  
  ;;;###autoload
  (defun easy-menu-create-menu (menu-name menu-items)
--- 187,201 ----
  return a menu items list (without menu name and keywords).
  This function returns the right thing in the two cases.
  If NAME is provided, it is used for the keymap."
!  (cond
!   ((and (not (keymapp menu)) (consp menu))
     ;; If it's a cons but not a keymap, then it can't be right
     ;; unless it's an XEmacs menu.
     (setq menu (easy-menu-create-menu (or name "") menu)))
!   ((vectorp menu)
!    ;; It's just a menu entry.
!    (setq menu (cdr (easy-menu-convert-item menu)))))
!  menu)
  
  ;;;###autoload
  (defun easy-menu-create-menu (menu-name menu-items)
***************
*** 462,468 ****
  (defalias 'easy-menu-remove 'ignore)
  
  (defun easy-menu-add (menu &optional map)
!   "Maybe precalculate equivalent key bindings.
  Do it only if `easy-menu-precalculate-equivalent-keybindings' is on."
    (when easy-menu-precalculate-equivalent-keybindings
      (if (and (symbolp menu) (not (keymapp menu)) (boundp menu))
--- 466,476 ----
  (defalias 'easy-menu-remove 'ignore)
  
  (defun easy-menu-add (menu &optional map)
!   "Add the menu to the menubar.
! This is a nop on Emacs since menus are automatically activated when the
! corresponding keymap is activated.  On XEmacs this is needed to actually
! add the menu to the current menubar.
! Maybe precalculate equivalent key bindings.
  Do it only if `easy-menu-precalculate-equivalent-keybindings' is on."
    (when easy-menu-precalculate-equivalent-keybindings
      (if (and (symbolp menu) (not (keymapp menu)) (boundp menu))
***************
*** 565,579 ****
      (setq submap (cdr submap)))
    submap)
  
- ;; This should really be in keymap.c
- (defun easy-menu-current-active-maps ()
-   (let ((maps (list (current-local-map) global-map)))
-     (dolist (minor minor-mode-map-alist)
-       (when (and (boundp (car minor))
-                (symbol-value (car minor)))
-       (push (cdr minor) maps)))
-     (delq nil maps)))
- 
  (defun easy-menu-get-map (map path &optional to-modify)
    "Return a sparse keymap in which to add or remove an item.
  MAP and PATH are as defined in `easy-menu-add-item'.
--- 573,578 ----
***************
*** 594,600 ****
                                   (list (if (and (symbolp map)
                                                  (not (keymapp map)))
                                             (symbol-value map) map))
!                                (easy-menu-current-active-maps)))))
            ;; Prefer a map that already contains the to-be-modified entry.
            (when to-modify
              (dolist (map maps)
--- 593,599 ----
                                   (list (if (and (symbolp map)
                                                  (not (keymapp map)))
                                             (symbol-value map) map))
!                                (current-active-maps)))))
            ;; Prefer a map that already contains the to-be-modified entry.
            (when to-modify
              (dolist (map maps)




reply via email to

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