Function: ert-simulate-keys

ert-simulate-keys is a macro defined in ert-x.el.gz.

Signature

(ert-simulate-keys KEYS &rest BODY)

Documentation

Execute BODY with KEYS as pseudo-interactive input.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/ert-x.el.gz
(defmacro ert-simulate-keys (keys &rest body)
  "Execute BODY with KEYS as pseudo-interactive input."
  (declare (debug t) (indent 1))
  `(let ((unread-command-events
          ;; Add some C-g to try and make sure we still exit
          ;; in case something goes wrong.
          (append ,keys '(?\C-g ?\C-g ?\C-g)))
         ;; Tell `read-from-minibuffer' not to read from stdin when in
         ;; batch mode.
         (executing-kbd-macro t))
     ,@body))