   "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"


(defvar-local merlin--verbosity-cache nil
  "Cache last command to determine verbosity level")

;; Misc



(defun merlin--map-flatten (f &rest xs)
  (nreverse (merlin--rev-map-flatten f xs)))

(defun merlin--map-flatten-to-string (&rest xs)
  (merlin--map-flatten
    (lambda (x) (if (stringp x) x (prin1-to-string x))) xs))

(defun merlin--goto-file-and-point (data)
  "Go to the file and position indicated by DATA which is an assoc list
