            (switch-to-buffer-other-window (merlin-get-occ-buff)))
           (t nil))))
 
-(defun merlin-occurences (&optional local-occurences)
-  "List all occurences of buffer under cursor.
-   LOCAL-OCCURENCES restricts the search to the local scope."
-  (interactive)
-  (if local-occurences
-      (merlin-sync-to-point)
-    (merlin-sync-to-point (point-max) t))
+(defun merlin-occurences ()
+  "List all occurences of identifier under cursor in buffer."
+  (interactive)
+  (merlin-sync-to-point (point-max) t)
   (let* ((r (merlin-send-command
              (list 'occurences 'ident 'at
                    (merlin-unmake-point (point))))))

  "Load the .merlin file corresponding to the current buffer."
  (interactive)
  (when buffer-file-name
    (let* ((r (merlin-send-command `(project find ,buffer-file-name)))
           (failed (assoc 'failures r))
           (result (assoc 'result r)))
      (when failed (message (cdr failed)))
      (when (and result (listp (cdr result)))
        (setq merlin-project-file (cadr result)))
      (merlin-rewind))))

(defun merlin-goto-project-file ()
  "Goto the merlin file corresponding to the current file."

    (ignore-errors (merlin-kill-process)))
  (merlin-start-process merlin-current-flags (funcall merlin-grouping-function))
  (setq merlin-pending-errors nil)
  (merlin-load-project-file))

(defun merlin-process-clear-flags ()
  "Clear all flags set up to be passed to merlin.
