+ (fset command (list 'lambda () '(interactive) callback)))
+ (put command 'menu-alias t)
+ (let ((i 2))
+ (while (< i (length item))
+ (cond
+ ((eq (aref item i) ':active)
+ (put command 'menu-enable
+ (or (aref item (1+ i))
+ 'make-lucid-menu-keymap-disable))
+ (setq i (+ 2 i)))
+ ((eq (aref item i) ':suffix)
+ ;; unimplemented
+ (setq i (+ 2 i)))
+ ((eq (aref item i) ':keys)
+ ;; unimplemented
+ (setq i (+ 2 i)))
+ ((eq (aref item i) ':style)
+ ;; unimplemented
+ (setq i (+ 2 i)))
+ ((eq (aref item i) ':selected)
+ ;; unimplemented
+ (setq i (+ 2 i)))
+ ((and (symbolp (aref item i))
+ (= ?: (string-to-char (symbol-name (aref item i)))))
+ (error "Unrecognized menu item keyword: %S"
+ (aref item i)))
+ ((= i 2)
+ ;; old-style format: active-p &optional suffix
+ (put command 'menu-enable
+ (or (aref item i) 'make-lucid-menu-keymap-disable))
+ ;; suffix is unimplemented
+ (setq i (length item)))
+ (t
+ (error "Unexpected menu item value: %S"
+ (aref item i))))))))
+ (if (null command)
+ ;; Handle inactive strings specially--allow any number
+ ;; of identical ones.
+ (setcdr menu (cons (list nil name) (cdr menu)))
+ (if name
+ (define-key menu (vector (intern name)) (cons name command)))))