 (defun merlin-error-check ()
   "Update merlin to the end-of-file, reporting errors."
   (interactive)
+  (merlin--acquire-buffer)
   (when merlin-mode (merlin--error-check t)))
+
+(defun merlin-project-check ()
+  "Display loaded .merlin files and eventual errors."
+  (interactive)
+  (merlin--acquire-buffer)
+  (let* ((project (merlin--project-get))
+         (dots (car project))
+         (messages (cdr project))) ; failures list
+    (add-to-list 'messages
+                 (if dots (concat "Loaded .merlin files: "
+                                  (mapconcat 'identity dots ", "))
+                   "No .merlin loaded"))
+    (message (mapconcat 'identity messages "\n"))))
+
 (define-obsolete-function-alias 'merlin-to-end 'merlin-error-check)
 
 (defun merlin-customize ()


(defcustom merlin-show-instance-in-lighter t
  "Show the current instance of the buffer in the lighter."
  :group 'merlin :type 'boolean)

(defcustom merlin-grouping-function 'merlin-one-group


(defun merlin-lighter ()
  "Return the lighter for merlin which indicates the status of merlin process."
  (if (merlin-process-dead-p) " merlin (DEAD)"
    (let* ((messages nil)
           (project (merlin--project-get)))
      (when merlin-report-dot-merlin-in-lighter
        (cond ((cdr project) (add-to-list 'messages "errors in .merlin"))
              ((not (car project)) (add-to-list 'messages "no .merlin"))))
      (when merlin-show-instance-in-lighter
        (add-to-list 'messages merlin-instance))
      (if messages (concat " merlin (" (mapconcat 'identity messages ",") ")")
          " merlin"))))

;;;###autoload

