 
 (defvar-local merlin--verbosity-cache nil
   "Cache last command to determine verbosity level")
+
+(defvar-local merlin-debug-last-commands nil
+  "Last merlin commands (for debugging)")
 
 ;; Misc
 

  "Stop recording debug information."
  (interactive)
  (setq merlin-debug nil))

(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))
        )
    ;; Log last commands
    (setq merlin-debug-last-commands
          (cons (cons (cons command args) nil) merlin-debug-last-commands))
    (let ((cdr (nthcdr 5 merlin-debug-last-commands)))
      (when cdr (setcdr cdr nil)))
    ;; Compute verbosity

    (when (eq merlin/verbosity-context t)
        (setq merlin/verbosity-context (cons command args)))
    (if (not merlin/verbosity-context)
