# HG changeset patch # User Richard M. Stallman # Date 1020568011 0 # Node ID 1fa9ceaa1c5f53beb7d5edecf0719e01759d2ce5 # Parent c26266baaba558c77e016cf3a939cdc838ed85ef (tool-bar-local-item-from-menu): Handle both cases: when the menu item has cached info and when it doesn't. diff -r c26266baaba5 -r 1fa9ceaa1c5f lisp/toolbar/tool-bar.el --- a/lisp/toolbar/tool-bar.el Sun May 05 01:55:25 2002 +0000 +++ b/lisp/toolbar/tool-bar.el Sun May 05 03:06:51 2002 +0000 @@ -208,8 +208,13 @@ (append (cdr defn) (list :image image) props)) (setq defn (cdr defn)) (define-key-after in-map (vector key) - (append `(menu-item ,(car defn) ,(cdr defn)) - (list :image image) props))))))) + (let ((rest (cdr defn))) + ;; If the rest of the definition starts + ;; with a list of menu cache info, get rid of that. + (if (and (consp rest) (consp (car rest))) + (setq rest (cdr rest))) + (append `(menu-item ,(car defn) ,rest) + (list :image image) props)))))))) ;;; Set up some global items. Additions/deletions up for grabs.