Function: edmacro-fix-menu-commands

edmacro-fix-menu-commands is a byte-compiled function defined in edmacro.el.gz.

Signature

(edmacro-fix-menu-commands MACRO &optional NOERROR)

Source Code

;; Defined in /usr/src/emacs/lisp/edmacro.el.gz
(defun edmacro-fix-menu-commands (macro &optional noerror)
  (if (vectorp macro)
      (let (result)
        ;; Not preloaded in a --without-x build.
        (require 'mwheel)
	;; Make a list of the elements.
	(setq macro (append macro nil))
	(dolist (ev macro)
	  (cond ((atom ev)
		 (push ev result))
		((eq (car ev) 'help-echo))
		((eq (car ev) 'switch-frame))
		((equal ev '(menu-bar))
		 (push 'menu-bar result))
                ((equal (cadadr ev) '(menu-bar))
		 (push (vector 'menu-bar (car ev)) result))
		;; It would be nice to do pop-up menus, too, but not enough
		;; info is recorded in macros to make this possible.
		((or (mouse-event-p ev) (mouse-movement-p ev)
		     (memq (event-basic-type ev)
			   (list mouse-wheel-down-event mouse-wheel-up-event
				 mouse-wheel-right-event
				 mouse-wheel-left-event)))
		 nil)
		(noerror nil)
		(t
		 (error "`edmacro-fix-menu-commands': Unsupported event: %S"
			ev))))
	;; Reverse them again and make them back into a vector.
	(vconcat (nreverse result)))
    macro))