   "Execute SCRIPT, using buffer NAME, FILES, and bin UTILS."
   (cl-assert (equal major-mode 'dired-mode) nil "Not in dired-mode")
   (dwim-shell-execute-script script name (dired-get-marked-files) utils
-                               post-process-template on-completion))
+                             post-process-template on-completion))
 
 (defun dwim-shell--dired-files ()
   "List of files in current dired buffer."

    (progress-reporter-update reporter))
  (comint-output-filter process string))

(defun dwim-shell--sentinel (process state)
  (let ((exec (map-elt dwim-shell--execs (process-name process))))
    (when exec
      (progress-reporter-done (dwim-shell--exec-reporter exec)))
    (if (= (process-exit-status process) 0)
        (progn
          (with-current-buffer (dwim-shell--exec-calling-buffer exec)
            (when revert-buffer-function
              (funcall revert-buffer-function))
            (when-let* ((before (dwim-shell--exec-files-before exec))
                        (after (dwim-shell--dired-files))
                        (oldest-new-file (car (last (seq-sort #'file-newer-than-file-p
                                                              (seq-difference after before))))))
              (dired-goto-file oldest-new-file)))
          (when (dwim-shell--exec-on-completion exec)
            (funcall (dwim-shell--exec-on-completion exec)))
          (unless (equal (process-buffer process)
                         (window-buffer (selected-window)))
            (kill-buffer (process-buffer process))))
      (if (y-or-n-p (format "Couldn't run %s, see output? " (buffer-name (process-buffer process))))
          (switch-to-buffer (process-buffer process))
        (kill-buffer (process-buffer process)))))
  (setq dwim-shell--execs
        (map-delete dwim-shell--execs (process-name process))))

(provide 'dwim-shell)

         (template script)
         (script "")
         (files-before)
         (proc)
         (progress-reporter))
    (if (seq-empty-p files)
        (setq script template)
      (seq-do (lambda (file)
