]> code.delx.au - gnu-emacs-elpa/commitdiff
company-eclim--project-dir: Try to handle non-project buffers
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 19 Jun 2016 23:46:51 +0000 (02:46 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 19 Jun 2016 23:46:51 +0000 (02:46 +0300)
Closes #532

company-eclim.el

index 208daf51402cfacb36a7ec3d2dc1bcfd0301c6cf..b37f75602e01fadc1a9110805b0e08fee47f6659 100644 (file)
@@ -89,10 +89,11 @@ eclim can only complete correctly when the buffer has been saved."
 
 (defun company-eclim--project-dir ()
   (if (eq company-eclim--project-dir 'unknown)
 
 (defun company-eclim--project-dir ()
   (if (eq company-eclim--project-dir 'unknown)
-      (setq company-eclim--project-dir
-            (directory-file-name
-             (expand-file-name
-              (locate-dominating-file buffer-file-name ".project"))))
+      (let ((dir (locate-dominating-file buffer-file-name ".project")))
+        (when dir
+          (setq company-eclim--project-dir
+                (directory-file-name
+                 (expand-file-name dir)))))
     company-eclim--project-dir))
 
 (defun company-eclim--project-name ()
     company-eclim--project-dir))
 
 (defun company-eclim--project-name ()