changeset 38698:0d7cddbc0fa7

(tool-bar-add-item-from-menu): Handle old-style menu definitions.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 06 Aug 2001 10:39:40 +0000
parents a19197c6442f
children c31c8b77d6f5
files lisp/toolbar/tool-bar.el
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/toolbar/tool-bar.el	Mon Aug 06 10:12:17 2001 +0000
+++ b/lisp/toolbar/tool-bar.el	Mon Aug 06 10:39:40 2001 +0000
@@ -1,6 +1,6 @@
 ;;; tool-bar.el --- setting up the tool bar
 ;;
-;; Copyright (C) 2000 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
 ;;
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: mouse frames
@@ -164,8 +164,14 @@
 	(setq submap (eval submap)))
       (unless (image-mask-p image)
 	(setq image (append image '(:mask heuristic))))
-      (define-key-after tool-bar-map (vector key)
-	(append (cdr (assq key (cdr submap))) (list :image image) props)))))
+      (let ((defn (assq key (cdr submap))))
+	(if (eq (cadr defn) 'menu-item)
+	    (define-key-after tool-bar-map (vector key)
+	      (append (cdr defn) (list :image image) props))
+	  (setq defn (cdr defn))
+	  (define-key-after tool-bar-map (vector key)
+	    (append `(menu-item ,(car defn) ,(cddr defn))
+		    (list :image image) props)))))))
 
 ;;; Set up some global items.  Additions/deletions up for grabs.