              lst)))))
 
 (defun merlin-occurences-list (lst)
-  (merlin-occurences-populate-buffer lst)
-  (cond ((equal merlin-occurences-show-buffer 'same)
-         (switch-to-buffer (merlin-get-occ-buff)))
-        ((equal merlin-occurences-show-buffer 'other)
-         (switch-to-buffer-other-window (merlin-get-occ-buff)))
-	(t nil)))
-
-(defun merlin-occurences ()
-  (interactive)
-  (merlin-sync-to-point)
+  (save-excursion
+    (merlin-occurences-populate-buffer lst)
+    (cond ((equal merlin-occurences-show-buffer 'same)
+           (switch-to-buffer (merlin-get-occ-buff)))
+          ((equal merlin-occurences-show-buffer 'other)
+           (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))
   (let* ((r (merlin-send-command
              (list 'occurences 'ident 'at
                    (merlin-unmake-point (point))))))

                            (if buff
                                (progn
                                  (pop-to-buffer buff)
                                  (merlin-goto-point start))
                              (message "Closed buffer : %s" src-buff))))))
             (insert "  + ")
             (insert-button

         (lambda (pos)
           (lexical-let*
               ((start (assoc 'start pos))
                (marker (cdr (assoc 'marker pos)))
                (line  (cdr (assoc 'line start)))
                (col   (cdr (assoc 'col  start)))
                (action (lambda (ev)
