(add-menu-item-1): Better error message if
a menu not the last in the path does not exist.
This commit is contained in:
parent
b75f9a7686
commit
6f57a741f9
1 changed files with 2 additions and 0 deletions
|
@ -358,6 +358,8 @@ menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"."
|
||||||
(car (find-menu-item (cdr so-far) (list (car rest))))))
|
(car (find-menu-item (cdr so-far) (list (car rest))))))
|
||||||
(or menu
|
(or menu
|
||||||
(let ((rest2 so-far))
|
(let ((rest2 so-far))
|
||||||
|
(or rest2
|
||||||
|
(error "Trying to modify a menu that doesn't exist"))
|
||||||
(while (and (cdr rest2) (car (cdr rest2)))
|
(while (and (cdr rest2) (car (cdr rest2)))
|
||||||
(setq rest2 (cdr rest2)))
|
(setq rest2 (cdr rest2)))
|
||||||
(setcdr rest2
|
(setcdr rest2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue