changeset 45133:1fa9ceaa1c5f

(tool-bar-local-item-from-menu): Handle both cases: when the menu item has cached info and when it doesn't.
author Richard M. Stallman <rms@gnu.org>
date Sun, 05 May 2002 03:06:51 +0000
parents c26266baaba5
children b3c10180263b
files lisp/toolbar/tool-bar.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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.