       (if projectile-use-native-indexing
           (setq files-list (projectile-index-directory directory patterns))
         ;; use external tools to get the project files
-        (let ((current-dir (or (file-name-directory (buffer-file-name))
-                               default-directory)))
+        (let ((current-dir (if (buffer-file-name)
+                               (file-name-directory (buffer-file-name))
+                             default-directory)))
           ;; the shell commands need to invoked in the project's root dir
           (cd (projectile-project-root))
           (setq files-list (projectile-get-repo-files))

    )
  "A list of pairs of commands and prerequisite lambdas to perform project compilation.")

(defvar projectile-projects-cache (make-hash-table :test 'equal)
  "A hashmap used to cache project file names to speed up related operations.")

(defun projectile-version ()

  (multi-occur (projectile-project-buffers)
               (car (occur-read-primary-args))))

(defcustom projectile-show-paths-function 'projectile-hashify-with-uniquify
  "Whether to display paths with projectile-find-file."
  :group 'projectile
  :type '(radio (const :tag "Only show paths to disambiguate files" projectile-hashify-with-uniquify)
                (const :tag "Show relative paths" projectile-hashify-with-relative-paths)))

(defun projectile-hashify-files (files-list)
  (funcall projectile-show-paths-function files-list))

(defun projectile-hashify-with-relative-paths (files-list)
  "Build a hash where the values match FILES-LIST and the keys are ido friendly.
Our keys our relative paths in the project."
  (let ((project-root (projectile-project-root))
        (files-table (make-hash-table :test 'equal)))
    (dolist (current-file files-list files-table)
      (puthash (file-relative-name current-file project-root) current-file files-table))))

