]> git.eshelyaron.com Git - emacs.git/commitdiff
(add-menu-item-1): Better error message if
authorRichard M. Stallman <rms@gnu.org>
Sat, 11 Mar 1995 03:55:14 +0000 (03:55 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 11 Mar 1995 03:55:14 +0000 (03:55 +0000)
a menu not the last in the path does not exist.

lisp/emacs-lisp/lmenu.el

index eed3fbb662ebd2e224015e95f541da40a2046500..5bbccbbdab85719e76712e2827d14fe6be594464 100644 (file)
@@ -358,6 +358,8 @@ menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"."
                    (car (find-menu-item (cdr so-far) (list (car rest))))))
            (or menu
                (let ((rest2 so-far))
+                 (or rest2
+                     (error "Trying to modify a menu that doesn't exist"))
                  (while (and (cdr rest2) (car (cdr rest2)))
                    (setq rest2 (cdr rest2)))
                  (setcdr rest2