]> code.delx.au - gnu-emacs-elpa/commitdiff
company-files--grab-existing-name: Check if the file is remote
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 12 Feb 2015 13:34:48 +0000 (15:34 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 12 Feb 2015 13:35:17 +0000 (15:35 +0200)
Only continue if the connection is already established.

Fixes #301

company-files.el

index 7cfc500751a1c22a4eacc74afa0a29753b893b73..e44b4f5bd4f550215ba8ef68a3016026e6cf68d1 100644 (file)
@@ -1,6 +1,6 @@
 ;;; company-files.el --- company-mode completion back-end for file paths
 
-;; Copyright (C) 2009-2011, 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2009-2011, 2014-2015  Free Software Foundation, Inc.
 
 ;; Author: Nikolaj Schumacher
 
@@ -50,6 +50,8 @@
     (and (cl-dolist (regexp company-files--regexps)
            (when (setq file (company-grab-line regexp 1))
              (cl-return file)))
+         (or (not (file-remote-p file))
+             (file-remote-p file nil t))
          (setq dir (file-name-directory file))
          (not (string-match "//" dir))
          (file-exists-p dir)