   "Stop recording debug information."
   (interactive)
   (setq merlin-debug nil))
+
+(defun merlin-debug-last-commands ()
+  "Display last commands executed and their result (if any)"
+  (interactive)
+  (let (buf)
+    (dolist (command merlin-debug-last-commands)
+      (push (concat "- result: " (or (cdr command) "failed")) buf)
+      (push (mapconcat 'identity
+                       (merlin--map-flatten-to-string "command: " (car command))
+                       " ") buf))
+    (message "Last commands executed, most recent at the end:\n%s"
+             (mapconcat 'identity buf "\n"))))
 
 (defun merlin/buffer-substring (start end)
    "Return content of buffer between two points or empty string if points are not valid"

        (packages    (merlin--map-flatten (lambda (x) (cons "-package" x))
                                          merlin-buffer-packages))
        )
    (when (eq merlin/verbosity-context t)
        (setq merlin/verbosity-context (cons command args)))
    (if (not merlin/verbosity-context)

                   (cons "-flags" merlin-buffer-flags))
                 "-filename" (buffer-file-name (buffer-base-buffer))
                 args))
    (setcdr (car merlin-debug-last-commands)
            (merlin--call-process binary args))))

(defun merlin/call (command &rest args)
  "Execute a command and parse output: return an sexp on success or throw an error"
