(defvar execute-command-alist '()
"An association list of (command-call . process-object) for all commands executed.")
(defconst execute-list-buffer "*Execute Cmd List*"
"Name of the execute listing buffer.")
(defun execute-program (command)
"Execute the COMMAND asynchronously and track it so later can be listed using `execute-list'."
(start-process-shell-command "execute-process" "execute-process-buffer" command))
(cons (cons command proc-obj) execute-command-alist))
(display-buffer (process-buffer proc-obj))
(defun execute-list ()
"List all the commands executed."
(with-current-buffer (get-buffer-create execute-list-buffer)
(delete-region (point-min) (point-max))
(dolist (e execute-command-alist)
(when (process-status (cdr e))
(insert (format "%d: '%s' - %s - %s\n"
(process-id (cdr e))
(process-status (cdr e))
(process-buffer (cdr e))
(substitute-key-definition 'shell-command 'execute-program (current-global-map))